/* --- MOBILE RESPONSIVE STYLES --- */
@media (max-width: 768px) {
    /* Header fixes */
    .nav-container {
        flex-direction: column;
        gap: 1rem;
        padding: 0 1rem;
    }

    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.8rem;
    }

    .nav-links a {
        padding: 0.4rem 0.8rem;
        font-size: 0.9rem;
    }

    .logo-image {
        height: 60px;
    }

    /* Login page mobile */
    .login-main {
        padding: 1rem;
        align-items: flex-start;
        padding-top: 2rem;
    }

    .login-container {
        padding: 2rem 1.5rem;
        margin: 0;
        border-radius: 15px;
        max-width: none;
        width: 100%;
    }

    .login-header h1 {
        font-size: 1.5rem;
    }

    .form-group input {
        padding: 0.8rem;
        border-radius: 8px;
    }

    .btn-primary {
        width: 100%;
        padding: 1rem;
        font-size: 1rem;
        border-radius: 8px;
    }

    .switch-link {
        gap: 1rem;
    }

    /* Homepage mobile */
    .hero {
        padding: 2rem 1rem;
    }

    .hero h1 {
        font-size: 2.5rem;
    }

    .hero-buttons {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }

    .user-welcome {
        padding: 1.5rem;
    }

    .user-welcome h2 {
        font-size: 1.5rem;
    }

    /* Features section mobile */
    .features {
        padding: 3rem 1rem !important;
    }

    .features h2 {
        font-size: 2rem;
    }

    .features-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .feature-card {
        padding: 1.5rem;
    }

    /* Proefexamen section mobile */
    .proefexamen-section {
        padding: 3rem 1rem !important;
    }

    .proefexamen-content {
        padding: 2rem 1.5rem;
        border-radius: 20px;
    }

    .proefexamen-header h2 {
        font-size: 2.2rem !important;
    }

    .hero-emoji {
        font-size: 4rem;
    }

    .proefexamen-badge {
        padding: 0.8rem 2rem;
        font-size: 1rem;
    }

    .proefexamen-benefits {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        margin: 2rem 0;
    }

    .benefit-card {
        padding: 1.5rem;
    }

    .benefit-emoji {
        font-size: 3rem;
    }

    .urgency-box {
        padding: 2rem 1.5rem;
        margin: 2rem 0;
    }

    .urgency-box h3 {
        font-size: 1.6rem !important;
    }

    .urgency-emoji {
        font-size: 3rem;
    }

    .main-cta-btn {
        font-size: 1rem;
        padding: 1rem 2rem;
        width: 100%;
        box-sizing: border-box;
    }

    .benefits-list {
        flex-direction: column;
        gap: 1rem;
        align-items: center;
    }

    .benefit-item {
        padding: 0.6rem 1.2rem;
        font-size: 0.95rem;
    }

    .pro-tip {
        padding: 1.5rem;
        margin-top: 2rem;
    }

    .login-link {
        font-size: 1rem;
    }

    /* About section mobile */
    .about {
        padding: 3rem 1rem !important;
    }

    .about-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .about-text h2 {
        font-size: 2rem !important;
    }

    .about-intro {
        font-size: 1.1rem !important;
    }

    .mission-vision {
        grid-template-columns: 1fr;
        gap: 2rem;
        margin-top: 3rem;
    }

    .mission, .vision {
        padding: 2rem;
    }

    .image-placeholder {
        width: 280px;
        height: 200px;
    }

    /* Packages section mobile */
    .packages {
        padding: 3rem 1rem !important;
    }

    .packages h2 {
        font-size: 2rem;
    }

    .packages-intro {
        font-size: 1.1rem;
    }

    .packages-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .package-card {
        padding: 2rem 1.5rem;
    }

    .package-card.popular {
        transform: none;
    }

    .package-card.popular:hover {
        transform: translateY(-10px);
    }

    .price {
        font-size: 2.5rem;
    }

    .package-features ul {
        text-align: left;
    }

    .package-features li {
        padding: 0.8rem 0;
        font-size: 0.95rem;
    }

    /* FAQ section mobile */
    .faq-section {
        padding: 3rem 1rem !important;
    }

    .faq-header h1,
    .faq-header h2 {
        font-size: 2rem !important;
    }

    .faq-header p {
        font-size: 1.1rem !important;
        padding: 0 1rem;
    }

    .faq-question {
        padding: 1rem 1.5rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .faq-question h3 {
        font-size: 1rem !important;
        line-height: 1.3;
        padding-right: 0;
    }

    .faq-toggle {
        align-self: flex-end;
        margin-top: -2rem;
    }

    .faq-answer.active {
        padding: 1rem 1.5rem;
    }

    .faq-contact {
        padding: 2rem 1.5rem;
        margin: 0 1rem;
    }

    .faq-contact h3 {
        font-size: 1.3rem !important;
    }

    .faq-contact p {
        font-size: 1rem !important;
    }

    /* Stats section mobile */
    .stats {
        padding: 3rem 1rem !important;
    }

    .stats .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }

    .stats .stat-item h3 {
        font-size: 2rem !important;
    }

    .stats .stat-item p {
        font-size: 1rem !important;
    }

    /* CTA section mobile */
    .cta {
        padding: 3rem 1rem !important;
    }

    .cta h2 {
        font-size: 2rem !important;
    }

    .cta p {
        font-size: 1.1rem !important;
    }

    /* Button fixes for mobile */
    .btn {
        padding: 0.8rem 1.5rem;
        font-size: 1rem;
        border-radius: 25px;
    }

    .hero-buttons .btn {
        width: auto;
        min-width: 200px;
    }

    /* Container fixes */
    .container {
        margin: 1rem;
        padding: 2rem 1.5rem;
        border-radius: 15px;
    }

    .hero-container {
        padding: 0 1rem;
    }

    .features-container,
    .packages-container,
    .stats-container,
    .cta-container {
        padding: 0 1rem;
    }

    /* Contact info mobile */
    .contact-info {
        margin: 1.5rem 1rem;
        padding: 1.5rem;
    }

    .description {
        margin: 1.5rem 1rem;
        padding: 1.5rem;
    }

    .login-container button[type="submit"],
    .login-container .btn-primary,
    .login-container .btn-secondary {
        width: 100% !important;
        padding: 1rem !important;
        font-size: 1rem !important;
        border-radius: 8px !important;
        margin: 0.5rem 0;
    }

    .login-container button[type="submit"]:hover,
    .login-container .btn-primary:hover,
    .login-container .btn-secondary:hover {
        transform: none !important;
    }
}

