/* Base Styles for Mock Test Container */
#mock-test-container {
    width: 100%;
    background: #f9f9f9;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    border-radius: 10px;
    border: 2px solid #00bcd4;
    box-shadow: 0 0 15px rgba(52, 152, 219, 0.3);
    overflow: hidden;
    margin: 10px 0;
}

/* Test Info Container */
#test-info-container {
    margin-bottom: 20px;
    padding: 20px;
    background: linear-gradient(45deg, #ffffff, #e8f0fe);
    border: 2px solid #00bcd4;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

#test-info-container h2 {
    font-size: 28px;
    color: #174ea6;
    margin: 0 0 15px;
    font-weight: 700;
    text-align: center;
}

.test-description {
    font-size: 16px;
    color: #555;
    margin: 10px 0;
    line-height: 1.6;
}

.test-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.detail-item {
    background: white;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #00bcd4;
}

.detail-item .label {
    font-size: 12px;
    color: #666;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.detail-item .value {
    font-size: 18px;
    font-weight: bold;
    color: #174ea6;
}

/* Sections Overview */
.sections-overview {
    margin: 25px 0;
}

.sections-overview h3 {
    font-size: 22px;
    color: #174ea6;
    margin-bottom: 15px;
    text-align: center;
}

.sections-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
}

.section-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    border: 2px solid #00bcd4;
    transition: transform 0.3s ease;
}

.section-card:hover {
    transform: translateY(-5px);
}

.section-name {
    font-size: 18px;
    font-weight: bold;
    color: #174ea6;
    margin-bottom: 8px;
}

.section-name-hi {
    font-size: 14px;
    color: #666;
    margin-bottom: 10px;
}

.section-questions {
    font-size: 24px;
    font-weight: bold;
    color: #00bcd4;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.action-buttons .button {
    padding: 12px 30px;
    font-size: 16px;
    font-weight: bold;
    border-radius: 25px;
    text-decoration: none;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    min-width: 180px;
}

.action-buttons .button-primary {
    background: linear-gradient(45deg, #00bcd4, #0097a7);
    color: white;
}

.action-buttons .button-primary:hover {
    background: linear-gradient(45deg, #0097a7, #00838f);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 188, 212, 0.3);
}

.action-buttons .button-secondary {
    background: linear-gradient(45deg, #ff9800, #f57c00);
    color: white;
}

.action-buttons .button-secondary:hover {
    background: linear-gradient(45deg, #f57c00, #e65100);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(255, 152, 0, 0.3);
}

/* Header Styles */
.mock-header-top {
    padding: 10px 15px;
    background: linear-gradient(to right, #174ea6, #1a73e8);
    color: white;
}

.header-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: nowrap;
    gap: 10px;
}

/* Left Section - Timer & Pause */
.header-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
}

.timer-container {
    background: rgba(255, 255, 255, 0.15);
    padding: 5px 15px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    min-width: 85px;
    text-align: center;
}

#timer {
    font-weight: bold;
    color: white;
    font-size: 16px;
    letter-spacing: 1px;
}

#pause-container button {
    padding: 6px 15px;
    border: none;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    cursor: pointer;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

#pause-container button:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
}

/* Center Section - Test Title */
.header-center {
    flex: 1;
    text-align: center;
    padding: 0 15px;
    overflow: hidden;
}

.test-title {
    font-size: 18px;
    font-weight: 700;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: white;
}

/* Right Section - User & Language */
.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 0 0 auto;
}

.user-links {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.15);
    padding: 5px 12px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.user-links a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    font-size: 13px;
}

.user-links a:hover {
    text-decoration: underline;
}

.separator {
    color: rgba(255, 255, 255, 0.6);
    font-size: 12px;
}

#language-switcher {
    display: flex;
    gap: 5px;
}

#language-switcher .lang-btn {
    padding: 5px 12px;
    border: none;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    cursor: pointer;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 700;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

#language-switcher .lang-btn.active {
    background: #00bcd4;
    box-shadow: 0 0 10px rgba(0, 188, 212, 0.5);
}

#language-switcher .lang-btn:hover:not(.active) {
    background: rgba(255, 255, 255, 0.25);
}

