/* Modern TCF Exam Interface Styles - Mobile Optimized */
:root {
    --tcf-primary: #1e5799;
    --tcf-secondary: #2989d8;
    --tcf-success: #28a745;
    --tcf-warning: #ffc107;
    --tcf-danger: #dc3545;
    --tcf-light: #f8f9fa;
    --tcf-dark: #343a40;
    --tcf-border: #dee2e6;
}

/* CE Test Submit Buttons - Hidden by default, shown only on last question */
#mobile-submit-test:not(.tcf-show-submit),
#grid-submit-btn:not(.tcf-show-submit),
#manual-submit-test:not(.tcf-show-submit) {
    display: none !important;
}

/* Base Styles */
* {
    box-sizing: border-box;
}

body.tcf-exam-body {
    background-color: #f8f9fa;
    margin: 0;
    min-height: 100vh;
    padding-top: 60px;
    overflow-x: hidden;
}

/* Ensure content visibility without breaking layout */
body.tcf-exam-body .tcf-container {
    visibility: visible !important;
    opacity: 1 !important;
}

/* Theme Header Container - Isolation and Protection */
.tcf-theme-header-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1030;
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    min-height: 60px;
    max-height: none; /* Allow Elementor headers to be taller */
    overflow: visible; /* Allow Elementor content to show */
    isolation: isolate; /* Create new stacking context */
}

/* Style fallback header */
.tcf-theme-header-container .tcf-theme-fallback-header,
.tcf-theme-header-container .tcf-fallback-header {
    padding: 10px 20px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
}

.tcf-theme-header-container .site-branding {
    display: flex;
    align-items: center;
}

.tcf-theme-header-container .site-title {
    margin: 0;
    font-size: 1.5rem;
}

.tcf-theme-header-container .site-title a {
    color: #333;
    text-decoration: none;
}

.tcf-theme-header-container .main-navigation {
    display: flex;
    align-items: center;
}

.tcf-theme-header-container .primary-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 20px;
}

.tcf-theme-header-container .primary-menu a {
    color: #666;
    text-decoration: none;
}

/* Minimal theme header isolation - let Elementor work naturally */
.tcf-theme-header-container {
    /* Only essential containment */
}

/* Ensure proper width containment without breaking Elementor positioning */
.tcf-theme-header-container * {
    max-width: 100%;
    box-sizing: border-box;
}

/* Hide any theme content wrappers that leak into header (but preserve Elementor content) */
.tcf-theme-header-container > #content:empty,
.tcf-theme-header-container > .site-content:empty,
.tcf-theme-header-container > .ast-container:empty {
    display: none !important;
}

/* Ensure exam content is visible and positioned correctly */
.tcf-container {
    position: relative;
    z-index: 10;
    background: transparent;
}

/* Keep exam content styles intact - removed all: revert which was breaking layout */

/* Adjust body padding based on actual header height */
body.tcf-exam-body.has-theme-header {
    padding-top: 120px; /* Increased to accommodate taller Elementor headers */
}

/* Custom header styles removed - only theme header supported now */





    text-decoration: none !important;
    transform: translateY(-1px);
}

.tcf-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tcf-header-logo {
    max-height: 40px;
    max-width: 200px;
    height: auto;
    width: auto;
    object-fit: contain;
    display: block;
}

.tcf-header-status {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.tcf-title {
    font-size: 1.25rem;
    font-weight: 500;
    margin: 0;
}

.tcf-title-link,
.tcf-title-link:link,
.tcf-title-link:visited,
.tcf-title-link:hover,
.tcf-title-link:active,
.tcf-title-link:focus {
    text-decoration: none !important;
    border-bottom: none !important;
    box-shadow: none !important;
}

.tcf-title-link:focus {
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
}

/* Mobile Theme Header Adjustments */
@media (max-width: 768px) {
    .tcf-theme-header-container {
        min-height: 60px;
        max-height: none; /* Allow Elementor headers to be taller on mobile too */
        overflow: visible; /* Allow Elementor content to show on mobile */
    }
    
    /* Hide unnecessary theme header elements on mobile */
    .tcf-theme-header-container .widget-area,
    .tcf-theme-header-container .sidebar,
    .tcf-theme-header-container .search-form,
    .tcf-theme-header-container .secondary-navigation,
    .tcf-theme-header-container .site-description {
        display: none !important;
    }
    
    /* Simplify theme header on mobile */
    .tcf-theme-header-container .site-title {
        font-size: 1.2rem;
    }
    
    .tcf-theme-header-container .primary-menu {
        display: none; /* Hide menu on mobile to save space */
    }
    
    body.tcf-exam-body.has-theme-header {
        padding-top: 100px; /* Increased for mobile Elementor headers */
    }
}

/* Mobile Custom Header Adjustments */
@media (max-width: 768px) {
    .tcf-header {
        padding: 0.5rem;
        flex-direction: column;
        height: auto;
        min-height: 60px;
    }
    
    .tcf-header-left {
        width: 100%;
        justify-content: center;
        order: 1;
        margin-bottom: 0.5rem;
    }
    
    .tcf-header-right {
        width: 100%;
        flex-direction: column;
        gap: 0.5rem;
        justify-content: center;
        align-items: center;
        order: 2;
    }
    
    .tcf-header-nav {
        gap: 1rem;
        flex-wrap: wrap;
        justify-content: center;
        order: 1;
    }
    
    .tcf-nav-link {
        font-size: 0.85rem;
        padding: 0.3rem 0.8rem;
    }
    
    .tcf-logo {
        margin-bottom: 0.3rem;
    }
    
    .tcf-header-logo {
        max-height: 30px;
        max-width: 150px;
    }
    
    .tcf-header-status {
        order: 2;
        justify-content: center;
        margin-top: 0.3rem;
    }
    
    .tcf-title {
        font-size: 1rem;
    }
    
    .audio-status span {
        display: none;
    }
    
    /* Adjust body padding for taller mobile header */
    body.tcf-exam-body {
        padding-top: 90px; /* Increased for taller mobile header with new layout */
    }
}

/* Container Styles */
.tcf-container {
    min-height: calc(100vh - 60px);
    padding: 0;
    overflow-y: auto;
    position: relative;
    max-width: 100%;
}

/* Modern Glass Effect Cards for CE Reading */
.reading-text-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    padding: 2rem;
    margin-bottom: 1.5rem;
    position: relative;
    overflow: hidden;
}