/* --- ULTRA MOBILE (Small phones under 480px) --- */
@media (max-width: 480px) {
    .hero {
        padding: 1.5rem 0.5rem;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .features, .packages, .stats, .cta, .faq-section, .about {
        padding: 2rem 0.5rem !important;
    }

    .login-container {
        padding: 1.5rem 1rem;
    }

    .login-header h1 {
        font-size: 1.3rem;
    }

    .price {
        font-size: 2rem;
    }

    .stats .stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .image-placeholder {
        width: 250px;
        height: 180px;
    }

    .contact-info {
        margin: 1rem 0.5rem;
        padding: 1rem;
    }

    .faq-contact {
        padding: 1.5rem 1rem;
        margin: 0 0.5rem;
    }

    .container {
        margin: 0.5rem;
        padding: 1.5rem 1rem;
    }
}

/* --- ENHANCED DASHBOARD MOBILE STYLES --- */
@media (max-width: 768px) {
    /* Dashboard specific mobile improvements */
    .dashboard-header {
        padding: 1.5rem 1rem;
        margin: 1rem;
        margin-bottom: 1.5rem;
    }

    .dashboard-header h1 {
        font-size: 1.8rem;
        line-height: 1.2;
        margin-bottom: 0.5rem;
    }

    .dashboard-header p {
        font-size: 0.95rem;
        margin-top: 0.3rem;
    }

    /* Horizontal tab navigation - more compact */
    .tab-nav {
        display: flex;
        flex-direction: row;
        gap: 0.5rem;
        margin: 0 1rem 1.5rem;
        padding: 0;
        overflow-x: auto;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .tab-nav::-webkit-scrollbar {
        display: none;
    }

    .tab-btn {
        padding: 0.8rem 1.2rem;
        font-size: 0.85rem;
        text-align: center;
        justify-content: center;
        border-radius: 20px;
        margin: 0;
        min-height: 45px;
        min-width: 100px;
        flex-shrink: 0;
        white-space: nowrap;
        display: flex;
        align-items: center;
        gap: 0.3rem;
    }

    .tab-btn:hover {
        transform: none;
        box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    }

    .tab-btn.active {
        transform: none;
        box-shadow: 0 6px 20px rgba(102, 126, 234, 0.3);
    }

    /* Main content container */
    .tab-content {
        padding: 1.5rem 1rem;
        margin: 0 1rem;
        border-radius: 15px;
        min-height: auto;
    }

    /* COMPACT exam statistics section */
    .exam-stats-section {
        margin: 1rem 0;
        padding: 1rem;
        border-radius: 12px;
        background: linear-gradient(135deg, #e8f0fe, #f3e5f5);
    }

    .exam-stats-section h3 {
        font-size: 1.1rem;
        margin-bottom: 1rem;
        text-align: center;
        color: #333;
    }

    .exam-stats-section p {
        font-size: 0.8rem;
        line-height: 1.4;
        padding: 0 0.5rem;
        margin-top: 0.8rem;
        text-align: center;
    }

    /* VERY compact stats grid */
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 0.5rem;
    }

    .stat-item {
        padding: 0.8rem 0.3rem;
        border-radius: 8px;
        background: rgba(255, 255, 255, 0.8);
        text-align: center;
    }

    .stat-number {
        font-size: 1.3rem;
        margin-bottom: 0.2rem;
        font-weight: 700;
        color: #667eea;
    }

    .stat-label {
        font-size: 0.65rem;
        line-height: 1.2;
        color: #666;
        font-weight: 500;
    }

    /* Overview mobile layout */
    .overview-grid {
        display: block;
        gap: 0;
    }

    .overview-card {
        margin-bottom: 1rem;
        padding: 1.2rem;
    }

    /* User info card - more compact */
    .user-info-card {
        grid-column: span 1;
        margin: 0 0 1.5rem 0;
        padding: 1.2rem;
    }

    .user-info-card h3 {
        font-size: 1.2rem;
        text-align: center;
        margin-bottom: 1rem;
    }

    .info-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.8rem;
    }

    .info-item {
        padding: 0.8rem;
        border-radius: 10px;
        text-align: center;
    }

    .info-item strong {
        font-size: 0.75rem;
        margin-bottom: 0.5rem;
        display: block;
    }

    .info-item p {
        font-size: 0.9rem;
        font-weight: 600;
        margin: 0;
    }

    /* Exam center - single column */
    .exam-center-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        margin: 1.5rem 0;
    }

    .exam-card {
        padding: 1.2rem;
        border-radius: 12px;
        margin-bottom: 0.8rem;
    }

    .exam-card.featured::before {
        font-size: 0.6rem;
        padding: 0.15rem 1.2rem;
        top: 8px;
        right: -20px;
    }

    .exam-icon {
        font-size: 2rem;
        margin-bottom: 0.8rem;
    }

    .exam-card h3 {
        font-size: 1rem;
        margin-bottom: 0.8rem;
        line-height: 1.3;
    }

    .exam-card p {
        font-size: 0.85rem;
        line-height: 1.4;
        margin-bottom: 1rem;
    }

    .exam-features {
        text-align: center;
        gap: 0.5rem;
        margin-bottom: 1.2rem;
    }

    .feature {
        display: inline-block;
        margin: 0.1rem;
        padding: 0.3rem 0.6rem;
        font-size: 0.7rem;
        border-radius: 15px;
    }

    .exam-btn {
        padding: 0.9rem 1.2rem;
        font-size: 0.85rem;
        border-radius: 10px;
        font-weight: 700;
    }

    /* Settings mobile layout - more compact */
    .settings-grid {
        display: block;
        gap: 0;
    }

    .form-container {
        padding: 1.2rem;
        margin: 0 0 1.5rem 0;
        border-radius: 12px;
    }

    .form-container h3 {
        font-size: 1.1rem;
        margin-bottom: 1rem;
        text-align: center;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 0.8rem;
    }

    .form-group {
        margin-bottom: 1rem;
    }

    .form-group.half-width {
        margin-bottom: 1rem;
    }

    .form-group label {
        font-size: 0.9rem;
        margin-bottom: 0.5rem;
        display: block;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 0.8rem;
        font-size: 0.9rem;
        border-radius: 10px;
        border: 2px solid #e9ecef;
        width: 100%;
        box-sizing: border-box;
    }

    /* Danger zone improvements */
    .danger-zone {
        padding: 1.2rem;
        margin: 1.5rem 0 1rem;
        border-radius: 12px;
    }

    .danger-zone h4 {
        font-size: 1.1rem;
        margin-bottom: 0.8rem;
        text-align: center;
    }

    .danger-zone p {
        text-align: center;
        margin-bottom: 1rem;
        line-height: 1.4;
        font-size: 0.85rem;
    }

    .logout-section {
        flex-direction: column;
        gap: 0.8rem;
    }

    .logout-section .btn {
        width: 100%;
        text-align: center;
        padding: 1rem;
        font-size: 0.9rem;
        border-radius: 10px;
    }

    /* Alert improvements */
    .alert {
        margin: 0 1rem 1rem;
        padding: 1rem;
        border-radius: 10px;
        text-align: center;
        font-size: 0.85rem;
        line-height: 1.4;
    }

    /* Main container spacing */
    .main-container {
        padding: 0;
        margin: 0.5rem 0;
    }
}

/* --- ULTRA MOBILE DASHBOARD (Under 480px) --- */
@media (max-width: 480px) {
    .dashboard-header {
        padding: 1rem 0.5rem;
        margin: 0.5rem;
    }

    .dashboard-header h1 {
        font-size: 1.6rem;
    }

    .dashboard-header p {
        font-size: 0.85rem;
    }

    .tab-nav {
        margin: 0 0.5rem 1rem;
        gap: 0.3rem;
    }

    .tab-btn {
        padding: 0.7rem 0.8rem;
        font-size: 0.75rem;
        min-height: 40px;
        min-width: 85px;
        gap: 0.2rem;
    }

    .tab-content {
        padding: 1rem 0.5rem;
        margin: 0 0.5rem;
    }

    /* ULTRA compact stats for small phones */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.4rem;
    }

    .stat-item {
        padding: 0.6rem 0.2rem;
    }

    .stat-number {
        font-size: 1.1rem;
    }

    .stat-label {
        font-size: 0.6rem;
    }

    .exam-stats-section {
        margin: 0.8rem 0;
        padding: 0.8rem;
    }

    .exam-stats-section h3 {
        font-size: 1rem;
        margin-bottom: 0.8rem;
    }

    .exam-stats-section p {
        font-size: 0.75rem;
        margin-top: 0.6rem;
    }

    .exam-card {
        padding: 1rem;
    }

    .form-container {
        padding: 1rem;
        margin: 0 0.5rem 1rem;
    }

    .danger-zone {
        margin: 1rem 0.5rem 0.5rem;
        padding: 1rem;
    }

    .alert {
        margin: 0 0.5rem 0.8rem;
        padding: 0.8rem;
        font-size: 0.8rem;
    }

    .user-info-card {
        margin: 0 0 1rem 0;
        padding: 1rem;
    }

    .info-grid {
        gap: 0.6rem;
    }

    .info-item {
        padding: 0.6rem;
    }

    .info-item strong {
        font-size: 0.7rem;
    }

    .info-item p {
        font-size: 0.8rem;
    }
}

