/* The Troubleshooter's Hub - Modern Design System */

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #ec4899;
    --accent: #f59e0b;
    --success: #10b981;
    --danger: #ef4444;
    --bg: #0f172a;
    --surface: #1e293b;
    --border: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --body-bg-image: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    --header-bg: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    --header-border: rgba(99, 102, 241, 0.3);
    --header-link-color: white;
    --nav-link-color: rgba(255, 255, 255, 0.9);
    --accordion-bg: rgba(99, 102, 241, 0.05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    line-height: 1.6;
    background-color: var(--bg);
    color: var(--text-primary);
    backdrop-filter: blur(5px);
    background-image: url(../images/drives.jpg);
    background-size: cover;
    background-attachment: fixed;
    backdrop-filter: brightness(0.6);
    min-height: 100vh;
}

body.light-mode {
    --bg: #f8fafc;
    --surface: #ffffff;
    --border: #d1d5db;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #6b7280;
    --body-bg-image: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    --header-bg: #ffffff;
    --header-border: rgba(148, 163, 184, 0.25);
    --header-link-color: #0f172a;
    --nav-link-color: rgba(15, 23, 42, 0.85);
    --accordion-bg: rgba(15, 23, 42, 0.03);
}


/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
.h3 { font-size: 1.5rem; }
.h5 { font-size: 1.125rem; }
.display-6 { font-size: 1.875rem; font-weight: 700; }
.lead { font-size: 1.125rem; color: var(--text-secondary); line-height: 1.8; }

/* Header & Navigation */
header {
    background: var(--header-bg);
    box-shadow: 0 20px 25px -5px rgba(99, 102, 241, 0.2);
    border-bottom: 1px solid var(--header-border);
    position: static;
    z-index: 1000;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.8rem;
    padding: 1rem 1rem;
}

header.py-4 {
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
}

header h1 {
    font-size: 1.5rem;
    color: white;
    margin: 0;
}

header a {
    text-decoration: none;
    color: var(--header-link-color);
}

body.light-mode header .text-white {
    color: var(--header-link-color) !important;
}

header .dropdown {
    position: relative;
}

.dropdown-toggle {
    appearance: none;
    border: none;
    background: transparent;
    color: inherit;
    font: inherit;
    cursor: pointer;
    padding: 0;
    margin: 0;
}

.dropdown-toggle::after {
    content: '▾';
    display: inline-block;
    margin-left: 0.35rem;
    font-size: 0.8rem;
    transition: transform 0.2s ease;
}

.dropdown-toggle[aria-expanded="true"]::after {
    transform: rotate(180deg);
}



.dropdown-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    min-width: 12rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.85rem;
    box-shadow: 0 18px 30px rgba(0, 0, 0, 0.12);
    padding: 0.5rem 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-0.25rem);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
    z-index: 200;
}

.dropdown-menu.show,
header .dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    text-decoration: none;
    transition: background 0.2s ease;
}

.dropdown-item:hover,
.dropdown-item:focus {
    background: rgba(99, 102, 241, 0.08);
    color: var(--text-primary);
}

.dropdown-item:not(:last-child) {
    border-bottom: 1px solid var(--border);
}

@media (max-width: 767px) {
    header .dropdown:hover .dropdown-menu {
        opacity: 0;
        visibility: hidden;
        transform: translateY(-0.25rem);
    }
}
/*Navigation*/
.nav {
    display: flex;
    gap: 2rem;
    align-items: center;
    flex-wrap: wrap;
}

.nav-link {
    color: var(--nav-link-color);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    position: relative;
    transition: all 0.3s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: rgba(255, 255, 255, 0.8);
    transition: width 0.3s ease;
}

.nav-link:hover {
    color: white;
}

.nav-link:hover::after {
    width: 100%;
}

/* Container & Grid */
.container {
    width: min(1200px, 100% - 2rem);
    margin-left: auto;
    margin-right: auto;
}

.row {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.row.g-4 { gap: 2rem; }
.row.g-3 { gap: 1.5rem; }
.row.gy-4 { row-gap: 2rem; }

.col-md-6 { flex: 0 0 100%; }
.col-lg-7 { flex: 0 0 100%; }
.col-lg-5 { flex: 0 0 100%; }
.col-xl-3 { flex: 0 0 100%; }

@media (min-width: 768px) {
    .col-md-6 { flex: 0 0 50%; }
    .col-md-4 { flex: 0 0 33.333%; }
}

@media (min-width: 992px) {
    .col-lg-7 { flex: 0 0 58.333%; }
    .col-lg-5 { flex: 0 0 41.667%; }
}

@media (min-width: 1200px) {
    .col-xl-3 { flex: 0 0 25%; }
}

/* Cards */
.card {
    background: radial-gradient(circle at top left, rgba(99, 102, 241, 0.15), var(--surface) 45%);
    border: 1px solid rgba(99, 102, 241, 0.18);
    border-radius: 1rem;
    overflow: hidden;
    transition: transform 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease;
    display: flex;
    flex-direction: column;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.08);
}

.card:hover {
    transform: translateY(-10px) scale(1.01);
    border-color: var(--primary);
    box-shadow: 0 30px 50px rgba(0, 0, 0, 0.18);
}

.card-body {
    padding: 2rem;
    flex-grow: 1;
}

