:root {
    --bg-dark: #0f172a;
    --bg-sidebar: #1e293b;
    --bg-card: rgba(30, 41, 59, 0.7);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent-blue: #3b82f6;
    --accent-purple: #8b5cf6;
    --accent-green: #10b981;
    --border-color: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    overflow: hidden;
}

.app-container {
    display: flex;
    width: 100%;
    height: 100vh;
}

/* Sidebar styling */
.sidebar {
    width: 320px;
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    z-index: 10;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.sidebar-header i {
    font-size: 1.75rem;
    color: var(--accent-blue);
}

.sidebar-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
    background: linear-gradient(to right, var(--accent-blue), var(--accent-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.overall-progress {
    background: var(--bg-card);
    padding: 1rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    margin-bottom: 2rem;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.progress-bar-container {
    width: 100%;
    height: 6px;
    background-color: rgba(255,255,255,0.1);
    border-radius: 10px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-blue), var(--accent-purple));
    width: 0%;
    border-radius: 10px;
    transition: width 0.5s ease;
}

.unit-nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
    overflow-y: auto;
}

.unit-nav::-webkit-scrollbar {
    width: 4px;
}
.unit-nav::-webkit-scrollbar-thumb {
    background-color: var(--border-color);
    border-radius: 4px;
}

.nav-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.875rem 1rem;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    color: var(--text-secondary);
}

.nav-item:hover {
    background-color: rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
}

.nav-item.active {
    background-color: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.3);
    color: var(--accent-blue);
    font-weight: 600;
}

.nav-item-progress {
    font-size: 0.75rem;
    background: rgba(0,0,0,0.2);
    padding: 0.2rem 0.5rem;
    border-radius: 10px;
}

.nav-item.completed .nav-item-progress {
    background: rgba(16, 185, 129, 0.2);
    color: var(--accent-green);
}

.reset-btn {
    margin-top: 1rem;
    padding: 0.75rem;
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    font-weight: 500;
}

.reset-btn:hover {
    background: rgba(239, 68, 68, 0.2);
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

/* Background elements */
.main-content::before {
    content: '';
    position: absolute;
    top: -100px;
    right: -100px;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(59,130,246,0.15) 0%, rgba(15,23,42,0) 70%);
    border-radius: 50%;
    z-index: 0;
    pointer-events: none;
}

.main-content::after {
    content: '';
    position: absolute;
    bottom: -150px;
    left: 20%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(139,92,246,0.1) 0%, rgba(15,23,42,0) 70%);
    border-radius: 50%;
    z-index: 0;
    pointer-events: none;
}

.main-header {
    padding: 2.5rem 3rem 1.5rem;
    display: flex;
    flex-direction: column;
    border-bottom: 1px solid var(--border-color);
    z-index: 1;
    backdrop-filter: blur(10px);
    background: rgba(15, 23, 42, 0.7);
}

.header-content-wrapper {
    display: flex;
    justify-content: space-between;
    width: 100%;
    align-items: flex-start;
}

.main-header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.topics-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
    max-width: 600px;
    line-height: 1.5;
}

/* Circular Progress */
.unit-progress-circle {
    width: 70px;
    height: 70px;
    flex-shrink: 0;
}

.circular-chart {
    display: block;
    margin: 0 auto;
    max-width: 100%;
    max-height: 250px;
}

.circle-bg {
    fill: none;
    stroke: rgba(255,255,255,0.05);
    stroke-width: 3;
}

.circle {
    fill: none;
    stroke-width: 3;
    stroke-linecap: round;
    transition: stroke-dasharray 1s ease-out;
    stroke: var(--accent-blue);
}

.percentage {
    fill: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 0.5rem;
    text-anchor: middle;
    font-weight: bold;
}

/* Filters */
.filter-bar {
    width: 100%;
    margin-top: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    background: rgba(255, 255, 255, 0.03);
    padding: 0.75rem 1rem;
    border-radius: 10px;
    border: 1px solid var(--border-color);
}

.filter-group {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.filter-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.filter-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.filter-btn.active {
    background: rgba(59, 130, 246, 0.1);
    border-color: var(--accent-blue);
    color: var(--accent-blue);
}

.toggle-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 20px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(255, 255, 255, 0.1);
    transition: .3s;
    border-radius: 20px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: var(--text-secondary);
    transition: .3s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.5);
}

input:checked + .slider:before {
    transform: translateX(16px);
    background-color: #ef4444;
}

.toggle-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}


/* Content Body */
.content-body {
    flex: 1;
    padding: 2rem 3rem;
    overflow-y: auto;
    z-index: 1;
    scroll-behavior: smooth;
}

.content-body::-webkit-scrollbar {
    width: 6px;
}
.content-body::-webkit-scrollbar-thumb {
    background-color: var(--border-color);
    border-radius: 6px;
}

.category-section {
    margin-bottom: 3rem;
    animation: fadeIn 0.5s ease-out forwards;
    opacity: 0;
    transform: translateY(10px);
}

@keyframes fadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.category-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.category-header h3 {
    font-size: 1.25rem;
    color: var(--accent-purple);
    font-weight: 600;
}

.category-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, var(--border-color) 0%, transparent 100%);
}