/* --- LANDSCAPE MOBILE ADJUSTMENTS --- */
@media (max-width: 768px) and (orientation: landscape) {
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 0.5rem;
    }
    
    .exam-center-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .tab-nav {
        justify-content: center;
    }
    
    .tab-btn {
        flex: 1;
        max-width: 150px;
    }
}
/* --- DASHBOARD MOBILE STYLES --- */
@media (max-width: 768px) {
    .dashboard-header {
        padding: 1.5rem;
        margin-bottom: 2rem;
    }

    .dashboard-header h1 {
        font-size: 2rem;
    }

    .dashboard-header p {
        font-size: 1.1rem;
    }

    .tab-nav {
        flex-direction: column;
        gap: 0.8rem;
        margin-bottom: 2rem;
    }

    .tab-btn {
        padding: 0.8rem 1.5rem;
        font-size: 0.95rem;
        text-align: center;
        justify-content: center;
    }

    .tab-content {
        padding: 2rem 1.5rem;
    }

    .info-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .stat-number {
        font-size: 2rem;
    }

    .stat-label {
        font-size: 0.8rem;
    }

    .exam-center-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .exam-card {
        padding: 1.5rem;
    }

    .exam-card.featured::before {
        font-size: 0.7rem;
        padding: 0.2rem 1.5rem;
    }

    .exam-features {
        text-align: left;
    }

    .feature {
        display: block;
        margin-bottom: 0.3rem;
        text-align: center;
    }

    .form-container {
        padding: 1.5rem;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .form-group.half-width {
        margin-bottom: 1.5rem;
    }

    .danger-zone {
        padding: 1.5rem;
    }

    .logout-section {
        flex-direction: column;
    }

    .logout-section .btn {
        width: 100%;
        text-align: center;
    }
}

/* --- ULTRA MOBILE DASHBOARD --- */
@media (max-width: 480px) {
    .dashboard-header {
        padding: 1rem;
    }

    .dashboard-header h1 {
        font-size: 1.8rem;
    }

    .tab-content {
        padding: 1.5rem 1rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .exam-card {
        padding: 1rem;
    }

    .form-container {
        padding: 1rem;
    }
}

/* --- CBR-STYLE SAMPLE EXAM MOBILE (FULL SCREEN OPTIMIZED) --- */
@media (max-width: 768px) {
    .sample-exam-page {
        height: 100vh;
        overflow: hidden;
        background: #f8f9fa;
    }

    .sample-exam-page .header {
        display: none !important;
    }

    .sample-exam-container {
        margin: 0;
        padding: 0;
        height: 100vh;
        display: flex;
        flex-direction: column;
        background: #f8f9fa;
    }

    /* Exam introduction - scrollable */
    .exam-intro {
        padding: 1.5rem;
        border-radius: 0;
        margin: 0;
        height: 100vh;
        overflow-y: auto;
        display: flex;
        flex-direction: column;
        background: white;
    }

    .exam-intro h2 {
        font-size: 1.6rem;
        margin-bottom: 1rem;
        text-align: center;
        color: #2c3e50;
    }

    .intro-list h3 {
        font-size: 1.2rem;
        margin-bottom: 0.8rem;
        text-align: center;
        color: #667eea;
    }

    .intro-list li {
        flex-direction: row;
        text-align: left;
        gap: 0.8rem;
        padding: 0.8rem;
        margin-bottom: 0.6rem;
        border-radius: 8px;
        background: rgba(102, 126, 234, 0.05);
        border-left: 3px solid #667eea;
    }

    .intro-list li i {
        font-size: 1.3rem;
        margin-top: 0;
        flex-shrink: 0;
        color: #667eea;
    }

    .intro-list li span {
        font-size: 0.85rem;
        line-height: 1.4;
        color: #333;
    }

    .timer-info {
        padding: 1rem;
        margin: 1rem 0;
        border-radius: 10px;
        background: linear-gradient(135deg, #ff6b6b, #ee5a52);
        color: white;
    }

    .timer-info h4 {
        font-size: 1.1rem;
        margin-bottom: 0.6rem;
    }

    .timer-info p {
        font-size: 0.9rem;
        line-height: 1.4;
        margin: 0;
    }

    .start-exam-section {
        margin-top: 1.5rem;
        text-align: center;
    }

    .exam-header {
        padding: 1.5rem;
        margin: 0.5rem;
        border-radius: 12px;
        background: rgba(255, 255, 255, 0.95);
    }

    .exam-header h1 {
        font-size: 1.8rem;
        line-height: 1.2;
        margin-bottom: 0.5rem;
        color: #2c3e50;
    }

    .exam-header p {
        font-size: 1rem;
        margin-bottom: 0;
        color: #666;
    }

    .welcome-message {
        padding: 1rem;
        margin: 1rem 0;
        font-size: 0.9rem;
        border-radius: 10px;
        background: linear-gradient(135deg, #28a745, #20c997);
        color: white;
    }

    /* CBR-STYLE timer bar */
    .exam-timer {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        width: 100%;
        text-align: center;
        padding: 6px 8px;
        font-size: 0.85rem;
        font-weight: 700;
        border-radius: 0;
        z-index: 1001;
        background: #28a745;
        color: white;
        border: none;
        height: 32px;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    }

    .exam-timer.warning {
        background: #ffc107;
        color: #856404;
    }

    .exam-timer.danger {
        background: #dc3545;
        color: white;
        animation: pulse 0.8s infinite;
    }

    /* CBR-style back button */
    .back-to-dashboard {
        position: fixed;
        top: 2px;
        left: 4px;
        background: rgba(73, 80, 87, 0.9);
        color: white;
        border: none;
        border-radius: 4px;
        width: 28px;
        height: 28px;
        font-size: 0.7rem;
        cursor: pointer;
        transition: all 0.2s ease;
        z-index: 1002;
        display: flex;
        align-items: center;
        justify-content: center;
        text-decoration: none;
    }

    .back-to-dashboard:hover {
        background: rgba(52, 58, 64, 0.9);
        color: white;
        text-decoration: none;
    }

    /* CBR-STYLE main exam layout */
    .sample-exam-page .exam-content {
        flex: 1;
        display: flex;
        flex-direction: column;
        margin: 0;
        padding: 0;
        border-radius: 0;
        background: #f8f9fa;
        height: calc(100vh - 32px);
        margin-top: 32px;
        overflow: hidden;
    }

    /* CBR-style question progress bar at top */
    .question-overview {
        padding: 0.4rem 0.8rem;
        margin: 0;
        border-radius: 0;
        background: white;
        border-bottom: 2px solid #e9ecef;
        flex-shrink: 0;
        box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    }

    .question-overview h4 {
        font-size: 0.7rem;
        margin-bottom: 0.3rem;
        text-align: center;
        color: #667eea;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    .question-grid {
        grid-template-columns: repeat(auto-fill, minmax(20px, 1fr));
        gap: 0.15rem;
        max-height: 40px;
        overflow: visible;
    }

    .question-dot {
        width: 20px;
        height: 20px;
        font-size: 0.6rem;
        border: 1px solid #dee2e6;
        border-radius: 2px;
        background: white;
        color: #666;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.2s ease;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .question-dot:hover {
        border-color: #667eea;
        background: rgba(102, 126, 234, 0.1);
        color: #667eea;
    }

    .question-dot.answered {
        background: #28a745;
        border-color: #28a745;
        color: white;
    }

    .question-dot.current {
        background: #667eea;
        border-color: #667eea;
        color: white;
        transform: scale(1.2);
        box-shadow: 0 1px 3px rgba(102, 126, 234, 0.4);
    }

    /* CBR-style question display area */
    .question-container {
        flex: 1;
        overflow-y: auto;
        padding: 0;
        margin: 0;
        background: white;
        display: flex;
        flex-direction: column;
    }

    .question {
        padding: 1rem 0.8rem;
        border-radius: 0;
        border: none;
        flex: 1;
        display: flex;
        flex-direction: column;
        overflow-y: auto;
        background: white;
    }

    .question-number {
        padding: 0.2rem 0.6rem;
        font-size: 0.7rem;
        margin-bottom: 0.6rem;
        border-radius: 12px;
        align-self: flex-start;
        background: #667eea;
        color: white;
        font-weight: 600;
    }

    .question-text {
        font-size: 0.9rem;
        margin-bottom: 0.8rem;
        line-height: 1.4;
        font-weight: 600;
        color: #2c3e50;
        padding: 0 0.2rem;
    }

    .question-image {
        margin: 0.6rem 0;
        text-align: center;
    }

    .question-image img {
        max-width: 140px;
        max-height: 100px;
        border-radius: 4px;
        border: 2px solid #e9ecef;
        box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    }

    .placeholder {
        padding: 0.8rem;
        border-radius: 4px;
        font-size: 0.75rem;
        max-width: 140px;
        margin: 0 auto;
        max-height: 80px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        background: #f8f9fa;
        border: 2px dashed #dee2e6;
        color: #6c757d;
    }

    .placeholder small {
        font-size: 0.65rem;
        margin-top: 0.2rem;
        color: #999;
    }

    /* CBR-style answer options */
    .options {
        gap: 0.3rem;
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: center;
        padding: 0 0.2rem;
    }

    .option {
        padding: 0.6rem 0.8rem;
        border-radius: 4px;
        flex-direction: row;
        align-items: center;
        gap: 0.6rem;
        border: 2px solid #e9ecef;
        background: white;
        transition: all 0.2s ease;
        min-height: 40px;
        box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    }

    .option:hover,
    .option.selected {
        border-color: #667eea;
        background: rgba(102, 126, 234, 0.05);
        transform: none;
        box-shadow: 0 2px 4px rgba(102, 126, 234, 0.1);
    }

    .option input[type="radio"] {
        transform: scale(0.9);
        flex-shrink: 0;
        margin: 0;
        accent-color: #667eea;
    }

    .option label {
        font-size: 0.8rem;
        gap: 0.5rem;
        cursor: pointer;
        flex: 1;
        margin: 0;
        display: flex;
        align-items: center;
        line-height: 1.3;
        color: #2c3e50;
        font-weight: 500;
    }

    .option-letter {
        padding: 0.15rem 0.4rem;
        font-size: 0.65rem;
        min-width: 1.2rem;
        height: 1.2rem;
        display: flex;
        align-items: center;
        justify-content: center;
        background: #667eea;
        color: white;
        border-radius: 2px;
        font-weight: 700;
        flex-shrink: 0;
    }

    /* CBR-style fixed navigation bar */
    .question-navigation {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: white;
        padding: 0.4rem 0.6rem;
        border-top: 2px solid #667eea;
        box-shadow: 0 -2px 4px rgba(0,0,0,0.1);
        display: grid;
        grid-template-columns: 1fr auto 1fr;
        gap: 0.4rem;
        align-items: center;
        z-index: 1000;
        height: 48px;
        box-sizing: border-box;
    }

    .question-navigation #prevBtn,
    .question-navigation #nextBtn {
        background: #6c757d;
        color: white;
        border: none;
        padding: 0.5rem 0.8rem;
        border-radius: 4px;
        font-size: 0.75rem;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.2s ease;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.3rem;
        min-height: 32px;
        text-decoration: none;
    }

    .question-navigation #nextBtn {
        background: #28a745;
    }

    .question-navigation #prevBtn:disabled {
        background: #e9ecef;
        color: #6c757d;
        cursor: not-allowed;
    }

    .question-navigation #prevBtn:not(:disabled):hover {
        background: #5a6268;
    }

    .question-navigation #nextBtn:hover {
        background: #218838;
    }

    .question-indicator {
        font-size: 0.7rem;
        font-weight: 600;
        color: #667eea;
        background: rgba(102, 126, 234, 0.1);
        padding: 0.3rem 0.6rem;
        border-radius: 10px;
        text-align: center;
        white-space: nowrap;
        border: 1px solid #667eea;
        min-width: 60px;
    }

    /* Hide progress counter - space saving */
    .question-counter {
        display: none;
    }

    /* CBR-style submit overlay */
    .submit-section {
        position: fixed;
        top: 32px;
        left: 0;
        right: 0;
        bottom: 0;
        background: white;
        padding: 1rem 0.8rem;
        border-radius: 0;
        z-index: 999;
        overflow-y: auto;
        margin: 0;
    }

    .final-check h3 {
        font-size: 1.2rem;
        margin-bottom: 0.6rem;
        text-align: center;
        color: #2c3e50;
    }

    .final-check p {
        font-size: 0.85rem;
        margin-bottom: 0.8rem;
        text-align: center;
        line-height: 1.3;
        color: #666;
    }

    .summary-stats {
        display: flex;
        justify-content: center;
        gap: 0.6rem;
        margin: 0.8rem 0;
        flex-wrap: wrap;
    }

    .stat {
        padding: 0.4rem 0.8rem;
        font-size: 0.75rem;
        text-align: center;
        background: #f8f9fa;
        border-radius: 4px;
        border: 1px solid #e9ecef;
        flex: 1;
        min-width: 70px;
        color: #2c3e50;
        font-weight: 600;
    }

    .warning {
        padding: 0.6rem;
        font-size: 0.8rem;
        text-align: center;
        margin: 0.6rem 0;
        border-radius: 4px;
        background: rgba(255, 193, 7, 0.1);
        border: 1px solid #ffc107;
        color: #856404;
    }

    /* CBR-style buttons */
    .exam-btn {
        padding: 0.6rem 1rem;
        font-size: 0.8rem;
        border-radius: 4px;
        margin: 0.2rem;
        width: auto;
        min-width: 100px;
        display: inline-block;
        text-align: center;
        border: none;
        cursor: pointer;
        font-weight: 600;
        transition: all 0.2s ease;
    }

    .exam-btn:not(.secondary) {
        background: #28a745;
        color: white;
    }

    .exam-btn:not(.secondary):hover {
        background: #218838;
        color: white;
    }

    .exam-btn.secondary {
        background: #6c757d;
        color: white;
    }

    .exam-btn.secondary:hover {
        background: #5a6268;
        color: white;
    }

    .exam-btn:hover {
        transform: none;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }

    /* Results - restore normal behavior */
    .sample-exam-page.results-view {
        height: auto;
        overflow: auto;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    }

    .sample-exam-page.results-view .header {
        display: block !important;
    }

    .sample-exam-page.results-view .exam-content {
        margin-top: 0;
        height: auto;
        overflow: visible;
        background: rgba(255, 255, 255, 0.95);
        border-radius: 15px;
        margin: 1rem;
    }

    .sample-exam-page.results-view .back-to-dashboard {
        display: none;
    }

    .sample-exam-page.results-view .sample-exam-container {
        height: auto;
        background: transparent;
    }

    .results {
        padding: 1.5rem;
        border-radius: 12px;
        margin: 0;
        background: rgba(255, 255, 255, 0.95);
        text-align: center;
    }

    .score {
        font-size: 2.5rem;
        padding: 1.2rem;
        border-radius: 12px;
        margin-bottom: 1rem;
        font-weight: 700;
    }

    .score.passed {
        background: linear-gradient(135deg, #28a745, #20c997);
        color: white;
    }

    .score.failed {
        background: linear-gradient(135deg, #dc3545, #c82333);
        color: white;
    }

    .score-text {
        font-size: 1.1rem;
        margin-bottom: 1.5rem;
        line-height: 1.3;
        color: #2c3e50;
        font-weight: 600;
    }

    .results-container {
        margin: 1.5rem 0;
        text-align: left;
    }

    .question-result {
        padding: 1.2rem;
        margin-bottom: 1rem;
        border-radius: 8px;
        border-left-width: 4px;
        border-left-style: solid;
        background: white;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }

    .question-result.correct {
        border-left-color: #28a745;
        background: rgba(40, 167, 69, 0.02);
    }

    .question-result.incorrect {
        border-left-color: #dc3545;
        background: rgba(220, 53, 69, 0.02);
    }

    .question-result strong {
        font-size: 0.9rem;
        display: block;
        margin-bottom: 0.6rem;
        color: #2c3e50;
    }

    .question-result p {
        font-size: 0.85rem;
        margin: 0.6rem 0;
        line-height: 1.4;
        color: #555;
    }

    .explanation {
        padding: 0.8rem;
        margin-top: 0.6rem;
        border-radius: 6px;
        border-left-width: 3px;
        border-left-style: solid;
        border-left-color: #667eea;
        background: rgba(102, 126, 234, 0.05);
    }

    .explanation strong {
        font-size: 0.8rem;
        color: #667eea;
    }

    .cta-box {
        margin: 1rem 0;
        padding: 1.2rem;
        font-size: 0.9rem;
        border-radius: 8px;
        text-align: center;
        line-height: 1.4;
    }

    .cta-box.success {
        background: rgba(40, 167, 69, 0.1);
        border: 2px solid #28a745;
        color: #155724;
    }

    .cta-box.warning {
        background: rgba(255, 193, 7, 0.1);
        border: 2px solid #ffc107;
        color: #856404;
    }

    /* Hide scroll to top during exam */
    .sample-exam-page:not(.results-view) .scroll-to-top {
        display: none;
    }
}

/* --- ULTRA COMPACT for small phones --- */
@media (max-width: 480px) {
    .exam-timer {
        height: 28px;
        font-size: 0.75rem;
        padding: 4px 6px;
    }

    .back-to-dashboard {
        width: 24px;
        height: 24px;
        font-size: 0.65rem;
        top: 2px;
        left: 2px;
    }

    .sample-exam-page .exam-content {
        height: calc(100vh - 28px);
        margin-top: 28px;
    }

    .question-overview {
        padding: 0.3rem 0.6rem;
    }

    .question-overview h4 {
        font-size: 0.65rem;
        margin-bottom: 0.25rem;
    }

    .question-grid {
        grid-template-columns: repeat(auto-fill, minmax(18px, 1fr));
        gap: 0.1rem;
        max-height: 35px;
    }

    .question-dot {
        width: 18px;
        height: 18px;
        font-size: 0.55rem;
    }

    .question {
        padding: 0.8rem 0.6rem;
    }

    .question-text {
        font-size: 0.85rem;
        margin-bottom: 0.6rem;
    }

    .question-number {
        padding: 0.15rem 0.4rem;
        font-size: 0.65rem;
    }

    .options {
        gap: 0.25rem;
        padding: 0 0.1rem;
    }

    .option {
        padding: 0.5rem 0.6rem;
        min-height: 36px;
    }

    .option label {
        font-size: 0.75rem;
        gap: 0.4rem;
    }

    .option-letter {
        min-width: 1.1rem;
        height: 1.1rem;
        font-size: 0.6rem;
    }

    .question-navigation {
        height: 44px;
        padding: 0.3rem 0.5rem;
        gap: 0.3rem;
    }

    .question-navigation #prevBtn,
    .question-navigation #nextBtn {
        padding: 0.4rem 0.6rem;
        font-size: 0.7rem;
        min-height: 30px;
    }

    .question-indicator {
        font-size: 0.65rem;
        padding: 0.25rem 0.4rem;
        min-width: 50px;
    }

    .submit-section {
        top: 28px;
        padding: 0.8rem 0.6rem;
    }

    .final-check h3 {
        font-size: 1.1rem;
    }

    .final-check p {
        font-size: 0.8rem;
    }

    .stat {
        padding: 0.3rem 0.6rem;
        font-size: 0.7rem;
        min-width: 60px;
    }

    .exam-btn {
        padding: 0.5rem 0.8rem;
        font-size: 0.75rem;
        min-width: 80px;
    }

    .question-image img {
        max-width: 120px;
        max-height: 80px;
    }

    .placeholder {
        max-width: 120px;
        max-height: 60px;
        padding: 0.6rem;
        font-size: 0.7rem;
    }
}