.reading-text-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--tcf-primary), var(--tcf-secondary));
    border-radius: 16px 16px 0 0;
}

.reading-text-card h4 {
    color: var(--tcf-primary);
    font-weight: 600;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.reading-text-card h4::before {
    content: '📖';
    font-size: 1rem;
}

.reading-text-content {
    line-height: 1.7;
    color: #2c3e50;
    /* Default font size - will be dynamically adjusted by JavaScript based on content length */
    font-size: 1rem;
    /* Smooth transition for dynamic font size changes */
    transition: font-size 0.3s ease, line-height 0.3s ease;
}

.reading-text-content p {
    margin-bottom: 1rem;
    /* Inherit dynamic font size from parent */
    font-size: inherit;
    line-height: inherit;
}

.reading-text-content ul, .reading-text-content ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.reading-text-content li {
    margin-bottom: 0.5rem;
}

.question-card {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(30, 87, 153, 0.1);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(30, 87, 153, 0.12);
    padding: 2rem;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.question-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #28a745, #20c997);
    border-radius: 16px 16px 0 0;
}

.question-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(30, 87, 153, 0.15);
}

.question-card h4 {
    color: #28a745;
    font-weight: 600;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.question-card h4::before {
    content: '\f059';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 1rem;
}

/* Mobile Responsive Adjustments for Glass Cards */
@media (max-width: 768px) {
    .reading-text-card,
    .question-card {
        padding: 1.5rem;
        border-radius: 12px;
        margin-bottom: 1rem;
    }
    
    .reading-text-card h4,
    .question-card h4 {
        font-size: 1rem;
    }
    
    /* Mobile: Allow dynamic sizing to work, but cap the maximum size */
    .reading-text-content:not([data-dynamic-sized]) {
        font-size: 0.95rem;
    }

    /* If dynamic sizing is applied, respect it with a mobile-friendly constraint */
    .reading-text-content[data-dynamic-sized] {
        /* JavaScript will handle sizing, but ensure it doesn't get too large on mobile */
        max-font-size: 18px;
    }
}

/* Exam Layout - Mobile Optimized */
.exam-layout {
    display: flex;
    gap: 20px;
    padding: 20px;
    min-height: calc(100vh - 60px);
    max-width: 1400px;
    margin: 0 auto;
}

.exam-main-content {
    flex: 1;
    min-width: 0;
}

.exam-sidebar {
    width: 280px;
    flex-shrink: 0;
    position: sticky;
    top: 20px;
    height: fit-content;
}

/* Mobile Layout */
@media (max-width: 991px) {
    /* CRITICAL: Force hide left sidebar on all mobile devices */
    .exam-left-sidebar,
    .tcf-exam-ce .exam-left-sidebar,
    .tcf-exam-co .exam-left-sidebar,
    #tcf-test-screen .exam-left-sidebar {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        height: 0 !important;
        width: 0 !important;
        overflow: hidden !important;
    }

    .exam-layout {
        flex-direction: column;
        padding: 10px;
        min-height: auto;
    }
    
    .exam-sidebar {
        width: 100%;
        position: static;
        margin-bottom: 20px;
    }
}

/* Mobile Sidebar Modal */
.exam-sidebar-mobile {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    max-width: 400px;
    height: 100vh;
    background: white;
    z-index: 1050;
    transition: right 0.3s ease;
    box-shadow: -2px 0 10px rgba(0,0,0,0.1);
    overflow-y: auto;
}

.exam-sidebar-mobile.show {
    right: 0;
}

@media (max-width: 768px) {
    .exam-sidebar-mobile {
        max-width: 100%;
    }
}

/* Mobile Sidebar Toggle */
.mobile-sidebar-toggle {
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--tcf-primary);
    color: white;
    border: none;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    z-index: 1040;
}

