@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Poppins:wght@300;400;500;600;700;800&display=swap');

:root {
    --primary-color: #22C55E;
    --primary-hover: #16A34A;
    --primary-glow: rgba(34, 197, 94, 0.15);
    --bg-color: #0F172A;
    --card-bg: #1E293B;
    --text-primary: #F8FAFC;
    --text-secondary: #E2E8F0;
    --text-muted: #94A3B8;
    --border-color: #334155;
    --border-hover: #475569;
    --navbar-bg: rgba(15, 23, 42, 0.85);
    --footer-bg: #0F172A;
    --footer-text: #E2E8F0;
    --footer-text-muted: #94A3B8;
    --font-primary: 'Inter', sans-serif;
    --font-heading: 'Poppins', sans-serif;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.2);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
    --shadow-premium: 0 20px 40px -15px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px rgba(34, 197, 94, 0.2);
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html[data-theme="light"] {
    --bg-color: #F8FAFC;
    --card-bg: #FFFFFF;
    --text-primary: #0F172A;
    --text-secondary: #334155;
    --text-muted: #64748B;
    --border-color: #E2E8F0;
    --border-hover: #CBD5E1;
    --navbar-bg: rgba(248, 250, 252, 0.8);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.05);
    --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.05);
    --shadow-premium: 0 20px 40px -15px rgba(0, 0, 0, 0.06);
    --shadow-glow: 0 0 20px rgba(34, 197, 94, 0.1);
}

body {
    font-family: var(--font-primary);
    background-color: var(--bg-color);
    color: var(--text-secondary);
    line-height: 1.6;
    transition: background-color var(--transition-normal), color var(--transition-normal);
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--text-primary);
    font-weight: 600;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary-hover);
}