/* --- LANDSCAPE MOBILE ADJUSTMENTS --- */
@media (max-width: 768px) and (orientation: landscape) {
    .question-overview {
        display: none; /* Hide in landscape to save vertical space */
    }

    .sample-exam-page .exam-content {
        height: calc(100vh - 28px);
        margin-top: 28px;
    }

    .question-navigation {
        height: 40px;
        padding: 0.3rem;
    }

    .question-navigation #prevBtn,
    .question-navigation #nextBtn {
        min-height: 28px;
        font-size: 0.7rem;
        padding: 0.3rem 0.6rem;
    }

    .exam-timer {
        height: 28px;
        font-size: 0.75rem;
    }

    .question-indicator {
        font-size: 0.65rem;
        padding: 0.2rem 0.4rem;
    }

    .question {
        padding: 0.6rem;
    }

    .question-text {
        font-size: 0.8rem;
    }

    .options {
        gap: 0.2rem;
    }

    .option {
        padding: 0.4rem 0.6rem;
        min-height: 32px;
    }
}

/* --- HIGH DPI SCREENS --- */
@media (max-width: 768px) and (-webkit-min-device-pixel-ratio: 2) {
    .question-dot {
        border-width: 0.5px;
    }
    
    .option {
        border-width: 1px;
    }
    
    .exam-timer {
        border-bottom-width: 1px;
    }
    
    .question-navigation {
        border-top-width: 1px;
    }
}