/* Force hide mobile sidebar toggle on all devices to prevent overlap with report icon */
.mobile-sidebar-toggle,
#mobile-sidebar-toggle,
button.mobile-sidebar-toggle.d-lg-none {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* Bottom Navigation */
.bottom-navigation {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid var(--tcf-border);
    padding: 8px 0;
    z-index: 1040; /* Higher z-index to ensure it's above other elements */
    display: none;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
}

@media (max-width: 768px) {
    .bottom-navigation {
        display: block;
    }
    
    body.tcf-exam-body {
        padding-bottom: 60px;
    }
}

.bottom-navigation .nav-button {
    flex: 1;
    background: none;
    border: none;
    padding: 8px;
    text-align: center;
    color: var(--tcf-dark);
    font-size: 0.75rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    -webkit-tap-highlight-color: transparent;
}

.bottom-navigation .nav-button:active {
    background: rgba(0,0,0,0.05);
    transform: scale(0.95);
}

.bottom-navigation .nav-button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.bottom-navigation .nav-button:not(:disabled):hover {
    background: rgba(0,0,0,0.03);
    color: var(--tcf-primary);
}

.bottom-navigation .nav-button i {
    font-size: 1.25rem;
}

.bottom-navigation .nav-button.active {
    color: var(--tcf-primary);
    background: rgba(30, 87, 153, 0.1);
}

/* Mobile Progress Bar */
.mobile-progress {
    position: fixed;
    top: 60px; /* Will be adjusted dynamically by JavaScript based on header height */
    left: 0;
    right: 0;
    height: 4px;
    background: rgba(0,0,0,0.1);
    z-index: 1020;
}

.mobile-progress-bar {
    height: 100%;
    background: var(--tcf-primary);
    transition: width 0.3s ease;
}

/* Choice Items - Touch Optimized */
.choice-item {
    padding: 15px;
    margin: 10px 0;
    border: 2px solid var(--tcf-border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    background: white;
    min-height: 60px; /* Larger touch target for mobile */
    position: relative;
}

.choice-item:not(.disabled):hover,
.choice-item:not(.disabled):active,
.choice-item.touch-active {
    border-color: var(--tcf-primary);
    background: var(--tcf-light);
}

.choice-item.selected {
    background: #e7f1ff;
    border-color: var(--tcf-primary);
}

.choice-item.disabled {
    opacity: 0.7;
    cursor: not-allowed;
    pointer-events: none;
}

.choice-item input[type="radio"] {
    margin-right: 10px;
    min-width: 20px;
    min-height: 20px;
}

.choice-item label {
    flex: 1;
    cursor: pointer;
    margin: 0;
    padding: 5px 0;
}

/* Mobile Choice Adjustments */
@media (max-width: 768px) {
    .choice-item {
        padding: 20px 15px;
        margin: 15px 0;
        font-size: 16px; /* Prevent zoom on iOS */
    }
}

/* Timer Display */
.countdown-timer {
    font-size: 2rem;
    font-weight: bold;
    text-align: center;
    color: var(--tcf-primary);
    margin: 20px 0;
}

.timer-section {
    background: var(--tcf-light);
    padding: 15px;
    border-radius: 8px;
    margin-top: 20px;
}

.timer-display {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--tcf-primary);
}

.timer-display.warning {
    color: var(--tcf-warning);
}

.timer-display.danger {
    color: var(--tcf-danger);
    animation: pulse 1s infinite;
}

/* Audio Status */
.audio-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(255,255,255,0.2);
    border-radius: 20px;
}