.card h3 {
    margin-bottom: 1rem;
    color: white;
}

.card p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}


/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.875rem 1.5rem;
    border-radius: 0.75rem;
    border: none;
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    gap: 0.5rem;
}

.theme-icon {
    font-size: 1.1rem;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
}

.btn-primary:hover {
    opacity: 0.9;
}

.btn-light {
    background: white;
    color: var(--dark-bg);
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-outline-primary {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-outline-primary:hover {
    background: var(--primary);
    color: white;
}

#theme-toggle {
    white-space: nowrap;
}

body.light-mode #theme-toggle {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-success {
    background-color: var(--success);
    color: white;
}


/* Forms */
.form-label {
    display: block;
    margin-bottom: 0.75rem;
    font-weight: 600;
    color: white;
}

.form-control,
.form-select {
    width: 100%;
    padding: 0.875rem 1rem;
    background-color: var(--dark-surface);
    border: 1px solid var(--dark-border);
    border-radius: 0.75rem;
    color: white;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-control:focus,
.form-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    background-color: var(--dark-surface);
}

.form-control::placeholder {
    color: var(--text-muted);
}

/* Flex Utilities */
.d-flex { display: flex; }
.flex-column { flex-direction: column; }
.flex-row { flex-direction: row; }
.flex-sm-row { flex-direction: column; }
@media (min-width: 576px) { .flex-sm-row { flex-direction: row; } }
.align-items-center { align-items: center; }
.justify-content-between { justify-content: space-between; }
.align-items-start { align-items: flex-start; }

/* Spacing Utilities */
.gap-3 { gap: 1rem; }
.gap-4 { gap: 1.5rem; }
.mb-0 { margin-bottom: 0; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mt-4 { margin-top: 1.5rem; }
.mt-5 { margin-top: 3rem; }
.py-4 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.py-5 { padding-top: 3rem; padding-bottom: 3rem; }
.px-4 { padding-left: 1.5rem; padding-right: 1.5rem; }

/* Text Utilities */
.text-white { color: white; }
.text-black { color: black; }
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-muted { color: var(--text-muted); }
.text-decoration-none { text-decoration: none; }
.resources-link { color: var(--accent); font-weight: 600; transition: color 0.2s ease, transform 0.2s ease; }
.resources-link:hover,
.resources-link:focus { color: #fcd34d; transform: translateX(2px); text-decoration: underline; }

/* Background Utilities */
.bg-primary { background: var(--primary); }
.bg-dark { background: var(--dark-surface); }


/* Lists */
.list-group {
    list-style: none;
    padding: 0;
    margin: 0;
}

.list-group-item {
    padding: 1rem 0;
    border-bottom: 1px solid var(--dark-border);
    color: var(--text-secondary);
}

.list-group-item:last-child {
    border-bottom: none;
}

/* Tables */
.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 1rem;
    border-bottom: 1px solid var(--dark-border);
    text-align: left;
}

.table th {
    background: var(--dark-surface);
    font-weight: 600;
    color: white;
}

.table tr:hover {
    background-color: rgba(99, 102, 241, 0.05);
}

/* Accordions */
.accordion {
    margin-top: 1.5rem;
}

.accordion-item {
    background: var(--dark-surface);
    border: 1px solid var(--dark-border);
    border-radius: 1rem;
    margin-bottom: 1rem;
    overflow: hidden;
}

.accordion-button {
    width: 100%;
    padding: 1.25rem 1.5rem;
    background: transparent;
    border: none;
    color: white;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.accordion-button:hover {
    background-color: rgba(99, 102, 241, 0.05);
}

body.light-mode .accordion-button:hover {
    background-color: rgba(15, 23, 42, 0.06);
}

.accordion-button::after {
    content: '▼';
    font-size: 0.75rem;
    transition: transform 0.3s ease;
    color: var(--primary);
}

.accordion-button.collapsed::after {
    content: '▶';
}

.accordion-collapse {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.accordion-collapse.show {
    max-height: 1000px;
}

.accordion-body {
    padding: 1.5rem;
    background-color: rgba(99, 102, 241, 0.05);
    border-top: 1px solid var(--dark-border);
}


/* Footer */
footer {
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 3rem 0 1rem;
    margin-top: 5rem;
}

.footer-divider {
    border: none;
    border-top: 1px solid var(--dark-border);
    margin: 1rem 0;
}

.footer-bottom {
    text-align: center;
    padding-top: 1rem;
    border-top: 1px solid var(--dark-border);
    font-size: 0.875rem;
    
}

/* Badge */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--primary);
    color: white;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Shadows */
.shadow-sm { box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1); }
.shadow-lg { box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3); }

/* Borders */
.border-0 { border: none !important; }

/* Spinner Animation */
.spinner-border {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid rgba(255, 255, 255, 0.25);
    border-top-color: white;
    border-radius: 50%;
    animation: spinner 0.75s linear infinite;
    margin-right: 0.5rem;
}

@keyframes spinner {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    h1 { font-size: 2rem; }
    h2 { font-size: 1.5rem; }
    .display-6 { font-size: 1.5rem; }
    .nav { gap: 1rem; }
    .card-body { padding: 1.5rem; }
    header .container {
        gap: 1rem;
        padding: 1rem;
    }
}