/* --- SAMPLE EXAM MOBILE STYLES --- */
@media (max-width: 768px) {
    .sample-exam-page .header {
        display: none !important;
    }

    .sample-exam-container {
        margin: 0;
        padding: 0;
    }

    /* Exam header mobile - hide during exam */
    .exam-header {
        padding: 2rem 1.5rem;
        margin: 1rem;
        margin-bottom: 2rem;
        border-radius: 15px;
    }

    .exam-header h1 {
        font-size: 2.2rem;
        line-height: 1.2;
    }

    .exam-header p {
        font-size: 1.1rem;
    }

    .welcome-message {
        padding: 1.2rem 1.5rem;
        margin: 1.5rem 0;
        font-size: 1rem;
        border-radius: 12px;
    }

    /* Exam introduction mobile */
    .exam-intro {
        padding: 2rem 1.5rem;
        border-radius: 15px;
        margin: 1rem;
    }

    .exam-intro h2 {
        font-size: 1.8rem;
        margin-bottom: 1.5rem;
    }

    .intro-list h3 {
        font-size: 1.3rem;
        margin-bottom: 1rem;
        text-align: center;
    }

    .intro-list li {
        flex-direction: column;
        text-align: center;
        gap: 0.8rem;
        padding: 1.2rem;
        margin-bottom: 1rem;
        border-radius: 10px;
    }

    .intro-list li i {
        font-size: 2rem;
        margin-top: 0;
    }

    .intro-list li span {
        font-size: 0.95rem;
        line-height: 1.5;
    }

    .timer-info {
        padding: 1.5rem;
        margin: 1.5rem 0;
        border-radius: 12px;
    }

    .timer-info h4 {
        font-size: 1.3rem;
        margin-bottom: 0.8rem;
    }

    .timer-info p {
        font-size: 1rem;
        line-height: 1.5;
    }

    .start-exam-section {
        margin-top: 2rem;
    }

    /* Full-width timer on mobile during exam */
    .exam-timer {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        width: 100%;
        text-align: center;
        padding: 1rem;
        font-size: 1rem;
        border-radius: 0;
        z-index: 1001;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(10px);
        box-shadow: 0 2px 10px rgba(0,0,0,0.1);
        border: none;
        border-bottom: 3px solid #28a745;
    }

    .exam-timer.warning {
        border-bottom-color: #ffc107;
        background: rgba(255, 243, 205, 0.98);
    }

    .exam-timer.danger {
        border-bottom-color: #dc3545;
        background: rgba(248, 215, 218, 0.98);
    }

    /* Add top margin to content when timer is shown */
    .sample-exam-page .exam-content {
        margin-top: 80px;
        padding: 1rem;
        border-radius: 15px;
    }

    /* Back to dashboard button */
    .back-to-dashboard {
        position: fixed;
        top: 15px;
        left: 15px;
        background: rgba(108, 117, 125, 0.9);
        color: white;
        border: none;
        border-radius: 50%;
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
        cursor: pointer;
        box-shadow: 0 4px 15px rgba(0,0,0,0.3);
        transition: all 0.3s ease;
        z-index: 1002;
        display: flex;
        align-items: center;
        justify-content: center;
        text-decoration: none;
    }

    .back-to-dashboard:hover {
        background: rgba(73, 80, 87, 0.9);
        transform: scale(1.1);
        color: white;
        text-decoration: none;
    }

    /* Question overview mobile */
    .question-overview {
        padding: 1rem;
        margin-bottom: 1.5rem;
        border-radius: 12px;
    }

    .question-overview h4 {
        font-size: 1rem;
        margin-bottom: 0.8rem;
    }

    .question-grid {
        grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
        gap: 0.5rem;
    }

    .question-dot {
        width: 40px;
        height: 40px;
        font-size: 0.8rem;
        border-width: 2px;
    }

    .question-dot:hover {
        transform: scale(1.05);
    }

    .question-dot.current {
        transform: scale(1.1);
    }

    /* Question container mobile */
    .question-container {
        margin-bottom: 1.5rem;
    }

    .question {
        padding: 1.5rem;
        border-radius: 12px;
        border-width: 1px;
    }

    .question-number {
        padding: 0.4rem 0.8rem;
        font-size: 0.9rem;
        margin-bottom: 1rem;
        border-radius: 15px;
    }

    .question-text {
        font-size: 1.1rem;
        margin-bottom: 1.5rem;
        line-height: 1.5;
    }

    .question-image {
        margin: 1.5rem 0;
    }

    .question-image img {
        max-width: 100%;
        border-radius: 10px;
        border-width: 2px;
    }

    .placeholder {
        padding: 1.5rem 1rem;
        border-radius: 10px;
        font-size: 1rem;
        max-width: 100%;
    }

    .placeholder small {
        font-size: 0.85rem;
        margin-top: 0.3rem;
    }

    /* Options mobile */
    .options {
        gap: 0.8rem;
    }

    .option {
        padding: 1rem;
        border-radius: 10px;
        flex-direction: row;
        align-items: center;
        gap: 0.8rem;
    }

    .option:hover {
        transform: translateX(4px);
    }

    .option.selected {
        transform: translateX(4px);
    }

    .option input[type="radio"] {
        transform: scale(1.1);
        flex-shrink: 0;
    }

    .option label {
        font-size: 1rem;
        gap: 0.8rem;
    }

    .option-letter {
        padding: 0.3rem 0.6rem;
        font-size: 0.8rem;
        min-width: 2rem;
        height: 2rem;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Enhanced navigation mobile */
    .question-navigation {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(10px);
        padding: 1rem;
        border-top: 3px solid #667eea;
        box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
        display: grid;
        grid-template-columns: 1fr auto 1fr;
        gap: 1rem;
        align-items: center;
        z-index: 1000;
    }

    .question-navigation #prevBtn {
        background: linear-gradient(135deg, #6c757d, #495057);
        color: white;
        border: none;
        padding: 1rem 1.5rem;
        border-radius: 12px;
        font-size: 1rem;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.3s ease;
        box-shadow: 0 4px 15px rgba(108, 117, 125, 0.3);
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.5rem;
        min-height: 50px;
    }

    .question-navigation #prevBtn:disabled {
        background: #e9ecef;
        color: #6c757d;
        cursor: not-allowed;
        box-shadow: none;
    }

    .question-navigation #prevBtn:not(:disabled):hover {
        background: linear-gradient(135deg, #5a6268, #343a40);
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(108, 117, 125, 0.4);
    }

    .question-navigation #nextBtn {
        background: linear-gradient(135deg, #28a745, #20c997);
        color: white;
        border: none;
        padding: 1rem 1.5rem;
        border-radius: 12px;
        font-size: 1rem;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.3s ease;
        box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.5rem;
        min-height: 50px;
    }

    .question-navigation #nextBtn:hover {
        background: linear-gradient(135deg, #218838, #1e7e34);
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
    }

    .question-indicator {
        font-size: 0.9rem;
        font-weight: 600;
        color: #667eea;
        background: white;
        padding: 0.6rem 1rem;
        border-radius: 15px;
        box-shadow: 0 2px 10px rgba(0,0,0,0.1);
        text-align: center;
        white-space: nowrap;
        border: 2px solid #667eea;
    }

    /* Add bottom padding to content to account for fixed navigation */
    .sample-exam-page .exam-content {
        padding-bottom: 120px;
    }

    /* Progress bar mobile */
    .question-counter {
        padding: 1rem;
        margin-bottom: 1.5rem;
        border-radius: 12px;
        font-size: 0.9rem;
    }

    .progress-bar {
        height: 10px;
        margin: 0.8rem 0;
    }

    .progress-text {
        font-size: 0.85rem;
        flex-direction: column;
        gap: 0.3rem;
        text-align: center;
    }

    /* Submit section mobile */
    .submit-section {
        padding: 2rem 1.5rem;
        border-radius: 15px;
        margin-bottom: 120px;
    }

    .final-check h3 {
        font-size: 1.5rem;
        margin-bottom: 0.8rem;
    }

    .final-check p {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }

    .summary-stats {
        flex-direction: column;
        gap: 1rem;
        align-items: center;
    }

    .stat {
        padding: 0.8rem 1.2rem;
        font-size: 0.95rem;
        text-align: center;
        width: 100%;
        max-width: 200px;
    }

    .warning {
        padding: 0.8rem;
        font-size: 0.9rem;
        text-align: center;
    }

    /* Exam buttons mobile */
    .exam-btn {
        padding: 1rem 1.5rem;
        font-size: 1rem;
        border-radius: 12px;
        margin: 0.3rem;
        width: auto;
        min-width: 150px;
    }

    .exam-btn:hover {
        transform: translateY(-1px);
    }

    /* Results mobile - show header again */
    .sample-exam-page.results-view .header {
        display: block !important;
    }

    .sample-exam-page.results-view .exam-content {
        margin-top: 0;
    }

    .sample-exam-page.results-view .back-to-dashboard {
        display: none;
    }

    /* Results mobile */
    .results {
        padding: 2rem 1.5rem;
        border-radius: 15px;
        margin: 1rem;
    }

    .score {
        font-size: 3rem;
        padding: 1.5rem;
        border-radius: 15px;
        margin-bottom: 1rem;
    }

    .score-text {
        font-size: 1.3rem;
        margin-bottom: 2rem;
        line-height: 1.4;
    }

    .results-container {
        margin: 2rem 0;
    }

    .question-result {
        padding: 1.5rem;
        margin-bottom: 1.5rem;
        border-radius: 12px;
        border-left-width: 4px;
    }

    .question-result strong {
        font-size: 1rem;
        display: block;
        margin-bottom: 0.8rem;
    }

    .question-result p {
        font-size: 0.95rem;
        margin: 0.8rem 0;
        line-height: 1.5;
    }

    .question-result .question-image {
        margin: 1rem 0;
    }

    .question-result .question-image img {
        max-width: 150px;
    }

    .question-result .placeholder {
        padding: 0.8rem;
        font-size: 0.85rem;
        max-width: 150px;
        margin: 0 auto;
    }

    .explanation {
        padding: 1rem;
        margin-top: 0.8rem;
        border-radius: 10px;
        border-left-width: 3px;
    }

    .explanation strong {
        font-size: 0.9rem;
    }

    .cta-box {
        padding: 1rem;
        font-size: 0.9rem;
        margin: 1rem 0;
    }

    /* Scroll to top mobile */
    .scroll-to-top {
        bottom: 120px;
        right: 1rem;
        width: 50px;
        height: 50px;
        font-size: 1rem;
    }

    .scroll-to-top:hover {
        transform: translateY(-2px);
    }
}