/* Question Navigation - Mobile Optimized */
.question-navigation {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    justify-content: flex-start;
    margin: 15px 0;
    padding: 12px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid var(--tcf-border);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.question-nav-btn {
    min-width: 48px;
    min-height: 48px;
    border-radius: 10px;
    border: 2px solid #e0e6ed;
    background: #ffffff;
    color: #495057 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    position: relative;
    flex-shrink: 0;
}

.question-nav-btn:hover {
    border-color: #6f42c1;
    background: #f8f6ff;
    color: #495057 !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(111, 66, 193, 0.15);
}

/* Current question - Purple gradient */
.question-nav-btn.current {
    background: linear-gradient(135deg, #6f42c1 0%, #5a35a3 100%);
    color: white !important;
    border-color: #6f42c1;
    font-weight: 700;
    box-shadow: 0 4px 16px rgba(111, 66, 193, 0.3);
}

.question-nav-btn.current:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 20px rgba(111, 66, 193, 0.4);
}

/* Answered questions - Green */
.question-nav-btn.answered {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white !important;
    border-color: #28a745;
    font-weight: 600;
}

.question-nav-btn.answered:hover {
    background: linear-gradient(135deg, #218838 0%, #1ba085 100%);
    color: white !important;
    border-color: #218838;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

/* Current + answered - Priority to current styling */
.question-nav-btn.answered.current {
    background: linear-gradient(135deg, #6f42c1 0%, #5a35a3 100%);
    color: white !important;
    border-color: #6f42c1;
    font-weight: 700;
    box-shadow: 0 0 0 3px rgba(111, 66, 193, 0.3), 0 4px 16px rgba(111, 66, 193, 0.3);
}

/* Mobile-specific improvements */
@media (max-width: 768px) {
    .question-navigation {
        gap: 0.2rem;
        padding: 8px 12px;
        margin: 8px 0;
        border-radius: 8px;
        background: rgba(248, 249, 250, 0.95);
        border: 1px solid #e9ecef;
        box-shadow: none;
    }
    
    .question-nav-btn {
        min-width: 36px;
        min-height: 36px;
        font-size: 0.85rem;
        border-radius: 6px;
        border: 1px solid #dee2e6;
        font-weight: 500;
    }
    
    .question-nav-btn.current {
        background: #0d6efd;
        border-color: #0d6efd;
        color: white !important;
        box-shadow: none;
    }
    
    .question-nav-btn.answered {
        background: #28a745;
        border-color: #28a745;
        color: white !important;
    }
    
    .question-nav-btn.answered.current {
        background: #0d6efd;
        border-color: #0d6efd;
        color: white !important;
    }
}

/* Extra small screens */
@media (max-width: 480px) {
    .question-navigation {
        gap: 0.15rem;
        padding: 6px 8px;
        justify-content: flex-start;
        margin: 6px 0;
    }
    
    .question-nav-btn {
        min-width: 32px;
        min-height: 32px;
        font-size: 0.8rem;
        border-radius: 4px;
        font-weight: 500;
    }
}

/* Large screens - more spacing */
@media (min-width: 1200px) {
    .question-navigation {
        gap: 0.6rem;
        padding: 16px;
    }
    
    .question-nav-btn {
        min-width: 52px;
        min-height: 52px;
        font-size: 1.1rem;
    }
}

/* Enhanced mobile navigation container */
.mobile-question-nav-container {
    position: static;
    background: transparent;
    padding: 4px 0;
    margin: 8px 0;
}

/* NEW: Improved Mobile Question Navigation Grid */
.mobile-nav-grid-wrapper {
    display: none !important;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    top: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1025;
    transition: opacity 0.3s ease;
    opacity: 0;
}

.mobile-nav-grid-wrapper.show {
    display: block !important;
    opacity: 1;
}

.mobile-nav-grid-wrapper .mobile-nav-content {
    position: absolute;
    bottom: 60px;
    left: 0;
    right: 0;
    background: white;
    border-top: 2px solid #dee2e6;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
    max-height: 60vh;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.mobile-nav-grid-wrapper.show .mobile-nav-content {
    transform: translateY(0);
}

.mobile-nav-grid-header {
    background: linear-gradient(135deg, #1e5799, #2989d8);
    color: white;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 10;
}

.mobile-nav-grid-title {
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.mobile-nav-grid-close {
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    min-height: 40px;
}

.mobile-nav-grid-close:hover {
    background: rgba(255,255,255,0.3);
    transform: scale(1.05);
}

.mobile-nav-grid-close:active {
    transform: scale(0.95);
}

.mobile-question-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
    padding: 16px;
    max-height: calc(60vh - 120px);
    overflow-y: auto;
    background: #f8f9fa;
}

/* For slightly larger phones */
@media (min-width: 400px) {
    .mobile-question-grid {
        grid-template-columns: repeat(7, 1fr);
    }
}

/* For very small phones */
@media (max-width: 360px) {
    .mobile-question-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 8px;
        padding: 12px;
    }
}

.mobile-question-grid .grid-nav-btn {
    width: 100%;
    aspect-ratio: 1;
    min-height: 48px;
    font-size: 15px;
    font-weight: 700;
    border-radius: 10px;
    border: 2px solid #dee2e6;
    background: white;
    color: #495057;
    transition: all 0.2s ease;
    position: relative;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-question-grid .grid-nav-btn:active {
    transform: scale(0.92);
}

.mobile-question-grid .grid-nav-btn.current {
    background: linear-gradient(135deg, #0d6efd, #0056b3);
    color: white;
    border-color: #0d6efd;
    box-shadow: 0 4px 12px rgba(13,110,253,0.35);
    animation: pulse-current 2s infinite;
}

@keyframes pulse-current {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.mobile-question-grid .grid-nav-btn.answered {
    background: #d4edda;
    border-color: #28a745;
    color: #155724;
    font-weight: 700;
}

.mobile-question-grid .grid-nav-btn.answered::after {
    content: '✓';
    position: absolute;
    top: 2px;
    right: 2px;
    background: #28a745;
    color: white;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.mobile-question-grid .grid-nav-btn.answered.current {
    background: linear-gradient(135deg, #0d6efd, #0056b3);
    border-color: #0d6efd;
    color: white;
}

/* Quick Actions Bar */
.mobile-nav-actions {
    background: white;
    border-top: 1px solid #dee2e6;
    padding: 12px;
    display: flex;
    gap: 10px;
    position: sticky;
    bottom: 0;
}

.mobile-nav-actions button {
    flex: 1;
    padding: 12px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.mobile-nav-actions .nav-btn-prev {
    background: #6c757d;
    color: white;
}

.mobile-nav-actions .nav-btn-prev:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.mobile-nav-actions .nav-btn-next {
    background: #0d6efd;
    color: white;
}

.mobile-nav-actions .nav-btn-next:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.mobile-nav-actions .nav-btn-submit {
    background: #28a745;
    color: white;
}

/* Floating Question Progress Indicator */
.mobile-question-progress {
    display: none;
    position: fixed;
    top: 70px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    padding: 10px 20px;
    border-radius: 25px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    z-index: 1020;
    align-items: center;
    gap: 15px;
    font-size: 14px;
    font-weight: 600;
}

.mobile-question-progress .progress-text {
    color: #1e5799;
}

.mobile-question-progress .progress-bar-mini {
    width: 80px;
    height: 6px;
    background: #e9ecef;
    border-radius: 3px;
    overflow: hidden;
}

.mobile-question-progress .progress-bar-mini-fill {
    height: 100%;
    background: linear-gradient(90deg, #1e5799, #2989d8);
    transition: width 0.3s ease;
    border-radius: 3px;
}

@media (max-width: 768px) {
    .mobile-question-nav-container {
        display: block;
    }
    
    /* Navigation header with current question info */
    .nav-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0 12px 4px;
        font-size: 0.8rem;
        color: #6c757d;
        font-weight: 500;
    }
    
    .nav-current-info {
        display: flex;
        align-items: center;
        gap: 8px;
    }
    
    .nav-progress {
        font-size: 0.75rem;
        color: #6c757d;
    }
    
    /* Hide old scrollable navigation on mobile - replaced with grid */
    .mobile-question-nav-container .question-navigation {
        display: none !important;
    }
    
    /* Show mobile progress and grid on small screens */
    .mobile-question-progress {
        display: flex !important;
    }
    
    .mobile-nav-grid-wrapper {
        display: block;
    }
    
    /* Scroll indicators */
    .nav-scroll-indicator {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        width: 20px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: linear-gradient(90deg, rgba(255,255,255,1) 0%, rgba(255,255,255,0) 100%);
        pointer-events: none;
        z-index: 2;
    }
    
    .nav-scroll-indicator.left {
        left: 0;
        background: linear-gradient(90deg, rgba(255,255,255,1) 0%, rgba(255,255,255,0) 100%);
    }
    
    .nav-scroll-indicator.right {
        right: 0;
        background: linear-gradient(-90deg, rgba(255,255,255,1) 0%, rgba(255,255,255,0) 100%);
    }
}

/* Force navigation title text to white */
.card-header.bg-primary h6,
.card-header.bg-primary h6 i,
.card-header.text-white h6,
.card-header.text-white h6 i {
    color: white !important;
}

/* Info Cards */
.info-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    text-align: center;
    transition: transform 0.2s ease;
}

.info-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* Test Info Grid - Mobile Responsive */
.test-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

@media (max-width: 768px) {
    .test-info {
        grid-template-columns: 1fr;
        gap: 15px;
        margin: 20px 0;
    }
}

/* User Info Fields - Improved Layout */
.user-info-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

@media (max-width: 768px) {
    .user-info-fields {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}

.form-group {
    display: flex;
    flex-direction: column;
}

/* Forms - Mobile Optimized */
.form-control {
    border-radius: 8px;
    border: 2px solid var(--tcf-border);
    padding: 0.75rem 1rem;
    transition: all 0.2s ease;
    font-size: 16px; /* Prevent zoom on iOS */
}

.form-control:focus {
    border-color: var(--tcf-primary);
    box-shadow: 0 0 0 0.2rem rgba(30,87,153,0.15);
    outline: none;
}

.form-label {
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--tcf-dark);
}

/* Buttons - Touch Optimized */
.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s ease;
    min-height: 44px; /* iOS touch target size */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border: none;
    cursor: pointer;
}

.btn-primary {
    background: var(--tcf-primary);
    color: white;
}

.btn-primary:hover,
.btn-primary:active {
    background: var(--tcf-secondary);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--tcf-light);
    color: var(--tcf-dark);
    border: 1px solid var(--tcf-border);
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.125rem;
    min-height: 56px;
}

/* Student Info Display */
.student-info {
    padding: 15px 0;
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--tcf-border);
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    font-weight: 500;
    color: #666;
}

/* Results Screen */
.score-card {
    text-align: center;
    padding: 2rem 0;
}

.score-number {
    font-size: 4rem;
    font-weight: 700;
    color: var(--tcf-primary);
    margin: 2rem 0;
    animation: scoreIn 0.5s ease-out;
}

.level-indicator {
    display: inline-block;
    padding: 0.75rem 2rem;
    background: linear-gradient(45deg, var(--tcf-primary), var(--tcf-secondary));
    color: white;
    border-radius: 30px;
    font-size: 1.5rem;
    font-weight: 500;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

/* Review Section */
.review-question {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    margin-bottom: 20px;
    overflow: hidden;
}

.review-question-header {
    background: var(--tcf-light);
    padding: 15px;
    border-bottom: 1px solid var(--tcf-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.review-content {
    padding: 20px;
}

.question-text {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 20px;
}

.points-display {
    color: #666;
    font-size: 0.9rem;
}

/* Review Answer Status */
.choice-item.border-success {
    border-color: var(--tcf-success) !important;
    background: rgba(40, 167, 69, 0.05);
}

.choice-item.border-danger {
    border-color: var(--tcf-danger) !important;
    background: rgba(220, 53, 69, 0.05);
}

/* Audio Controls - Mobile Optimized */
audio {
    width: 100%;
    max-width: 400px;
    height: 40px;
}

.review-audio {
    padding: 8px 16px;
    border-radius: 20px;
    background: var(--tcf-primary);
    color: white;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 40px;
}

.review-audio:hover {
    background: var(--tcf-secondary);
}

/* Test Duration Info */
.test-duration-info {
    background: var(--tcf-light);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.test-duration-info h5 {
    color: var(--tcf-primary);
    margin-bottom: 15px;
}

.test-duration-info p {
    margin-bottom: 10px;
}

.test-duration-info ul {
    margin-top: 10px;
    padding-left: 20px;
}

/* Animations */
@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.6; }
    100% { opacity: 1; }
}

@keyframes scoreIn {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Loading States */
.spinner-border {
    width: 1.5rem;
    height: 1.5rem;
    border: 0.2em solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spinner-border 0.75s linear infinite;
}

.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

@keyframes spinner-border {
    to { transform: rotate(360deg); }
}

/* Alert Styles */
.alert {
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    border-radius: 8px;
    position: relative;
}

.alert-info {
    color: #0c5460;
    background-color: #d1ecf1;
    border-color: #bee5eb;
}

.alert-danger {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

.alert-dismissible {
    padding-right: 3rem;
}

.btn-close {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 2;
    padding: 1rem;
    background: none;
    border: none;
    opacity: 0.5;
    cursor: pointer;
}

.btn-close:hover {
    opacity: 0.75;
}

/* Responsive Typography */
@media (max-width: 768px) {
    .countdown-timer {
        font-size: 1.75rem;
    }
    
    .score-number {
        font-size: 3rem;
    }
    
    .level-indicator {
        font-size: 1.25rem;
        padding: 0.5rem 1.5rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    h3 {
        font-size: 1.25rem;
    }
    
    h5 {
        font-size: 1rem;
    }
    
    .question-text {
        font-size: 1rem;
    }
}

/* Accessibility Improvements */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}

/* Focus Styles */
*:focus {
    outline: 2px solid var(--tcf-primary);
    outline-offset: 2px;
}

button:focus,
a:focus {
    outline-offset: 3px;
}

/* Print Styles */
@media print {
    .tcf-header,
    .tcf-navigation,
    .bottom-navigation,
    .mobile-sidebar-toggle,
    .btn,
    .timer-section,
    audio,
    .review-audio,
    #restart-test,
    #print-results {
        display: none !important;
    }
    
    .tcf-container {
        height: auto;
        margin-top: 0;
        padding: 20px !important;
    }
    
    .exam-layout {
        display: block;
    }
    
    .choice-item,
    .review-question {
        break-inside: avoid;
    }
    
    .score-card {
        page-break-after: always;
    }
}

/* CO Practice Mode Navigation Buttons */
#co-practice-nav-desktop,
#co-practice-nav-mobile,
#co-practice-submit-container {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#co-practice-submit-container .btn-success {
    padding: 15px 40px;
    font-size: 18px;
    font-weight: 600;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
    transition: all 0.3s ease;
}

#co-practice-submit-container .btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
}

/* Utility Classes */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.text-muted { color: #6c757d; }
.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mt-5 { margin-top: 3rem; }
.ms-2 { margin-left: 0.5rem; }
.me-2 { margin-right: 0.5rem; }
.p-3 { padding: 1rem; }
.p-4 { padding: 1.5rem; }
.py-4 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.py-5 { padding-top: 3rem; padding-bottom: 3rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 1rem; }
.d-flex { display: flex; }
.d-grid { display: grid; }
.d-block { display: block; }
.d-inline { display: inline; }
.d-inline-block { display: inline-block; }
.align-items-center { align-items: center; }
.justify-content-center { justify-content: center; }
.justify-content-between { justify-content: space-between; }
.flex-fill { flex: 1; }
.w-100 { width: 100%; }
.d-none { display: none !important; }
.position-fixed { position: fixed; }
.position-relative { position: relative; }
.position-absolute { position: absolute; }
.top-0 { top: 0; }
.start-0 { left: 0; }
.bg-light { background-color: var(--tcf-light); }
.bg-primary { background-color: var(--tcf-primary); }
.bg-success { background-color: var(--tcf-success); }
.bg-danger { background-color: var(--tcf-danger); }
.bg-warning { background-color: var(--tcf-warning); }
.bg-info { background-color: #17a2b8; }
.text-primary { color: var(--tcf-primary); }
.text-success { color: var(--tcf-success); }
.text-danger { color: var(--tcf-danger); }
.text-white { color: white; }
.border { border: 1px solid var(--tcf-border); }
.border-0 { border: 0; }
.border-top { border-top: 1px solid var(--tcf-border); }
.border-bottom { border-bottom: 1px solid var(--tcf-border); }
.border-success { border-color: var(--tcf-success); }
.border-danger { border-color: var(--tcf-danger); }
.rounded { border-radius: 0.25rem; }
.shadow { box-shadow: 0 0.5rem 1rem rgba(0,0,0,0.15); }
.shadow-sm { box-shadow: 0 0.125rem 0.25rem rgba(0,0,0,0.075); }
.row { display: flex; flex-wrap: wrap; margin-right: -0.75rem; margin-left: -0.75rem; }
.col-6 { flex: 0 0 50%; max-width: 50%; padding-right: 0.75rem; padding-left: 0.75rem; }
.col-md-6 { flex: 0 0 50%; max-width: 50%; padding-right: 0.75rem; padding-left: 0.75rem; }
.badge { display: inline-block; padding: 0.25em 0.6em; font-size: 0.75em; font-weight: 700; line-height: 1; text-align: center; white-space: nowrap; vertical-align: baseline; border-radius: 0.25rem; }
.card { position: relative; display: flex; flex-direction: column; min-width: 0; word-wrap: break-word; background-color: #fff; background-clip: border-box; border: 1px solid rgba(0,0,0,0.125); border-radius: 0.25rem; }
.card-body { flex: 1 1 auto; padding: 1.25rem; }
.card-header { padding: 0.75rem 1.25rem; margin-bottom: 0; background-color: rgba(0,0,0,0.03); border-bottom: 1px solid rgba(0,0,0,0.125); }
.fade { transition: opacity 0.15s linear; }
.show { display: block !important; }
.container { width: 100%; padding-right: 15px; padding-left: 15px; margin-right: auto; margin-left: auto; }

@media (min-width: 576px) {
    .container { max-width: 540px; }
}
@media (min-width: 768px) {
    .container { max-width: 720px; }
    .d-md-none { display: none !important; }
    .d-md-block { display: block !important; }
}
/* Mobile/Tablet - hide lg-block elements */
@media (max-width: 991px) {
    .d-lg-block { display: none !important; }
    .d-lg-none { display: block !important; }

    /* CRITICAL: Extra specific rule for left sidebar on mobile */
    .exam-left-sidebar.d-lg-block,
    div.exam-left-sidebar.d-none.d-lg-block {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
    }

    /* CRITICAL: Hide question navigation grid on mobile */
    .question-navigation,
    #question-navigation,
    div.question-navigation {
        display: none !important;
        visibility: hidden !important;
    }

    /* CRITICAL: Hide desktop navigation buttons on mobile */
    #desktop-prev-question,
    #desktop-next-question,
    #desktop-question-current,
    #desktop-question-total {
        display: none !important;
    }
}

@media (min-width: 992px) {
    .container { max-width: 960px; }
    .d-lg-none { display: none !important; }
    .d-lg-block { display: block !important; }
}
@media (min-width: 1200px) {
    .container { max-width: 1140px; }
}

/* TCF Results Page Styling */
.tcf-results-container {
    width: 100%;
    max-width: 100%;
    padding: 1rem;
    box-sizing: border-box;
}

/* Hide old level indicators to prevent flash before chart replacement */
.tcf-results-container .level-indicator:not(.tcf-processed),
.tcf-results-container .nclc-level-indicator:not(.tcf-processed),
#level-indicator:not(.tcf-processed) {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
}

/* Smooth fade-in for modern charts */
.modern-level-chart {
    animation: tcf-chart-fade-in 0.3s ease-in-out;
}

@keyframes tcf-chart-fade-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tcf-results-container .score-number {
    font-size: 4rem !important;
    font-weight: bold !important;
    color: #007bff !important;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

/* Mobile Results Container */
@media (max-width: 768px) {
    .tcf-results-container {
        width: 100% !important;
        max-width: 100% !important;
        padding: 0.75rem !important;
        margin: 0 !important;
    }

    .tcf-results-container .score-card {
        padding: 1.5rem 0.5rem !important;
        width: 100% !important;
    }

    .tcf-results-container .review-section {
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 !important;
        margin-top: 2rem !important;
    }

    .tcf-results-container .review-section h3 {
        font-size: 1.3rem !important;
        padding: 0 0.5rem 0.5rem !important;
    }
}

.tcf-results-container .level-indicator {
    font-size: 1.5rem !important;
    margin-bottom: 1rem !important;
    color: white !important;
    font-weight: 500;
}

.tcf-results-container .nclc-level-indicator {
    font-size: 1.5rem !important;
    color: white !important;
    margin-bottom: 1rem !important;
    font-weight: 500;
}

.tcf-results-container .review-section h3 {
    border-bottom: 2px solid #007bff;
    padding-bottom: 0.5rem;
    margin-bottom: 2rem;
}

.tcf-results-container .stats .card {
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    border: none;
    border-radius: 15px !important;
}

.tcf-results-container .stats .card .card-body {
    padding: 0.75rem 1rem !important;
}

.tcf-results-container .stats .card h5 {
    color: white !important;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.tcf-results-container .stats .card h3 {
    color: white !important;
    font-size: 2.2rem;
    font-weight: 700;
    margin: 0;
}

.tcf-results-container .text-center .btn {
    margin: 0.25rem !important;
    display: inline-block;
}

/* Enhanced styling for congratulations and practice cards */
.tcf-results-container .tcf-passed-card {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%) !important;
    border: 1px solid #c3e6cb !important;
    color: #155724 !important;
    padding: 1.25rem 1.5rem !important;
    border-radius: 15px !important;
    margin: 30px 0 !important;
    box-shadow: 0 4px 12px rgba(21, 87, 36, 0.15);
}

.tcf-results-container .tcf-failed-card {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%) !important;
    border: 1px solid #f5c6cb !important;
    color: #721c24 !important;
    padding: 1.25rem 1.5rem !important;
    border-radius: 15px !important;
    margin: 30px 0 !important;
    box-shadow: 0 4px 12px rgba(114, 28, 36, 0.15);
}

.tcf-results-container .tcf-passed-card h3,
.tcf-results-container .tcf-failed-card h3 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-align: center;
}

.tcf-results-container .tcf-passed-card p,
.tcf-results-container .tcf-failed-card p {
    font-size: 1.1rem;
    line-height: 1.5;
    margin-bottom: 0;
    text-align: center;
    padding-bottom: 0;
}

/* Question Review Styling */
.tcf-questions-review .review-question {
    margin-bottom: 2rem;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    padding: 1rem;
    background-color: #fff;
    width: 100%;
    max-width: 100%;
}

.tcf-questions-review .review-question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #dee2e6;
}

.tcf-questions-review .review-content {
    margin-top: 1rem;
    width: 100%;
}

/* Mobile specific adjustments for results review */
@media (max-width: 768px) {
    .tcf-questions-review {
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    .tcf-questions-review .review-question {
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding: 1rem !important;
        border-radius: 0.5rem !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    .tcf-questions-review .review-question-header {
        flex-direction: row;
        gap: 0.5rem;
        padding: 0.75rem;
        margin-bottom: 0.75rem;
    }

    .tcf-questions-review .review-question-header h5 {
        font-size: 1.1rem;
        margin: 0;
    }

    .tcf-questions-review .review-content {
        padding: 0 !important;
        width: 100% !important;
    }

    .tcf-questions-review .question-text {
        font-size: 1rem !important;
        line-height: 1.6 !important;
        margin-bottom: 1rem !important;
        width: 100% !important;
    }

    .tcf-questions-review .reading-text-card {
        width: 100% !important;
        max-width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding: 1rem !important;
        box-sizing: border-box !important;
    }

    .tcf-questions-review .reading-text-content {
        width: 100% !important;
        font-size: 1rem !important;
        line-height: 1.6 !important;
    }

    .tcf-questions-review .choices-list {
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }
}

.tcf-questions-review .reading-text-card {
    background-color: #f8f9fa;
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    border-left: 4px solid #007bff;
}

.tcf-questions-review .reading-text-card h6 {
    color: #007bff;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.tcf-questions-review .reading-text-content p,
.reading-text-content p {
    margin-bottom: 1rem;
    line-height: 1.6;
}

.tcf-questions-review .reading-text-content p:last-child,
.reading-text-content p:last-child {
    margin-bottom: 0;
}

/* Ensure proper paragraph spacing in reading text cards */
.reading-text-card .reading-text-content p {
    margin-bottom: 1rem;
    line-height: 1.6;
}

.reading-text-card .reading-text-content p:last-child {
    margin-bottom: 0;
}

.tcf-questions-review .choice-item {
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    border: 2px solid #dee2e6;
    border-radius: 0.375rem;
    background-color: #f8f9fa;
    transition: all 0.2s ease;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* Mobile adjustments for choice items in review */
@media (max-width: 768px) {
    .tcf-questions-review .choice-item {
        padding: 1rem !important;
        margin-bottom: 0.75rem !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        font-size: 1rem !important;
        line-height: 1.5 !important;
        width: 100% !important;
        max-width: 100% !important;
        display: flex !important;
        align-items: flex-start !important;
        gap: 0.5rem !important;
    }

    .tcf-questions-review .choice-item i {
        font-size: 1rem !important;
        margin-top: 0.1rem;
        flex-shrink: 0;
    }
}

.tcf-questions-review .choice-item.border-success {
    border-color: #198754 !important;
    background-color: #d1e7dd;
}

.tcf-questions-review .choice-item.border-danger {
    border-color: #dc3545 !important;
    background-color: #f8d7da;
}

.tcf-questions-review .choice-item i {
    font-size: 0.9rem;
}

/* Badge Styling */
.badge {
    display: inline-block;
    padding: 0.35em 0.65em;
    font-size: 0.75em;
    font-weight: 700;
    line-height: 1;
    color: #fff;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 0.25rem;
}

.badge.bg-success {
    background-color: #198754 !important;
}

.badge.bg-danger {
    background-color: #dc3545 !important;
}

.badge.bg-warning {
    background-color: #ffc107 !important;
    color: #000 !important;
}

/* Post-Result Upsell Banner (prominent) */
.tcf-upsell-banner {
    background: linear-gradient(135deg, #e0f7fa 0%, #b2ebf2 100%);
    border: 1px solid #b2ebf2;
    border-left: 5px solid #17a2b8;
    border-radius: 15px;
    padding: 1.5rem 2rem;
    margin: 30px 0;
    text-align: center;
    box-shadow: 0 4px 12px rgba(23, 162, 184, 0.15);
}

.tcf-upsell-banner h3 {
    color: #0c5460;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 0.75rem 0;
}

.tcf-upsell-banner p {
    color: #155f6d;
    font-size: 1.05rem;
    line-height: 1.6;
    margin: 0 0 1.25rem 0;
}

.tcf-upsell-btn {
    display: inline-block;
    background-color: #17a2b8;
    color: #fff !important;
    padding: 0.65rem 2rem;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none !important;
    transition: all 0.25s ease;
    box-shadow: 0 2px 8px rgba(23, 162, 184, 0.3);
}

.tcf-upsell-btn:hover {
    background-color: #138496;
    color: #fff !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(23, 162, 184, 0.4);
    text-decoration: none !important;
}

/* Post-Result Upsell Subtle (bottom bar) */
.tcf-upsell-subtle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 0.75rem 1.25rem;
    margin-top: 1rem;
}

.tcf-upsell-subtle span {
    color: #6c757d;
    font-size: 0.95rem;
}

.tcf-upsell-subtle a {
    color: #17a2b8;
    font-weight: 600;
    text-decoration: none;
    font-size: 0.95rem;
    white-space: nowrap;
}

.tcf-upsell-subtle a:hover {
    color: #138496;
    text-decoration: underline;
}

/* Upsell responsive */
@media (max-width: 768px) {
    .tcf-upsell-banner {
        padding: 1.25rem 1rem;
        margin: 20px 0;
    }

    .tcf-upsell-banner h3 {
        font-size: 1.25rem;
    }

    .tcf-upsell-banner p {
        font-size: 0.95rem;
    }

    .tcf-upsell-subtle {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
        padding: 0.75rem 1rem;
    }
}