/* Section Navigation */
.mock-header-bottom {
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.08);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.section-navigation {
    display: flex;
    overflow-x: auto;
    gap: 6px;
    padding: 5px 0;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

.section-navigation::-webkit-scrollbar {
    height: 4px;
}

.section-navigation::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}

.section-navigation::-webkit-scrollbar-thumb {
    background: #00bcd4;
    border-radius: 2px;
}

.section-nav-btn {
    flex: 0 0 auto;
    min-width: 90px;
    padding: 6px 8px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.section-nav-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
}

.section-nav-btn.active {
    background: #00bcd4;
    border-color: white;
    transform: scale(1.05);
    box-shadow: 0 0 10px rgba(0, 188, 212, 0.5);
    color: white;
}

.section-name {
    font-weight: 600;
    font-size: 10px;
    white-space: nowrap;
}

.section-count {
    background: rgba(255, 255, 255, 0.3);
    padding: 1px 6px;
    border-radius: 8px;
    font-size: 9px;
    font-weight: bold;
    min-width: 20px;
    text-align: center;
}

/* Pause Overlay */
#pause-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
}

#pause-message-container {
    background: linear-gradient(135deg, #174ea6, #1a73e8);
    padding: 40px;
    border-radius: 15px;
    text-align: center;
    border: 3px solid #00bcd4;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

#pause-message {
    color: white;
    font-size: 32px;
    font-weight: bold;
    margin-bottom: 20px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

#resume-in-overlay-btn {
    padding: 12px 30px;
    background: #27ae60;
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

#resume-in-overlay-btn:hover {
    background: #219653;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(39, 174, 96, 0.3);
}

/* Desktop Layout Wrapper - Clearfix */
.desktop-layout-wrapper {
    overflow: hidden;
    margin: 10px 0;
}

/* Desktop Navigation - Simplified Grid */
.desktop-nav {
    width: 33%;
    float: right;
    margin: 0 0 10px 10px;
    padding: 15px;
    background: white;
    border-radius: 12px;
    border: 2px solid #00bcd4;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
    overflow-x: hidden;
}

.desktop-nav .questions-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
}

.desktop-nav-btn {
    aspect-ratio: 1/1;
    min-height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: white;
    color: #333;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 5px;
}

.desktop-nav-btn:hover {
    border-color: #3498db;
    background: #f0f7ff;
    transform: translateY(-2px);
}

.desktop-nav-btn.current {
    border-color: #e67e22;
    background: #fff3e0;
    color: #e67e22;
    transform: scale(1.05);
    box-shadow: 0 0 8px rgba(230, 126, 34, 0.3);
}

.desktop-nav-btn.answered {
    border-color: #27ae60;
    background: #e8f8ef;
    color: #27ae60;
}

.desktop-nav-btn.review {
    border-color: #f39c12;
    background: #fef9e7;
    color: #f39c12;
}

.desktop-nav-btn.skipped {
    border-color: #e74c3c;
    background: #fdedec;
    color: #e74c3c;
}

/* Question Area */
.question-area {
    width: 63%;
    float: left;
    margin: 0 10px 10px 0;
    padding: 0;
    background: white;
    border-radius: 10px;
    border: 2px solid #00bcd4;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: linear-gradient(45deg, #e8f0fe, #ffffff);
    border-bottom: 2px solid #00bcd4;
}

.question-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.section-badge {
    background: #1a73e8;
    color: white;
    padding: 6px 15px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.question-counter {
    font-size: 14px;
    font-weight: 600;
    color: #174ea6;
    white-space: nowrap;
}

/* Live Question Timer */
#live-question-timer {
    margin-left: 15px;
    padding: 5px 12px;
    background: #fff3e0;
    color: #e67e22;
    border-radius: 15px;
    font-weight: bold;
    font-size: 13px;
    border: 1px solid #ffcc80;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
    animation: pulse 2s infinite;
    box-shadow: 0 2px 8px rgba(230, 126, 34, 0.2);
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(230, 126, 34, 0.4); }
    70% { box-shadow: 0 0 0 5px rgba(230, 126, 34, 0); }
    100% { box-shadow: 0 0 0 0 rgba(230, 126, 34, 0); }
}

.question-content {
    padding: 20px;
}