/* --- ULTRA MOBILE SAMPLE EXAM --- */
@media (max-width: 480px) {
    .sample-exam-container {
        margin: 0.5rem;
    }

    .exam-header {
        padding: 1.5rem 1rem;
        margin-bottom: 1.5rem;
    }

    .exam-header h1 {
        font-size: 1.8rem;
    }

    .exam-header p {
        font-size: 1rem;
    }

    .exam-intro {
        padding: 1.5rem 1rem;
    }

    .exam-intro h2 {
        font-size: 1.5rem;
    }

    .intro-list li {
        padding: 1rem;
        margin-bottom: 0.8rem;
    }

    .intro-list li i {
        font-size: 1.5rem;
    }

    .intro-list li span {
        font-size: 0.9rem;
    }

    .timer-info {
        padding: 1rem;
    }

    .timer-info h4 {
        font-size: 1.1rem;
    }

    .timer-info p {
        font-size: 0.9rem;
    }

    .exam-timer {
        top: 70px;
        left: 0.5rem;
        right: 0.5rem;
        padding: 0.6rem 0.8rem;
        font-size: 0.9rem;
    }

    .exam-content {
        padding: 1rem;
    }

    .question-overview {
        padding: 0.8rem;
    }

    .question-grid {
        grid-template-columns: repeat(auto-fill, minmax(35px, 1fr));
        gap: 0.4rem;
    }

    .question-dot {
        width: 35px;
        height: 35px;
        font-size: 0.75rem;
    }

    .question {
        padding: 1rem;
    }

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

    .options {
        gap: 0.6rem;
    }

    .option {
        padding: 0.8rem;
        border-radius: 8px;
    }

    .option label {
        font-size: 0.9rem;
        gap: 0.6rem;
    }

    .option-letter {
        min-width: 1.5rem;
        height: 1.5rem;
        font-size: 0.7rem;
    }

    .question-navigation {
        padding: 0.8rem;
        gap: 0.8rem;
    }

    .question-navigation .exam-btn {
        padding: 0.8rem;
        font-size: 0.9rem;
    }

    .question-indicator {
        font-size: 0.9rem;
        padding: 0.5rem 1rem;
    }

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

    .progress-text {
        font-size: 0.8rem;
    }

    .submit-section {
        padding: 1.5rem 1rem;
    }

    .final-check h3 {
        font-size: 1.3rem;
    }

    .final-check p {
        font-size: 0.9rem;
    }

    .stat {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
    }

    .exam-btn {
        padding: 0.8rem 1.2rem;
        font-size: 0.9rem;
        margin: 0.2rem;
        min-width: 120px;
    }

    .results {
        padding: 1.5rem 1rem;
    }

    .score {
        font-size: 2.5rem;
        padding: 1rem;
    }

    .score-text {
        font-size: 1.1rem;
        margin-bottom: 1.5rem;
    }

    .question-result {
        padding: 1rem;
        margin-bottom: 1rem;
    }

    .question-result strong {
        font-size: 0.9rem;
    }

    .question-result p {
        font-size: 0.85rem;
        margin: 0.6rem 0;
    }

    .explanation {
        padding: 0.8rem;
        margin-top: 0.6rem;
    }

    .cta-box {
        padding: 1rem;
        font-size: 0.9rem;
        margin: 1rem 0;
    }

    .scroll-to-top {
        bottom: 0.5rem;
        right: 0.5rem;
        width: 45px;
        height: 45px;
        font-size: 0.9rem;
    }
}