.question-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.question-card {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.25rem;
    display: flex;
    gap: 1rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.question-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.question-card.completed {
    border-color: rgba(16, 185, 129, 0.3);
    background: rgba(16, 185, 129, 0.03);
}

.question-card.completed::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--accent-green);
}

.question-card.out-of-syllabus-card {
    opacity: 0.7;
    border-color: rgba(239, 68, 68, 0.2);
}

.question-card.out-of-syllabus-card .question-text {
    color: var(--text-secondary);
}

/* Custom Checkbox */
.checkbox-container {
    position: relative;
    cursor: pointer;
    display: flex;
    align-items: flex-start;
    padding-top: 0.1rem;
}

.checkbox-container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: relative;
    height: 24px;
    width: 24px;
    background-color: rgba(255,255,255,0.05);
    border: 2px solid var(--border-color);
    border-radius: 6px;
    transition: all 0.2s ease;
}

.checkbox-container:hover input ~ .checkmark {
    border-color: var(--accent-blue);
}

.checkbox-container input:checked ~ .checkmark {
    background-color: var(--accent-green);
    border-color: var(--accent-green);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
    left: 7px;
    top: 3px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-container input:checked ~ .checkmark:after {
    display: block;
}

.question-content {
    flex: 1;
}

.question-text {
    font-size: 1.05rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    line-height: 1.4;
    transition: color 0.3s;
}

.question-card.completed .question-text {
    color: var(--text-secondary);
    text-decoration: line-through;
}

.question-details {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
    background: rgba(0,0,0,0.2);
    padding: 0.75rem;
    border-radius: 8px;
    border-left: 2px solid var(--border-color);
    white-space: pre-line;
    margin-bottom: 0.5rem;
}

/* Tag Styles */
.tags-container {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}

.tag {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 0;
}

.tag.qb {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.tag.pyq {
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent-blue);
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.tag.important {
    background: rgba(139, 92, 246, 0.1);
    color: var(--accent-purple);
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.tag.repeated {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.tag.out-of-syllabus {
    background: rgba(239, 68, 68, 0.05);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}


/* Responsive */
@media (max-width: 768px) {
    body {
        overflow-y: auto;
    }

    .app-container {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        padding: 0.75rem 1rem;
        position: sticky;
        top: 0;
        z-index: 20;
    }

    .sidebar-header {
        margin-bottom: 0.5rem;
        gap: 0.5rem;
    }
    
    .sidebar-header h2 {
        font-size: 1.1rem;
    }
    
    .sidebar-header i {
        font-size: 1.3rem;
    }

    .overall-progress {
        display: none; /* Hide on mobile to save vertical space */
    }
    
    .unit-nav {
        flex-direction: row;
        overflow-x: auto;
        gap: 0.5rem;
        padding-bottom: 0.5rem;
        -ms-overflow-style: none;
        scrollbar-width: none;
    }
    
    .unit-nav::-webkit-scrollbar {
        display: none;
    }
    
    .nav-item {
        white-space: nowrap;
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
    }

    .reset-btn {
        margin-top: 0.5rem;
        padding: 0.4rem;
        font-size: 0.8rem;
    }
    
    .main-content {
        overflow: visible;
    }
    
    .main-header {
        padding: 1.25rem 1rem 1rem;
        flex-direction: column;
        align-items: flex-start;
        position: relative;
    }

    .header-content-wrapper {
        flex-direction: column;
        gap: 0.75rem;
        align-items: flex-start;
    }

    .main-header h1 {
        font-size: 1.3rem;
        margin-right: 3rem;
        margin-bottom: 0.25rem;
    }

    .topics-text {
        font-size: 0.8rem;
        padding-right: 3rem;
    }
    
    .unit-progress-circle {
        position: absolute;
        top: 1.25rem;
        right: 1rem;
        width: 45px;
        height: 45px;
        margin-top: 0;
    }
    
    .filter-bar {
        margin-top: 1rem;
        padding: 0.6rem;
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    .filter-group {
        justify-content: center;
        width: 100%;
    }
    
    .filter-btn {
        flex: 1;
        text-align: center;
        padding: 0.4rem 0.2rem;
        font-size: 0.75rem;
    }
    
    .toggle-group {
        justify-content: flex-end;
    }

    .content-body {
        padding: 1rem 1rem 4rem 1rem;
        overflow: visible;
    }

    .category-header h3 {
        font-size: 1.1rem;
    }

    .question-list {
        gap: 0.75rem;
    }

    .question-card {
        padding: 0.85rem;
        gap: 0.6rem;
    }
    
    .checkmark {
        height: 20px;
        width: 20px;
    }
    
    .checkmark:after {
        left: 5px;
        top: 1px;
        width: 4px;
        height: 9px;
    }

    .tags-container {
        gap: 0.3rem;
        margin-bottom: 0.5rem;
    }
    
    .tag {
        padding: 0.15rem 0.4rem;
        font-size: 0.65rem;
    }

    .question-text {
        font-size: 0.95rem;
        margin-bottom: 0.4rem;
    }

    .question-details {
        font-size: 0.8rem;
        padding: 0.5rem;
    }
}