.question-content h3 {
    font-size: 17px;
    color: #1a237e;
    line-height: 1.5;
    margin-bottom: 20px;
}

.question-image {
    max-width: 100%;
    max-height: 250px;
    display: block;
    margin: 15px auto;
    border-radius: 8px;
    border: 2px solid #00bcd4;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.options-container {
    margin-top: 20px;
}

.option-item {
    margin-bottom: 10px;
}

.option-label {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.option-label:hover {
    border-color: #3498db;
    background: #f8fafc;
    transform: translateY(-2px);
}

.option-label input[type="radio"] {
    margin-right: 12px;
    width: 18px;
    height: 18px;
    accent-color: #00bcd4;
}

.option-text {
    font-size: 15px;
    color: #333;
    flex: 1;
}

.option-label input[type="radio"]:checked + .option-text {
    font-weight: 600;
    color: #174ea6;
}

/* Results Container */
#results-container {
    margin-top: 20px;
    padding: 20px;
    background: #f7f9fc;
    border-radius: 10px;
    border: 2px solid #00bcd4;
    width: 100%;
    clear: both;
}

#results-summary {
    padding: 20px;
    background: linear-gradient(45deg, #1a73e8, #e8f0fe);
    border-radius: 8px;
    border: 2px solid #00bcd4;
    margin-bottom: 20px;
}

#results-summary h2 {
    font-size: 28px;
    color: #174ea6;
    margin-bottom: 15px;
    text-align: center;
}

.results-header {
    text-align: center;
    margin-bottom: 20px;
}

.final-score {
    font-size: 24px;
    color: #174ea6;
    font-weight: bold;
}

.overall-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.stat-item {
    background: white;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #00bcd4;
    text-align: center;
    transition: transform 0.3s ease;
}

.stat-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.stat-label {
    display: block;
    font-size: 14px;
    color: #666;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 24px;
    font-weight: bold;
}

.stat-value.correct {
    color: #27ae60;
}

.stat-value.incorrect {
    color: #e74c3c;
}

.stat-value.skipped {
    color: #f39c12;
}

.stat-value.negative {
    color: #c0392b;
}

/* Section Results */
.section-results {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.section-result-card {
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
    border-radius: 10px;
    padding: 20px;
    border: 2px solid #1a73e8;
    transition: transform 0.3s ease;
}

.section-result-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(26, 115, 232, 0.2);
}

.section-result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #1a73e8;
}

.section-result-name {
    font-size: 18px;
    font-weight: bold;
    color: #0d47a1;
}

.section-result-score {
    font-size: 24px;
    font-weight: bold;
    color: #1a73e8;
}

.section-result-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    font-size: 14px;
}

.section-result-detail {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    border-bottom: 1px solid #90caf9;
}

.section-result-label {
    color: #37474f;
    font-weight: 500;
}

.section-result-value {
    color: #1a237e;
    font-weight: bold;
}

.section-result-value.correct {
    color: #27ae60;
}

.section-result-value.incorrect {
    color: #e74c3c;
}

.section-result-value.skipped {
    color: #f39c12;
}

.section-result-value.negative {
    color: #c0392b;
}

.section-result-value.percentage {
    color: #9b59b6;
}

/* Section Accordion Styles for Question-wise Analysis */
.result-section-accordion {
    margin-bottom: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
}

.result-section-header {
    background: #f8f9fa;
    padding: 12px 15px;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid #e0e0e0;
    transition: background 0.2s;
    user-select: none;
}

.result-section-header:hover {
    background: #eef2f7;
}

.accordion-icon {
    font-size: 12px;
    color: #4361ee;
    margin-right: 5px;
}

.question-count {
    margin-left: auto;
    font-size: 12px;
    font-weight: normal;
    color: #6c757d;
}

.result-section-content {
    padding: 15px;
    background: #fff;
}

/* Individual question result styling */
.question-result {
    background: #fefefe;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 12px;
}

.question-result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 8px;
}

.question-time {
    font-size: 12px;
    color: #555;
}

/* Status badges */
.result-correct {
    background: #d4edda;
    color: #155724;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: bold;
}

.result-incorrect {
    background: #f8d7da;
    color: #721c24;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: bold;
}