/* --- LANDSCAPE MOBILE ADJUSTMENTS --- */
@media (max-width: 768px) and (orientation: landscape) {
    .exam-timer {
        top: 60px;
        left: 1rem;
        right: auto;
        max-width: 200px;
    }

    .question-grid {
        grid-template-columns: repeat(auto-fill, minmax(45px, 1fr));
    }

    .question-dot {
        width: 45px;
        height: 45px;
    }

    .question-navigation {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

    .question-navigation .exam-btn {
        width: auto;
        flex: 1;
        max-width: 150px;
    }

    .question-indicator {
        order: 0;
        flex: 0 0 auto;
    }

    .summary-stats {
        flex-direction: row;
        justify-content: center;
    }

    .stat {
        width: auto;
        max-width: none;
    }
}

/* --- CBR-STYLE MOBILE EXAM LAYOUT --- */
@media (max-width: 768px) {
    .sample-exam-page .exam-content {
        flex: 1;
        display: flex;
        flex-direction: column;
        margin: 0;
        padding: 0;
        border-radius: 0;
        background: #f8f9fa;
        height: calc(100vh - 32px - 60px); /* Timer height - Footer height */
        margin-top: 32px;
        overflow: hidden;
    }

    /* Progress bar below question overview */
    .question-counter {
        text-align: center;
        padding: 0.8rem;
        background: #f8f9fa;
        border-bottom: 2px solid #e9ecef;
        color: #2c3e50;
        font-weight: 600;
        font-size: 0.8rem;
        flex-shrink: 0;
    }

    .progress-bar {
        width: 100%;
        height: 6px;
        background: #e9ecef;
        border-radius: 3px;
        margin: 0.6rem  0;
        overflow: hidden;
    }

    .progress-fill {
        height: 100%;
        background: #28a745;
        border-radius: 3px;
        transition: width 0.3s ease;
    }

    .progress-text {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-top: 0.4rem;
        font-size: 0.75rem;
        color: #666;
    }

    .progress-percentage {
        font-weight: 700;
        color: #667eea;
    }

    /* Question container fills remaining space */
    .question-container {
        flex: 1;
        overflow-y: auto;
        padding: 1rem 0.8rem;
        margin: 0;
        background: white;
        display: flex;
        flex-direction: column;
    }

    .question {
        padding: 0;
        border-radius: 0;
        border: none;
        flex: 1;
        display: flex;
        flex-direction: column;
        overflow-y: auto;
        background: white;
    }

    /* --- MOBILE FIXED FOOTER --- */
    .exam-footer {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: white;
        padding: 0.6rem 0.8rem;
        border-top: 2px solid #667eea;
        box-shadow: 0 -2px 8px rgba(0,0,0,0.1);
        display: grid;
        grid-template-columns: 1fr auto 1fr;
        gap: 0.6rem;
        align-items: center;
        z-index: 1000;
        height: 60px;
        box-sizing: border-box;
    }

    .footer-btn {
        background: #6c757d;
        color: white;
        border: none;
        padding: 0.6rem 0.8rem;
        border-radius: 6px;
        font-size: 0.8rem;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.2s ease;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.4rem;
        min-height: 40px;
        text-decoration: none;
        min-width: 80px;
    }

    .footer-btn.next-btn {
        background: #28a745;
    }

    .footer-btn.prev-btn:disabled {
        background: #e9ecef;
        color: #6c757d;
        cursor: not-allowed;
    }

    .footer-btn.prev-btn:not(:disabled):hover {
        background: #5a6268;
    }

    .footer-btn.next-btn:hover {
        background: #218838;
    }

    .footer-indicator {
        font-size: 0.75rem;
        font-weight: 600;
        color: #667eea;
        background: rgba(102, 126, 234, 0.1);
        padding: 0.4rem 0.8rem;
        border-radius: 12px;
        text-align: center;
        white-space: nowrap;
        border: 1px solid #667eea;
        justify-self: center;
        min-width: 70px;
    }

    /* Submit section mobile adjustments */
    .submit-section {
        position: fixed;
        top: 32px;
        left: 0;
        right: 0;
        bottom: 0;
        background: white;
        padding: 1rem 0.8rem;
        border-radius: 0;
        z-index: 999;
        overflow-y: auto;
        margin: 0;
    }

    /* Hide footer when submit section is shown */
    .submit-section[style*="display: block"] ~ .exam-footer {
        display: none !important;
    }
}

/* --- ULTRA MOBILE FOOTER (Under 480px) --- */
@media (max-width: 480px) {
    .exam-footer {
        height: 55px;
        padding: 0.5rem 0.6rem;
        gap: 0.5rem;
    }

    .footer-btn {
        padding: 0.5rem 0.6rem;
        font-size: 0.75rem;
        min-height: 36px;
        min-width: 70px;
        gap: 0.3rem;
    }

    .footer-indicator {
        font-size: 0.7rem;
        padding: 0.3rem 0.6rem;
        min-width: 60px;
    }

    .sample-exam-page .exam-content {
        height: calc(100vh - 28px - 55px); /* Adjusted for smaller footer */
    }

    .question-counter {
        padding: 0.6rem;
        font-size: 0.75rem;
    }

    .progress-text {
        font-size: 0.7rem;
    }
}

/* --- LANDSCAPE MOBILE ADJUSTMENTS --- */
@media (max-width: 768px) and (orientation: landscape) {
    .question-counter {
        display: none; /* Hide progress bar in landscape to save space */
    }

    .sample-exam-page .exam-content {
        height: calc(100vh - 28px - 50px);
    }

    .exam-footer {
        height: 50px;
        padding: 0.4rem 0.6rem;
    }

    .footer-btn {
        min-height: 35px;
        font-size: 0.75rem;
        padding: 0.4rem 0.6rem;
    }

    .footer-indicator {
        font-size: 0.7rem;
        padding: 0.3rem 0.6rem;
    }
}

/* --- MOBILE HEADER NAVIGATION BUTTONS --- */
@media (max-width: 768px) {
    .nav-links .btn {
        padding: 0.4rem 0.8rem !important;
        font-size: 0.8rem !important;
        border-radius: 15px !important;
        margin: 0.2rem !important;
        width: auto !important;
        min-width: auto !important;
    }
    
    .nav-links {
        gap: 0.5rem !important;
    }

    /* Override login page styles for mobile header */
    .login-page .nav-links .btn {
        padding: 0.4rem 0.8rem !important;
        font-size: 0.8rem !important;
        border-radius: 15px !important;
        width: auto !important;
        margin-top: 0 !important;
    }
}

@media (max-width: 480px) {
    .nav-links .btn {
        padding: 0.35rem 0.7rem !important;
        font-size: 0.75rem !important;
        border-radius: 12px !important;
    }

    /* Override login page styles for ultra-mobile header */
    .login-page .nav-links .btn {
        padding: 0.35rem 0.7rem !important;
        font-size: 0.75rem !important;
        border-radius: 12px !important;
        width: auto !important;
    }
}

/* --- MOBILE TEXT LOGO --- */
@media (max-width: 768px) {
    .logo.text-logo {
        font-size: 1.5rem;
        font-weight: 800;
    }
}

@media (max-width: 480px) {
    .logo.text-logo {
        font-size: 1.3rem;
        font-weight: 800;
    }
}

/* --- MOBILE EXAM PROGRESS ELEMENTS --- */
@media (max-width: 768px) {
    .question-overview {
        padding: 1rem !important;
        background: #f8f9fa !important;
        display: block !important;
    }

    .question-overview h4 {
        font-size: 0.8rem !important;
        margin-bottom: 0.8rem !important;
    }

    .question-grid {
        grid-template-columns: repeat(auto-fill, minmax(28px, 1fr)) !important;
        gap: 0.4rem !important;
        display: grid !important;
    }

    .question-dot {
        width: 28px !important;
        height: 28px !important;
        font-size: 0.7rem !important;
        border-width: 1px !important;
    }

    .question-counter {
        padding: 1rem !important;
        font-size: 0.85rem !important;
        display: block !important;
    }

    .progress-bar {
        height: 8px !important;
        margin: 0.8rem 0 !important;
        display: block !important;
    }

    .progress-text {
        font-size: 0.8rem !important;
        margin-top: 0.6rem !important;
        display: flex !important;
    }

    .progress-percentage {
        font-size: 0.9rem !important;
    }
}

@media (max-width: 480px) {
    .question-overview {
        padding: 0.8rem !important;
    }

    .question-overview h4 {
        font-size: 0.75rem !important;
        margin-bottom: 0.6rem !important;
    }

    .question-grid {
        grid-template-columns: repeat(auto-fill, minmax(24px, 1fr)) !important;
        gap: 0.3rem !important;
    }

    .question-dot {
        width: 24px !important;
        height: 24px !important;
        font-size: 0.65rem !important;
    }

    .question-counter {
        padding: 0.8rem !important;
        font-size: 0.8rem !important;
    }

    .progress-bar {
        height: 6px !important;
        margin: 0.6rem 0 !important;
    }

    .progress-text {
        font-size: 0.75rem !important;
        flex-direction: column !important;
        gap: 0.3rem !important;
        text-align: center !important;
    }
}

/* --- MOBILE EXAM PROGRESS STYLES (COMPACT) --- */
@media (max-width: 768px) {
    .question-overview {
        padding: 0.8rem 1rem !important;
        background: #f8f9fa !important;
        border-bottom: 2px solid #e9ecef !important;
        order: 1 !important;
    }

    .question-overview h4 {
        font-size: 0.75rem !important;
        margin-bottom: 0.6rem !important;
    }

    .question-grid {
        grid-template-columns: repeat(auto-fill, minmax(24px, 1fr)) !important;
        gap: 0.3rem !important;
        display: grid !important;
    }

    .question-dot {
        width: 24px !important;
        height: 24px !important;
        font-size: 0.6rem !important;
        border-width: 1px !important;
    }

    .question-counter {
        padding: 0.8rem 1rem !important;
        font-size: 0.8rem !important;
        display: block !important;
        order: 2 !important;
    }

    .progress-bar {
        height: 6px !important;
        margin: 0.6rem 0 !important;
        display: block !important;
    }

    .progress-text {
        font-size: 0.75rem !important;
        margin-top: 0.5rem !important;
        display: flex !important;
    }

    .progress-percentage {
        font-size: 0.8rem !important;
    }

    .question-container {
        order: 3 !important;
        padding: 1.5rem 1rem !important;
    }
}

@media (max-width: 480px) {
    .question-overview {
        padding: 0.6rem 0.8rem !important;
    }

    .question-overview h4 {
        font-size: 0.7rem !important;
        margin-bottom: 0.5rem !important;
    }

    .question-grid {
        grid-template-columns: repeat(auto-fill, minmax(20px, 1fr)) !important;
        gap: 0.25rem !important;
    }

    .question-dot {
        width: 20px !important;
        height: 20px !important;
        font-size: 0.55rem !important;
    }

    .question-counter {
        padding: 0.6rem 0.8rem !important;
        font-size: 0.75rem !important;
    }

    .progress-bar {
        height: 5px !important;
        margin: 0.5rem 0 !important;
    }

    .progress-text {
        font-size: 0.7rem !important;
        flex-direction: column !important;
        gap: 0.2rem !important;
        text-align: center !important;
    }
}

/* --- MOBILE EXAM TIMER (COMPACT) --- */
@media (max-width: 768px) {
    .exam-timer {
        top: 8px !important;
        right: 10px !important;
        padding: 0.5rem 0.7rem !important;
        font-size: 0.8rem !important;
        min-width: 100px !important;
    }

    .sample-exam-container {
        padding: 0 1rem;
    }

    .exam-content {
        margin: 0.5rem 1rem 2rem;
        margin-top: 80px; /* Reduced for mobile */
    }

    .question-overview {
        padding: 0.6rem 1rem !important;
    }

    .question-overview h4 {
        font-size: 0.7rem !important;
        margin-bottom: 0.4rem !important;
    }

    .question-counter {
        padding: 0.6rem 1rem !important;
        font-size: 0.75rem !important;
    }

    .question-grid {
        grid-template-columns: repeat(auto-fill, minmax(22px, 1fr)) !important;
        gap: 0.25rem !important;
    }

    .question-dot {
        width: 22px !important;
        height: 22px !important;
        font-size: 0.55rem !important;
    }

    .progress-bar {
        height: 4px !important;
        margin: 0.4rem 0 !important;
    }

    .progress-text {
        font-size: 0.65rem !important;
        margin-top: 0.2rem !important;
    }

    .progress-percentage {
        font-size: 0.7rem !important;
    }

    .question-container {
        padding: 1rem !important;
    }
}

@media (max-width: 480px) {
    .exam-timer {
        top: 6px !important;
        right: 8px !important;
        padding: 0.4rem 0.6rem !important;
        font-size: 0.75rem !important;
        min-width: 90px !important;
    }

    .exam-content {
        margin: 0.3rem 0.5rem 2rem;
        margin-top: 70px;
    }

    .question-overview {
        padding: 0.5rem 0.8rem !important;
    }

    .question-overview h4 {
        font-size: 0.65rem !important;
        margin-bottom: 0.3rem !important;
    }

    .question-counter {
        padding: 0.5rem 0.8rem !important;
        font-size: 0.7rem !important;
    }

    .question-grid {
        grid-template-columns: repeat(auto-fill, minmax(20px, 1fr)) !important;
        gap: 0.2rem !important;
    }

    .question-dot {
        width: 20px !important;
        height: 20px !important;
        font-size: 0.5rem !important;
    }
}