/* ===================================
   PRACTICE PAGE - REDESIGNED
   =================================== */

/* Page Body */
.practice-page {
    background: #f1f5f9;
    min-height: 100vh;
}

/* ===================================
   LOGIN MODAL (matches mock-exam)
   =================================== */
.practice-page .login-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.practice-page .login-modal-overlay.active {
    display: flex;
}

.practice-page .login-modal {
    background: white;
    border-radius: 16px;
    padding: 0;
    max-width: 400px;
    width: 100%;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    animation: modalSlideUp 0.3s ease;
    overflow: hidden;
}

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.practice-page .login-modal .modal-header {
    padding: 1.5rem;
    text-align: center;
    border-bottom: 1px solid #e2e8f0;
}

.practice-page .login-modal .modal-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 1.5rem;
}

.practice-page .login-modal .modal-icon.warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
}

.practice-page .login-modal .modal-header h3 {
    font-size: 1.25rem;
    color: #1E293B;
    margin: 0;
    font-weight: 700;
}

.practice-page .login-modal .modal-body {
    padding: 1.5rem;
    text-align: center;
}

.practice-page .login-modal .modal-body p {
    color: #64748B;
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0;
}

.practice-page .login-modal .modal-footer {
    padding: 1rem 1.5rem 1.5rem;
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.practice-page .login-modal .modal-footer .btn {
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 8px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
}

.practice-page .login-modal .modal-footer .btn-secondary {
    background: #f1f5f9;
    color: #64748B;
}

.practice-page .login-modal .modal-footer .btn-secondary:hover {
    background: #e2e8f0;
}

.practice-page .login-modal .modal-footer .btn-primary {
    background: linear-gradient(135deg, #2563EB 0%, #1D4ED8 100%);
    color: white;
}

.practice-page .login-modal .modal-footer .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

/* ===================================
   PAGE HEADER - Matches exam.css
   =================================== */
.practice-page .page-header {
    background: white;
    padding: 30px 20px;
    border-bottom: 1px solid var(--border-color, #E2E8F0);
    position: relative;
}

.practice-page .page-header .container {
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
    text-align: center;
    padding: 0 100px;
}

.practice-page .page-header .back-link {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-color, #334155);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
}

.practice-page .page-header .back-link:hover {
    background: var(--primary-color, #2563EB);
    color: white;
    transform: translateY(-50%) translateX(-3px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.practice-page .page-header .back-link i {
    font-size: 0.85rem;
    transition: transform 0.3s ease;
}

.practice-page .page-header .back-link:hover i {
    transform: translateX(-2px);
}

.practice-page .page-header h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    margin-top: 0;
    color: var(--primary-dark, #1E40AF);
    font-weight: 700;
    letter-spacing: -0.5px;
}

.practice-page .page-header h1 i {
    color: var(--primary-color, #2563EB);
    margin-right: 0.5rem;
}

.practice-page .page-header p {
    font-size: 1rem;
    color: var(--text-color, #334155);
    margin: 0;
}

/* ===================================
   PRACTICE LAYOUT
   =================================== */
.practice-layout {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    max-width: 1600px;
    margin: 0 auto;
    padding: 1rem;
    min-height: calc(100vh - 200px);
}

/* ===================================
   SIDEBAR
   =================================== */
.practice-sidebar {
    width: 280px;
    flex-shrink: 0;
    position: sticky;
    top: 20px;
    height: fit-content;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(37, 99, 235, 0.15), 0 0 0 1px rgba(37, 99, 235, 0.1);
    padding: 0;
    z-index: 100;
    transition: transform 0.3s ease;
    animation: sidebarGlow 3s ease-in-out infinite;
}

@keyframes sidebarGlow {
    0%, 100% {
        box-shadow: 0 8px 32px rgba(37, 99, 235, 0.15), 0 0 0 1px rgba(37, 99, 235, 0.1);
    }
    50% {
        box-shadow: 0 8px 40px rgba(37, 99, 235, 0.25), 0 0 0 2px rgba(37, 99, 235, 0.2);
    }
}

.practice-sidebar .sidebar-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.25rem 1.5rem;
    background: linear-gradient(135deg, #2563EB 0%, #1D4ED8 50%, #1e40af 100%);
    color: #fff;
    font-weight: 700;
    font-size: 1.15rem;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
    border-radius: 16px 16px 0 0;
}

.practice-sidebar .sidebar-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.1), transparent);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%) rotate(45deg); }
    100% { transform: translateX(100%) rotate(45deg); }
}

.practice-sidebar .sidebar-header i {
    font-size: 1.4rem;
    color: #fff;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Section Accordion */
.section-accordion {
    border-bottom: 1px solid #e2e8f0;
}

.section-toggle {
    width: 100%;
    padding: 1rem 1.25rem;
    background: none;
    border: none;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    transition: background 0.2s ease;
    text-align: left;
}

.section-toggle:hover {
    background: #f8fafc;
}

.section-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.95rem;
    flex-shrink: 0;
}

.section-a-icon { background: linear-gradient(135deg, #10B981 0%, #059669 100%); }
.section-b-icon { background: linear-gradient(135deg, #6366F1 0%, #4F46E5 100%); }
.section-c-icon { background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%); }

.section-name {
    flex: 1;
    font-weight: 600;
    color: #1E293B;
    font-size: 0.9rem;
}

.section-toggle .toggle-icon {
    color: #94A3B8;
    font-size: 0.75rem;
    transition: transform 0.3s ease;
}

.section-accordion.active > .section-toggle .toggle-icon {
    transform: rotate(180deg);
}

.section-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: #f8fafc;
}

.section-accordion.active > .section-content {
    max-height: 1000px;
}

/* Subject Accordion */
.subject-accordion {
    border-top: 1px solid #e2e8f0;
}

.subject-toggle {
    width: 100%;
    padding: 0.75rem 1.25rem 0.75rem 2rem;
    background: none;
    border: none;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    cursor: pointer;
    transition: background 0.2s ease;
    text-align: left;
}

.subject-toggle:hover {
    background: #f1f5f9;
}

.subject-toggle i:first-child {
    color: #64748B;
    font-size: 0.85rem;
    width: 20px;
}

.subject-toggle span {
    flex: 1;
    font-weight: 500;
    color: #334155;
    font-size: 0.85rem;
}

.subject-toggle .toggle-icon {
    color: #94A3B8;
    font-size: 0.65rem;
    transition: transform 0.3s ease;
}

.subject-accordion.active > .subject-toggle .toggle-icon {
    transform: rotate(90deg);
}

.subject-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: #f1f5f9;
}

.subject-accordion.active > .subject-content {
    max-height: 500px;
}

/* Topic Links */
.topic-link {
    display: block;
    padding: 0.6rem 1.25rem 0.6rem 3.5rem;
    color: #64748B;
    text-decoration: none;
    font-size: 0.82rem;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.topic-link:hover {
    background: #e2e8f0;
    color: #2563EB;
    border-left-color: #2563EB;
}

.topic-link.active {
    background: rgba(37, 99, 235, 0.1);
    color: #2563EB;
    font-weight: 600;
    border-left-color: #2563EB;
}

/* Mobile Sidebar */
.mobile-sidebar-toggle {
    display: none;
    position: fixed;
    top: 80px;
    left: 10px;
    z-index: 99;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: white;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    color: #1E293B;
    font-size: 1.1rem;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99;
}

/* ===================================
   MAIN CONTENT
   =================================== */
.practice-main {
    flex: 1;
    min-width: 0;
    max-width: 100%;
    padding: 0;
    display: flex;
    flex-direction: column;
    background: white;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    overflow: hidden;
    height: calc(100vh - 100px);
}

/* Welcome State */
.welcome-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    text-align: center;
    padding: 2rem;
}

.welcome-icon {
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, #2563EB 0%, #6366F1 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: white;
    margin-bottom: 1.5rem;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.welcome-state h2 {
    color: #1E293B;
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
}

.welcome-state p {
    color: #64748B;
    font-size: 1rem;
    margin-bottom: 2rem;
}

.welcome-stats {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    justify-content: center;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #64748B;
    font-size: 0.95rem;
}

.stat-item i {
    color: #2563EB;
}

/* ===================================
   QUESTIONS CONTAINER
   =================================== */
.questions-container {
    max-width: 100%;
    margin: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow-y: auto;
}

.questions-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 2px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.topic-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.topic-breadcrumb i {
    color: #CBD5E1;
    font-size: 0.7rem;
}

.breadcrumb-home {
    color: #2563EB;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.breadcrumb-home:hover {
    background: rgba(37, 99, 235, 0.1);
    text-decoration: underline;
}

.breadcrumb-section {
    color: #10B981;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.breadcrumb-section:hover {
    background: rgba(16, 185, 129, 0.1);
    text-decoration: underline;
}

.breadcrumb-subject {
    color: #6366F1;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.breadcrumb-subject:hover {
    background: rgba(99, 102, 241, 0.1);
    text-decoration: underline;
}

.breadcrumb-topic {
    color: #1E293B;
    font-weight: 600;
}

.questions-count {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #64748B;
    font-size: 0.9rem;
    background: #f1f5f9;
    padding: 0.5rem 1rem;
    border-radius: 20px;
}

.questions-count i {
    color: #2563EB;
}

/* Questions List */
.questions-list {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    max-width: 900px;
    width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
}

/* Question Card */
.question-card {
    background: white;
    border-radius: 14px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}

.question-card:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.question-header {
    padding: 1rem 1.25rem;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.question-number {
    font-weight: 700;
    color: #2563EB;
    font-size: 0.9rem;
}

.question-status {
    font-size: 0.8rem;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-weight: 500;
}

.question-status.unanswered {
    background: #f1f5f9;
    color: #64748B;
}

.question-status.correct {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
}

.question-status.incorrect {
    background: rgba(239, 68, 68, 0.1);
    color: #DC2626;
}

.question-body {
    padding: 1.25rem;
}

.question-text {
    color: #1E293B;
    font-size: 1rem;
    line-height: 1.7;
    margin-bottom: 1.25rem;
    white-space: pre-wrap;
}

/* Code block styling - Same as mock test, non-selectable */
.question-text pre,
.question-text code,
.question-text .code-block {
    display: block;
    background: #1e293b;
    color: #e2e8f0;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.8rem;
    line-height: 1.4;
    margin: 0.5rem 0;
    overflow-x: auto;
    white-space: pre;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.question-text code {
    display: inline;
    padding: 0.15rem 0.4rem;
    margin: 0;
    background: #f1f5f9;
    color: #e11d48;
    border-radius: 4px;
    font-size: 0.9em;
    user-select: none;
}

.question-text pre code {
    display: block;
    padding: 0;
    margin: 0;
    background: transparent;
    color: inherit;
    border-radius: 0;
    font-size: inherit;
}

/* Options - Matches Mock Test Styling */
.options-list {
    display: grid;
    gap: 0.5rem;
}

.option-item {
    background: #f8fafc;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.option-item:hover:not(.disabled) {
    border-color: #2563EB;
    background: rgba(37, 99, 235, 0.05);
    transform: translateX(3px);
}

/* Touch-friendly active state for mobile */
.option-item:active:not(.disabled) {
    border-color: #2563EB;
    background: rgba(37, 99, 235, 0.1);
    transform: scale(0.98);
}

.option-item.disabled {
    cursor: not-allowed;
}

.option-item.selected {
    background: #2563EB;
    color: white;
    border-color: #2563EB;
}

.option-item.correct {
    background: #D1FAE5;
    border-color: #10B981;
}

.option-item.incorrect {
    background: #FEE2E2;
    border-color: #EF4444;
}

.option-item.correct-answer {
    background: #D1FAE5;
    border-color: #10B981;
}

.option-label {
    width: 28px;
    height: 28px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.85rem;
    color: #2563EB;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.option-item.selected .option-label {
    background: white;
    color: #2563EB;
}

.option-item.correct .option-label {
    background: #10B981;
    color: white;
}

.option-item.incorrect .option-label {
    background: #EF4444;
    color: white;
}

.option-item.correct-answer .option-label {
    background: #10B981;
    color: white;
}

.option-text {
    flex: 1;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Option text inherits color from parent for selected state */
.option-item.selected .option-text {
    color: white;
}

.option-item:not(.selected) .option-text {
    color: #334155;
}

.option-icon {
    margin-left: auto;
    font-size: 1rem;
}

.option-item.correct .option-icon {
    color: #10B981;
}

.option-item.incorrect .option-icon {
    color: #EF4444;
}

/* Answer Explanation */
.answer-explanation {
    margin-top: 1rem;
    padding: 1rem;
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
    border-radius: 10px;
    border-left: 4px solid #10B981;
    display: none;
}

.answer-explanation.show {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.answer-explanation h4 {
    color: #059669;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.answer-explanation p {
    color: #334155;
    font-size: 0.9rem;
    line-height: 1.6;
    margin: 0;
}

.correct-answer-text {
    font-weight: 600;
    color: #059669;
    margin-bottom: 0.5rem;
}

/* Footer adjustment for practice page */
.practice-footer {
    margin-top: 0;
    position: relative;
    z-index: 10;
    width: 100%;
}

/* ===================================
   RESPONSIVE DESIGN - ENHANCED MOBILE
   =================================== */
@media (max-width: 1024px) {
    .practice-page .page-header .container {
        padding: 0 80px;
    }
    
    .practice-layout {
        gap: 1rem;
        padding: 1rem 0.75rem;
    }
    
    .practice-sidebar {
        width: 260px;
    }
}

@media (max-width: 768px) {
    .practice-page .page-header {
        padding: 15px 12px;
    }
    
    .practice-page .page-header .container {
        padding: 0;
        text-align: left;
        padding-left: 10px;
    }
    
    .practice-page .page-header .back-link {
        position: relative;
        left: 0;
        top: 0;
        transform: none;
        margin-bottom: 0.75rem;
        padding: 0.4rem 0.75rem;
        font-size: 0.85rem;
    }
    
    .practice-page .page-header h1 {
        font-size: 1.35rem;
        margin-bottom: 0.3rem;
    }
    
    .practice-page .page-header p {
        font-size: 0.85rem;
    }
    
    .practice-layout {
        flex-direction: column;
        padding: 0.5rem;
        gap: 0;
    }
    
    .practice-sidebar {
        transform: translateX(-100%);
        position: fixed;
        width: 85vw;
        max-width: 320px;
        top: 0;
        left: 0;
        height: 100vh;
        max-height: 100vh;
        z-index: 1001;
        padding-top: 0;
        border-radius: 0;
        animation: none;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .practice-sidebar .sidebar-header {
        border-radius: 0;
        position: sticky;
        top: 0;
        z-index: 10;
    }
    
    .practice-sidebar.active {
        transform: translateX(0);
    }
    
    .mobile-sidebar-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        position: fixed;
        bottom: 20px;
        left: 15px;
        top: auto;
        width: 50px;
        height: 50px;
        border-radius: 50%;
        background: linear-gradient(135deg, #2563EB 0%, #1D4ED8 100%);
        color: white;
        border: none;
        box-shadow: 0 4px 15px rgba(37, 99, 235, 0.4);
        font-size: 1.2rem;
        z-index: 99;
    }
    
    .mobile-sidebar-toggle:active {
        transform: scale(0.95);
    }
    
    .sidebar-overlay.active {
        display: block;
    }
    
    .practice-main {
        border-radius: 10px;
        height: auto;
        min-height: calc(100vh - 180px);
    }
    
    .questions-list {
        padding: 0.75rem;
        gap: 1rem;
    }
    
    .welcome-icon {
        width: 70px;
        height: 70px;
        font-size: 1.75rem;
    }
    
    .welcome-state {
        min-height: 50vh;
        padding: 1.5rem 1rem;
    }
    
    .welcome-state h2 {
        font-size: 1.15rem;
    }
    
    .welcome-state p {
        font-size: 0.9rem;
    }
    
    .welcome-stats {
        gap: 0.75rem;
        flex-wrap: wrap;
    }
    
    .stat-item {
        font-size: 0.85rem;
        background: #f8fafc;
        padding: 0.5rem 0.75rem;
        border-radius: 8px;
    }
    
    .questions-header {
        flex-direction: column;
        align-items: flex-start;
        padding: 0.75rem 1rem;
        gap: 0.5rem;
    }
    
    .question-card {
        border-radius: 10px;
    }
    
    .question-header {
        padding: 0.75rem 1rem;
    }
    
    .question-body {
        padding: 1rem;
    }
    
    .question-text {
        font-size: 0.92rem;
        line-height: 1.6;
        margin-bottom: 1rem;
    }
    
    .question-text pre,
    .question-text code,
    .question-text .code-block {
        font-size: 0.8rem;
        padding: 0.6rem 0.8rem;
    }
    
    .options-list {
        gap: 0.6rem;
    }
    
    .option-item {
        padding: 0.85rem 0.9rem;
        border-radius: 10px;
        min-height: 48px;
        -webkit-tap-highlight-color: transparent;
    }
    
    .option-label {
        width: 26px;
        height: 26px;
        font-size: 0.8rem;
    }
    
    .option-text {
        font-size: 0.88rem;
        line-height: 1.45;
    }
    
    .answer-explanation {
        padding: 0.85rem;
        margin-top: 0.75rem;
    }
    
    .answer-explanation h4 {
        font-size: 0.85rem;
    }
    
    .answer-explanation p {
        font-size: 0.85rem;
        line-height: 1.5;
    }
    
    /* Topic links touch-friendly */
    .topic-link {
        padding: 0.75rem 1.25rem 0.75rem 3rem;
        font-size: 0.88rem;
        min-height: 44px;
        display: flex;
        align-items: center;
    }
    
    .subject-toggle {
        min-height: 48px;
        padding: 0.85rem 1.25rem 0.85rem 1.75rem;
    }
    
    .section-toggle {
        min-height: 52px;
    }
}

@media (max-width: 480px) {
    .practice-page .page-header {
        padding: 12px 10px;
    }
    
    .practice-page .page-header h1 {
        font-size: 1.2rem;
    }
    
    .practice-page .page-header h1 i {
        display: none;
    }
    
    .topic-breadcrumb {
        font-size: 0.75rem;
        flex-wrap: wrap;
    }
    
    .breadcrumb-home,
    .breadcrumb-section,
    .breadcrumb-subject,
    .breadcrumb-topic {
        padding: 0.2rem 0.3rem;
    }
    
    .questions-count {
        padding: 0.4rem 0.75rem;
        font-size: 0.8rem;
    }
    
    .option-item {
        padding: 0.75rem 0.8rem;
    }
    
    .option-label {
        width: 24px;
        height: 24px;
        font-size: 0.75rem;
    }
    
    .option-text {
        font-size: 0.85rem;
    }
    
    .question-number {
        font-size: 0.8rem;
    }
    
    .question-status {
        font-size: 0.7rem;
        padding: 0.2rem 0.5rem;
    }
    
    .mobile-sidebar-toggle {
        width: 48px;
        height: 48px;
        bottom: 15px;
        left: 12px;
    }
    
    .practice-sidebar {
        width: 90vw;
    }
}

/* Touch-friendly hover states */
@media (hover: none) and (pointer: coarse) {
    .option-item:hover:not(.disabled) {
        transform: none;
        border-color: transparent;
        background: #f8fafc;
    }
    
    .option-item:active:not(.disabled) {
        border-color: #2563EB;
        background: rgba(37, 99, 235, 0.1);
        transform: scale(0.98);
    }
    
    .topic-link:hover {
        background: transparent;
        border-left-color: transparent;
    }
    
    .topic-link:active {
        background: #e2e8f0;
        border-left-color: #2563EB;
    }
}

/* Safe area for notched phones */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .mobile-sidebar-toggle {
        bottom: calc(15px + env(safe-area-inset-bottom));
    }
    
    .practice-sidebar {
        padding-bottom: env(safe-area-inset-bottom);
    }
}

/* Landscape mobile optimization */
@media (max-height: 500px) and (orientation: landscape) {
    .practice-main {
        height: auto;
        min-height: auto;
    }
    
    .welcome-state {
        min-height: 40vh;
        padding: 1rem;
    }
    
    .welcome-icon {
        width: 50px;
        height: 50px;
        font-size: 1.25rem;
        margin-bottom: 0.75rem;
    }
    
    .mobile-sidebar-toggle {
        bottom: 10px;
        width: 44px;
        height: 44px;
    }
}

/* Scrollbar Styling */
.practice-sidebar::-webkit-scrollbar {
    width: 6px;
}

.practice-sidebar::-webkit-scrollbar-track {
    background: #f1f5f9;
}

.practice-sidebar::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.practice-sidebar::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Questions container scrollbar */
.questions-container::-webkit-scrollbar {
    width: 8px;
}

.questions-container::-webkit-scrollbar-track {
    background: #f8fafc;
}

.questions-container::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.questions-container::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Print styles */
@media print {
    .practice-sidebar,
    .mobile-sidebar-toggle,
    .sidebar-overlay,
    .page-header .back-link {
        display: none !important;
    }
    
    .practice-main {
        height: auto;
        box-shadow: none;
    }
    
    .question-card {
        break-inside: avoid;
        page-break-inside: avoid;
    }
}