.result-skipped {
    background: #fff3cd;
    color: #856404;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: bold;
}

.answer-comparison {
    margin: 10px 0;
}

.answer-item {
    margin: 5px 0;
}

.correct-answer {
    color: #27ae60;
    font-weight: bold;
}

.wrong-answer {
    color: #e74c3c;
    font-weight: bold;
}

.description-container {
    margin-top: 10px;
    padding: 10px;
    background: white;
    border-radius: 5px;
    border: 1px solid #ddd;
}

.show-description-btn {
    padding: 5px 10px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    margin-top: 5px;
    transition: all 0.3s ease;
}

.show-description-btn:hover {
    background: #2980b9;
    transform: translateY(-2px);
}

.guest-message {
    text-align: center;
    padding: 20px;
    background: #ffebee;
    border-radius: 10px;
    margin: 20px 0;
    border: 2px solid #f44336;
}

.guest-message h3 {
    color: #c62828;
    margin-bottom: 10px;
}

.guest-message a {
    color: #174ea6;
    font-weight: bold;
    text-decoration: none;
}

.guest-message a:hover {
    text-decoration: underline;
}

/* Mobile Question Navigation - Single Row Scrollable */
.mobile-nav {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 5px;
    padding: 10px;
    background: white;
    border-radius: 10px;
    border: 2px solid #00bcd4;
    margin: 10px 0;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

.mobile-nav::-webkit-scrollbar {
    height: 4px;
}

.mobile-nav::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 2px;
}

.mobile-nav::-webkit-scrollbar-thumb {
    background: #00bcd4;
    border-radius: 2px;
}

.mobile-nav-btn {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    border: 2px solid #00bcd4;
    border-radius: 8px;
    background: white;
    color: #333;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-nav-btn.current {
    background: #e67e22;
    color: white;
    border-color: #e67e22;
    transform: scale(1.1);
}

.mobile-nav-btn.answered {
    background: #27ae60;
    color: white;
    border-color: #27ae60;
}

.mobile-nav-btn.review {
    background: #f39c12;
    color: white;
    border-color: #f39c12;
}

.mobile-nav-btn.skipped {
    background: #e74c3c;
    color: white;
    border-color: #e74c3c;
}

/* Hide old section-group elements if any */
.section-group,
.section-header,
.section-description {
    display: none;
}

/* ═══ FOOTER BAR (matches header gradient) ═══ */
.mock-footer-bar {
    clear: both;
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to right, #174ea6, #1a73e8);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    z-index: 1000;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.25);
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 18px;
    max-width: 100%;
    flex-wrap: nowrap;
}

.footer-left {
    flex-shrink: 0;
}

.footer-right {
    flex-shrink: 0;
    display: flex;
    gap: 8px;
}

.footer-center {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
    flex: 1;
}

/* Footer buttons base */
.footer-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 9px 16px;
    border: none;
    border-radius: 22px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: transform .15s, box-shadow .15s, opacity .15s;
    white-space: nowrap;
    letter-spacing: .2px;
    background: rgba(255, 255, 255, 0.15);
    color: white;
}

.footer-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
}

.footer-btn:active {
    transform: translateY(0);
}