/* Navbar Layout */
.navbar-custom {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1050;
    background-color: var(--navbar-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    padding: 0.8rem 0;
    transition: all var(--transition-normal);
}

.navbar-brand-img {
    height: 46px;
    width: auto;
    object-fit: contain;
    margin-left: -20px;
}

html[data-theme="dark"] .navbar-brand-img {
    filter: invert(1) hue-rotate(180deg);
}

.navbar-nav .nav-link {
    font-weight: 500;
    color: var(--text-secondary);
    padding: 0.5rem 1rem !important;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
    color: var(--primary-color);
    background-color: var(--primary-glow);
}

.theme-toggle-btn {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.5rem;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.theme-toggle-btn:hover {
    background-color: var(--primary-glow);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

html[data-theme="light"] .fa-sun,
html[data-theme="dark"] .fa-moon {
    display: none;
}

html[data-theme="light"] .fa-moon,
html[data-theme="dark"] .fa-sun {
    display: block;
}

/* Banner styling */
.page-banner {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(15, 23, 42, 0.8)), url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><circle cx="50" cy="50" r="1" fill="%2322C55E" opacity="0.3"/></svg>') repeat;
    color: #FFFFFF;
    padding: 8rem 0 4rem 0;
    border-bottom: 1px solid var(--border-color);
    overflow: hidden;
    margin-top: 60px;
}

.page-banner h1 {
    color: #FFFFFF;
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.page-banner-sub {
    font-size: 1.1rem;
    color: #94A3B8;
    max-width: 700px;
}

.breadcrumb-custom {
    display: flex;
    gap: 0.5rem;
    list-style: none;
    padding-left: 0;
    margin-top: 1rem;
    font-size: 0.9rem;
    color: #64748B;
}

.breadcrumb-custom a {
    color: var(--primary-color);
}

.breadcrumb-custom li:not(:last-child)::after {
    content: '/';
    margin-left: 0.5rem;
    color: #64748B;
}

/* Sidebar Styling */
.sidebar-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 100px;
    max-height: calc(100vh - 130px);
    overflow-y: auto;
}

.sidebar-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.progress-bar-container {
    background-color: var(--bg-color);
    border-radius: var(--radius-sm);
    height: 10px;
    width: 100%;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-bar-fill {
    background: linear-gradient(90deg, var(--primary-color), #4ADE80);
    height: 100%;
    width: 0%;
    transition: width 0.4s ease;
}

.stat-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.stat-item {
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    padding: 0.75rem;
    border-radius: var(--radius-md);
    text-align: center;
    transition: all var(--transition-fast);
    cursor: pointer;
}

.stat-item:hover {
    border-color: var(--primary-color);
    background-color: var(--primary-glow);
}

.stat-item.active-stat-filter {
    border-color: var(--primary-color) !important;
    background-color: var(--primary-glow) !important;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.2);
}

#stat-item-bookmarks.active-stat-filter {
    border-color: #EAB308 !important;
    background-color: rgba(234, 179, 8, 0.1) !important;
    box-shadow: 0 0 8px rgba(234, 179, 8, 0.2);
}

.stat-val {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
}

.stat-lbl {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

.category-list {
    list-style: none;
    padding-left: 0;
    margin-bottom: 0;
}

.category-item-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    width: 100%;
    text-align: left;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all var(--transition-fast);
}

.category-item-btn:hover,
.category-item-btn.active {
    background-color: var(--primary-glow);
    color: var(--primary-color);
}

.category-badge {
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 0.1rem 0.4rem;
    font-size: 0.75rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
}

.category-item-btn.active .category-badge {
    background-color: var(--primary-color);
    color: #FFFFFF;
    border-color: var(--primary-color);
}

/* Control Panel */
.controls-wrapper {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.search-box-custom {
    position: relative;
    width: 100%;
    margin-bottom: 1rem;
}

.search-input-custom {
    width: 100%;
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.75rem 1.25rem 0.75rem 2.75rem;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    outline: none;
    transition: all var(--transition-fast);
}

.search-input-custom:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.search-icon-custom {
    position: absolute;
    left: 1.1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.action-btns-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.btn-action {
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background-color: var(--bg-color);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.btn-action:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background-color: var(--primary-glow);
}

.btn-action.active {
    background-color: var(--primary-color);
    color: #FFFFFF;
    border-color: var(--primary-color);
    box-shadow: var(--shadow-glow);
}

/* Question Cards (Accordions) */
.q-card-item {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    margin-bottom: 1rem;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
}

.q-card-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--border-hover);
}

.q-card-header {
    padding: 1.25rem 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    user-select: none;
}

.q-card-title-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-grow: 1;
}

.q-card-number {
    font-family: var(--font-heading);
    font-weight: 800;
    color: var(--primary-color);
    font-size: 1.1rem;
    min-width: 35px;
}

.q-card-title {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 0;
    color: var(--text-primary);
}

.q-card-badges {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.badge-difficulty {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-sm);
    letter-spacing: 0.05em;
}

.difficulty-beginner {
    background-color: rgba(34, 197, 94, 0.1);
    color: #22C55E;
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.difficulty-intermediate {
    background-color: rgba(245, 158, 11, 0.1);
    color: #F59E0B;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.difficulty-advanced {
    background-color: rgba(239, 68, 68, 0.1);
    color: #EF4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.q-card-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.action-icon-btn {
    background: none;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.action-icon-btn:hover {
    color: var(--primary-color);
    transform: scale(1.1);
}

.action-icon-btn.active-bookmark {
    color: #EAB308 !important; /* Gold */
}

.action-icon-btn.active-completed {
    color: var(--primary-color) !important;
}

.chevron-icon {
    font-size: 1rem;
    color: var(--text-muted);
    transition: transform var(--transition-normal);
}

.q-card-item.expanded .chevron-icon {
    transform: rotate(180deg);
}

.q-card-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-normal) ease-out;
    border-top: 0 solid var(--border-color);
}

.q-card-item.expanded .q-card-body {
    max-height: 2000px; /* Safe upper limit */
    border-top-width: 1px;
    transition: max-height var(--transition-normal) ease-in;
}

.q-card-body-content {
    padding: 1.5rem;
}

/* Detail Blocks inside card body */
.detail-block {
    margin-bottom: 1.25rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px dashed var(--border-color);
}

.detail-block:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.block-title {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.block-title i {
    color: var(--primary-color);
}

.block-text {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.answer-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 1rem;
}

.answer-card {
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
}

.answer-card-title {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.title-poor { color: #EF4444; }
.title-better { color: #22C55E; }

.answer-card-text {
    font-size: 0.9rem;
    font-style: italic;
}

.key-points-list {
    list-style: none;
    padding-left: 0;
    margin-bottom: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.key-point-tag {
    background-color: var(--primary-glow);
    color: var(--primary-color);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    border: 1px solid rgba(34, 197, 94, 0.1);
}

/* Interview & Quiz Mode styling */
.mode-overlay {
    background-color: var(--card-bg);
    border: 1px solid var(--primary-color);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    text-align: center;
    box-shadow: var(--shadow-premium), var(--shadow-glow);
    margin-bottom: 1.5rem;
}

.btn-action.active-bookmark-mode {
    color: #EAB308 !important;
    border-color: #EAB308 !important;
    background-color: rgba(234, 179, 8, 0.1) !important;
}

.btn-action.active-completed-mode {
    color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    background-color: var(--primary-glow) !important;
}

.mode-indicator {
    display: inline-block;
    background-color: var(--primary-glow);
    color: var(--primary-color);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
}

.mode-question {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    font-family: var(--font-heading);
}

.mode-btns {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

/* Scroll to top button */
.back-to-top {
    position: fixed;
    bottom: 25px;
    right: 25px;
    z-index: 1000;
    width: 45px;
    height: 45px;
    background-color: var(--primary-color);
    color: #FFFFFF;
    border: none;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    box-shadow: 0 4px 10px rgba(34, 197, 94, 0.3);
    transition: all var(--transition-normal);
}

.back-to-top.active {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background-color: var(--primary-hover);
    transform: translateY(-3px);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-color);
}

::-webkit-scrollbar-thumb {
    background: var(--border-hover);
    border-radius: var(--radius-sm);
    border: 2px solid var(--bg-color);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Print stylesheet */
@media print {
    body {
        background: #FFFFFF !important;
        color: #000000 !important;
    }
    .navbar-custom, .page-banner, .controls-wrapper, .sidebar-wrapper, .back-to-top, footer, .q-card-actions, .chevron-icon {
        display: none !important;
    }
    .q-card-item {
        border: none !important;
        box-shadow: none !important;
        margin-bottom: 2.5rem !important;
        page-break-inside: avoid;
    }
    .q-card-body {
        max-height: none !important;
        border-top: 1px solid #000000 !important;
    }
    .q-card-header {
        cursor: default !important;
        padding: 0.5rem 0 !important;
    }
    .q-card-title {
        font-size: 1.25rem !important;
        color: #000000 !important;
    }
    .answer-grid {
        grid-template-columns: 1fr !important;
    }
    .detail-block {
        border-bottom: 1px solid #CCCCCC !important;
    }
}

@media (max-width: 991.98px) {
    .sidebar-card {
        position: relative;
        top: 0;
        max-height: none;
        margin-bottom: 2rem;
    }
    .answer-grid {
        grid-template-columns: 1fr;
    }
}

/* Footer Section Styles */
.footer-custom {
    background-color: var(--footer-bg);
    color: var(--footer-text);
    padding: 4rem 0 2rem 0;
    border-top: 1px solid var(--border-color);
    overflow: hidden;
}

.footer-brand-img {
    height: 48px;
    width: auto;
    object-fit: contain;
    margin-bottom: 1.25rem;
    transition: transform var(--transition-fast);
    filter: invert(1) hue-rotate(180deg); /* Always invert as footer is always dark */
}

.footer-brand-img:hover {
    transform: scale(1.02);
}

.footer-tagline {
    color: var(--footer-text-muted);
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    max-width: 320px;
}

.footer-title {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    color: #FFFFFF;
    margin-bottom: 1.25rem;
    position: relative;
    padding-bottom: 0.5rem;
    font-weight: 700;
}

.footer-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 30px;
    height: 2px;
    background-color: var(--primary-color);
}

/* Footer Link & Text Color Contrast Adjustments */
.footer-custom p,
.footer-custom li,
.footer-custom span,
.footer-custom div,
.footer-custom .text-muted {
    color: var(--footer-text-muted) !important;
}

.footer-custom a {
    color: var(--footer-text-muted) !important;
    text-decoration: none;
    transition: all var(--transition-fast);
}

.footer-custom a:hover {
    color: var(--primary-color) !important;
}