.footer-btn-prev {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.footer-btn-save {
    background: linear-gradient(135deg, #4ade80, #16a34a);
    color: #fff;
}

.footer-btn-review {
    background: linear-gradient(135deg, #fb923c, #ea580c);
    color: #fff;
}

.footer-btn-clear {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.footer-btn-submit {
    background: linear-gradient(135deg, #f43f5e, #be123c);
    color: #fff;
}

.footer-btn-nav {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

/* Navigation Info Popup - Enhanced with Instructions */
#nav-info-popup {
    position: fixed;
    bottom: 70px;
    right: 20px;
    z-index: 2000;
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    width: 320px;
    max-width: 90vw;
    overflow: hidden;
    animation: popupSlideIn 0.2s ease;
}

@keyframes popupSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.nav-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 14px;
    font-weight: 700;
    color: #e2e8f0;
}

.nav-popup-header button {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 16px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}

.nav-popup-header button:hover {
    color: #f87171;
}

.nav-popup-legend {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.nav-legend-item {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 12px;
    color: #cbd5e1;
}

.nav-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.dot-answered {
    background: #4ade80;
}

.dot-review {
    background: #fb923c;
}

.dot-skipped {
    background: #94a3b8;
}

.dot-current {
    background: #818cf8;
}

.dot-unattempted {
    background: #334155;
    border: 1px solid #475569;
}

.nav-popup-stats {
    padding: 12px 16px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.nav-stat-item {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 8px 10px;
    text-align: center;
}

.nav-stat-num {
    font-size: 20px;
    font-weight: 800;
    color: #e2e8f0;
    line-height: 1;
}

.nav-stat-lbl {
    font-size: 10px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: .4px;
    margin-top: 3px;
}

.nav-stat-item.ns-correct .nav-stat-num {
    color: #4ade80;
}

.nav-stat-item.ns-review .nav-stat-num {
    color: #fb923c;
}

.nav-stat-item.ns-skipped .nav-stat-num {
    color: #94a3b8;
}

.nav-stat-item.ns-remain .nav-stat-num {
    color: #818cf8;
}

/* Instructions inside popup */
.nav-popup-instructions {
    padding: 12px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 11px;
    color: #94a3b8;
    line-height: 1.4;
}

.nav-popup-instructions h4 {
    margin: 0 0 6px 0;
    font-size: 12px;
    color: #cbd5e1;
}

.nav-popup-instructions ul {
    margin: 0;
    padding-left: 16px;
}

/* Responsive Design */
@media (max-width: 768px) {

    /* Hide desktop navigation in mobile */
    .desktop-nav {
        display: none;
    }

    /* Header layout for mobile */
    .header-top-row {
        flex-wrap: wrap;
        gap: 8px;
    }

    .header-left,
    .header-right {
        flex: 1;
        justify-content: space-between;
    }

    .header-center {
        display: none;
    }

    .question-area {
        width: 100%;
        float: none;
        margin: 10px 0;
    }

    /* Mobile footer - two rows layout */
    .footer-inner {
        flex-wrap: wrap;
        padding: 8px 10px;
    }

    .footer-left {
        order: 1;
        flex: 1;
        text-align: center;
    }

    .footer-center {
        order: 2;
        width: 100%;
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
        margin: 6px 0;
    }

    .footer-right {
        order: 3;
        flex: 1;
        display: flex;
        justify-content: center;
        gap: 6px;
    }

    .footer-center .footer-btn {
        width: 100%;
        justify-content: center;
        padding: 8px 0;
        font-size: 11px;
    }

    .footer-left .footer-btn,
    .footer-right .footer-btn {
        padding: 8px 12px;
        font-size: 11px;
    }

    .footer-nav-label {
        display: none;
    }

    .mobile-nav {
        gap: 5px;
        padding: 8px;
    }

    .mobile-nav-btn {
        width: 38px;
        height: 38px;
        font-size: 13px;
    }

    .question-meta {
        gap: 8px;
    }

    .section-badge {
        padding: 4px 10px;
        font-size: 11px;
    }

    .question-counter {
        font-size: 12px;
    }

    #live-question-timer {
        font-size: 11px;
        padding: 4px 8px;
        margin-left: 8px;
    }

    .overall-stats,
    .section-results {
        grid-template-columns: 1fr;
    }

    .section-navigation {
        flex-wrap: nowrap;
        justify-content: flex-start;
    }

    .section-nav-btn {
        min-width: 80px;
        padding: 5px 6px;
        gap: 3px;
    }

    .section-nav-btn .section-name {
        font-size: 9px;
    }

    .section-count {
        font-size: 8px;
        padding: 1px 4px;
    }

    .test-title {
        font-size: 14px;
    }

    .timer-container {
        min-width: 70px;
        padding: 4px 10px;
    }

    #timer {
        font-size: 14px;
    }

    .user-links {
        padding: 4px 8px;
    }

    .user-links a {
        font-size: 11px;
    }

    #language-switcher .lang-btn {
        padding: 4px 10px;
        font-size: 11px;
    }

    #pause-container button {
        padding: 5px 12px;
        font-size: 12px;
    }

    .mobile-nav {
        scroll-padding: 50%;
    }
}

@media (min-width: 769px) {
    .mobile-nav {
        display: none;
    }
}