/* Section Choice - Hidden by default until mode is selected */
#sectionChoice {
    display: grid;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.4s ease-in-out;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin: 24px 0 2rem 0;
    padding: 1rem;
    background: #fff;
    border-radius: 8px;
    width: 100%;
    box-sizing: border-box;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

/* Show section choice when .show class is added */
#sectionChoice.show {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
    animation: fadeInUp 0.4s ease-in-out;
}

/* Fade in animation for smooth appearance */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Warning Card Styles */
.warning-card {
    grid-column: 1 / -1; /* Span across all columns */
    background: linear-gradient(135deg, #fff3cd 0%, #ffeeba 100%);
    border: 2px solid #ffc107;
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    margin-bottom: 1rem;
    box-shadow: 0 4px 15px rgba(255, 193, 7, 0.2);
}

.warning-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
}

.warning-icon {
    font-size: 2.5rem;
    color: #ff8c00;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.warning-card h3 {
    color: #856404;
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0;
}

.warning-card p {
    color: #856404;
    font-size: 0.9rem;
    margin: 0;
    line-height: 1.4;
}

.warning-btn {
    background: linear-gradient(135deg, #ffc107, #e0a800);
    color: #212529;
    border: none;
    border-radius: 8px;
    padding: 0.6rem 1.5rem;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(255, 193, 7, 0.3);
}

.warning-btn:hover {
    background: linear-gradient(135deg, #e0a800, #d39e00);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 193, 7, 0.4);
}

/* When 4 cards are present in section choice, adjust grid for better layout */
#sectionChoice.show:has(.section-card.fulltest) {
    grid-template-columns: repeat(2, 1fr);
}

@supports not selector(:has(*)) {
    /* Fallback for browsers that don't support :has() */
    #sectionChoice.show {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Body & Container */
* {
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
}

body {
    background: var(--light-gray);
    margin: 0;
    font-family: 'Poppins', Arial, sans-serif;
    color: var(--text-color);
    line-height: 1.5;
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
}

.test-mode-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 1rem;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 4px 24px rgba(36,113,243,0.06);
    width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
}

/* Remove underlines from all links */
a {
    text-decoration: none;
}

a:hover {
    text-decoration: none;
}

/* Header Section */
.test-header {
    background: var(--sidebar-bg);
    color: #fff;
    padding: 1.5rem 0;
    text-align: center;
    border-radius: 0 0 20px 20px;
    margin-bottom: 2rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.test-header h1 {
    font-size: 1.8rem;
    font-weight: 600;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.test-header .desc {
    font-size: 1rem;
    opacity: 0.9;
    margin: 0.5rem 0;
}

.test-header .meta {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    font-size: 0.9rem;
    opacity: 0.9;
    flex-wrap: wrap;
}

.test-header .meta i {
    margin-right: 0.3rem;
}

/* Instructions Card */
.instructions-card {
    background: white;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    padding: 2rem;
    margin-bottom: 2rem;
    border: 1px solid #e9ecef;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.instructions-card h2 {
    color: var(--primary-color);
    font-size: 1.3rem;
    margin-bottom: 1rem;
    font-weight: 600;
    text-align: center;
}

.instructions-card h3 {
    color: var(--primary-color);
    font-size: 1.1rem;
    margin: 1.5rem 0 0.8rem 0;
    font-weight: 600;
}

.instructions-card p, .instructions-card li {
    color: var(--text-color);
    line-height: 1.6;
    margin-bottom: 0.5rem;
}

.instructions-card ul {
    margin: 0.8rem 0;
    padding-left: 1.5rem;
}

.instructions-card ul li {
    margin-bottom: 0.5rem;
}

/* Section Cards Row */
.sections-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* When 4 cards are present, adjust grid for better layout */
.sections-row:has(.section-card.fulltest) {
    grid-template-columns: repeat(2, 1fr);
}

@supports not selector(:has(*)) {
    /* Fallback for browsers that don't support :has() */
    .sections-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

.section-card {
    background: white;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    padding: 1.8rem;
    text-align: center;
    border: 1px solid #e9ecef;
    border-top: 4px solid var(--primary-color);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    min-height: 280px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.section-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(106, 130, 251, 0.15);
    border-color: var(--primary-color);
}

.section-card .icon {
    font-size: 2.3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    display: block;
}

.section-card h2 {
    color: var(--primary-color);
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
}

.section-card p {
    color: var(--text-color);
    font-size: 0.85rem;
    margin-bottom: 1rem;
    line-height: 1.4;
    flex-grow: 1;
}

.section-card .meta {
    color: #6c757d;
    font-size: 0.8rem;
    margin-bottom: 1.2rem;
}

.section-card .start-btn {
    background: var(--primary-gradient);
    color: white !important;
    border: none;
    border-radius: 20px;
    padding: 0.7rem 1.5rem;
    width: 100%;
    max-width: 180px;
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(106, 130, 251, 0.3);
    margin: 0 auto;
    text-decoration: none;
    display: inline-block;
}

.section-card .start-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(106, 130, 251, 0.4);
    color: white !important;
}

/* Full Test Card - Legacy styles for backward compatibility */
.fulltest-card {
    display: none; /* Hide old fulltest-card if any remains */
}

/* Full Test Section Card - appears with other sections */
.section-card.fulltest {
    border-top: 4px solid #ff6b35; /* Orange border to differentiate */
    background: linear-gradient(135deg, #fff 0%, #fff9f6 100%);
}

.section-card.fulltest .icon {
    color: #ff6b35;
}

.section-card.fulltest h2 {
    color: #ff6b35;
}

.section-card.fulltest .start-btn {
    background: linear-gradient(135deg, #ff6b35, #e55a2b);
    border: none;
    color: white !important;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.3);
}

.section-card.fulltest .start-btn:hover {
    background: linear-gradient(135deg, #e55a2b, #cc4e24);
    box-shadow: 0 6px 20px rgba(255, 107, 53, 0.4);
    color: white !important;
}

/* Back Button */
.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, #dc3545, #c82333);
    color: white;
    border: none;
    border-radius: 25px;
    padding: 0.8rem 2rem;
    font-weight: 500;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    margin: 2rem auto 0 auto;
    display: block;
    width: fit-content;
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.3);
}

.btn-back:hover {
    background: linear-gradient(135deg, #c82333, #a02834);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(220, 53, 69, 0.4);
    color: white;
    text-decoration: none;
}

.btn-back i {
    font-size: 0.9rem;
}

/* Extra Small Mobile (320px - 480px) */
@media (max-width: 480px) {
    .test-mode-container {
        padding: 0 0.5rem 15px 0.5rem;
        margin: 0;
        width: 100vw;
        max-width: 100vw;
        min-height: 100vh;
        border-radius: 0;
    }
    
    .test-header {
        padding: 0.8rem 0.5rem;
        margin-bottom: 0.8rem;
        border-radius: 0;
    }
    
    .test-header h1 {
        font-size: 1.1rem;
        line-height: 1.2;
        margin-bottom: 0.3rem;
    }
    
    .test-header .desc {
        font-size: 0.75rem;
        margin: 0.2rem 0;
    }
    
    .test-header .meta {
        flex-direction: row;
        gap: 0.8rem;
        font-size: 0.65rem;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .instructions-card {
        padding: 0.8rem;
        margin-bottom: 0.8rem;
        border-radius: 8px;
    }
    
    .instructions-card h2 {
        font-size: 0.9rem;
        margin-bottom: 0.5rem;
    }
    
    .instructions-card h3 {
        font-size: 0.8rem;
        margin: 0.6rem 0 0.4rem 0;
    }
    
    .instructions-card p, .instructions-card li {
        font-size: 0.7rem;
        line-height: 1.3;
        margin-bottom: 0.3rem;
    }
    
    .instructions-card ul {
        padding-left: 1rem;
        margin: 0.4rem 0;
    }
    
    .sections-row {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 0.8rem;
        margin-bottom: 0.8rem;
        width: 100%;
    }
    
    /* Section Choice responsive for small mobile */
    #sectionChoice.show {
        grid-template-columns: 1fr !important;
        gap: 0.8rem !important;
        margin: 16px 0 0.8rem 0 !important;
        padding: 0.8rem !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
    
    .section-card {
        padding: 1rem;
        border-radius: 10px;
        text-align: center;
        min-height: 180px;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
    }
    
    .section-card .icon {
        font-size: 1.4rem;
        margin-bottom: 0.5rem;
    }
    
    .section-card h2 {
        font-size: 0.85rem;
        line-height: 1.2;
        margin-bottom: 0.4rem;
    }
    
    .section-card p {
        font-size: 0.7rem;
        line-height: 1.3;
        margin-bottom: 0.5rem;
        flex-grow: 1;
        overflow: visible;
    }
    
    .section-card .meta {
        font-size: 0.65rem;
        margin-bottom: 0.6rem;
    }
    
    .section-card .start-btn {
        width: 100%;
        padding: 0.7rem 0.5rem;
        font-size: 0.75rem;
        border-radius: 10px;
        min-height: 40px;
        background: var(--primary-gradient) !important;
        color: white !important;
        border: none !important;
        box-shadow: 0 3px 10px rgba(36, 113, 243, 0.3) !important;
        text-decoration: none !important;
        display: block;
        margin: 0 auto;
    }
    
    .section-card.fulltest {
        min-height: 200px !important;
    }
    
    .section-card.fulltest .start-btn {
        background: linear-gradient(135deg, #ff6b35, #e55a2b) !important;
        color: white !important;
        box-shadow: 0 3px 10px rgba(255, 107, 53, 0.3) !important;
    }
    
    .section-card .start-btn:hover {
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(36, 113, 243, 0.4) !important;
        color: white !important;
    }
    
    .section-card.fulltest .start-btn:hover {
        box-shadow: 0 4px 12px rgba(255, 107, 53, 0.4) !important;
        color: white !important;
    }
    
    .btn-back {
        background: linear-gradient(135deg, #dc3545, #c82333) !important;
        color: white !important;
        width: 100%;
        padding: 0.7rem 0.5rem;
        font-size: 0.7rem;
        border-radius: 10px;
        min-height: 40px;
        margin: 1.2rem auto 0 auto;
        display: block;
        text-align: center;
        box-shadow: 0 3px 10px rgba(220, 53, 69, 0.3);
        text-decoration: none;
    }
    
    .btn-back:hover {
        background: linear-gradient(135deg, #c82333, #a02834) !important;
        color: white !important;
        box-shadow: 0 4px 12px rgba(220, 53, 69, 0.4);
        text-decoration: none;
    }
}

/* Mobile First: Single column, optimal touch target, font-size, padding */
@media (max-width: 767.98px) {
    body {
        overflow-x: hidden;
        width: 100vw;
        max-width: 100vw;
    }
    
    .test-mode-container {
        padding: 0 0.6rem 20px 0.6rem;
        max-width: 100vw;
        width: 100vw;
        border-radius: 0;
        box-shadow: none;
        margin: 0;
        overflow-x: hidden;
        box-sizing: border-box;
        min-height: 100vh;
    }
    
    .test-header {
        padding: 1rem 0.6rem;
        margin-bottom: 1rem;
        border-radius: 0;
        width: 100%;
        box-sizing: border-box;
    }
    
    .test-header h1 {
        font-size: 1.2rem;
        margin-bottom: 0.4rem;
        line-height: 1.2;
    }
    
    .test-header .desc {
        font-size: 0.8rem;
        margin: 0.3rem 0;
    }
    
    .test-header .meta {
        gap: 0.8rem;
        font-size: 0.7rem;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .instructions-card {
        padding: 1rem;
        margin-bottom: 1rem;
        border-radius: 10px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    .instructions-card h2 {
        font-size: 1rem;
        margin-bottom: 0.6rem;
    }
    
    .instructions-card h3 {
        font-size: 0.9rem;
        margin: 0.8rem 0 0.5rem 0;
    }
    
    .instructions-card p, .instructions-card li {
        font-size: 0.8rem;
        line-height: 1.4;
        margin-bottom: 0.3rem;
    }
    
    .instructions-card ul {
        padding-left: 1.2rem;
        margin: 0.5rem 0;
    }
    
    .sections-row {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 1rem;
        margin-bottom: 1rem;
        width: 100%;
    }
    
    /* Section Choice responsive for mobile 767.98px */
    #sectionChoice.show {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
        margin: 20px 0 1rem 0 !important;
        padding: 1rem !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
    
    .section-card {
        padding: 1.2rem;
        border-radius: 12px;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box;
        text-align: center;
        min-height: 200px;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
    }
    
    .section-card .icon {
        font-size: 1.6rem;
        margin-bottom: 0.6rem;
        display: block;
    }
    
    .section-card h2 {
        font-size: 1rem;
        margin-bottom: 0.5rem;
        line-height: 1.2;
    }
    
    .section-card p {
        font-size: 0.8rem;
        margin-bottom: 0.6rem;
        line-height: 1.4;
        flex-grow: 1;
        overflow: visible;
    }
    
    .section-card .meta {
        font-size: 0.75rem;
        margin-bottom: 0.8rem;
    }
    
    .section-card .start-btn {
        padding: 0.8rem 0.6rem;
        font-size: 0.8rem;
        border-radius: 12px;
        width: 100%;
        box-sizing: border-box;
        min-height: 44px;
        display: block;
        margin: 0 auto;
        background: var(--primary-gradient) !important;
        color: white !important;
        border: none !important;
        box-shadow: 0 3px 12px rgba(36, 113, 243, 0.3) !important;
        text-decoration: none !important;
    }
    
    /* Special styling for fulltest card in mobile 767.98px */
    .section-card.fulltest {
        min-height: 220px !important;
    }
    
    .section-card.fulltest .start-btn {
        background: linear-gradient(135deg, #ff6b35, #e55a2b) !important;
        color: white !important;
        box-shadow: 0 3px 12px rgba(255, 107, 53, 0.3) !important;
    }
    
    .section-card .start-btn:hover {
        transform: translateY(-1px);
        box-shadow: 0 4px 15px rgba(36, 113, 243, 0.4) !important;
        color: white !important;
    }
    
    .section-card.fulltest .start-btn:hover {
        box-shadow: 0 4px 15px rgba(255, 107, 53, 0.4) !important;
        color: white !important;
    }
    
    .btn-back {
        background: linear-gradient(135deg, #dc3545, #c82333) !important;
        color: white !important;
        padding: 0.8rem 0.6rem;
        font-size: 0.8rem;
        border-radius: 12px;
        margin: 1.5rem auto 0 auto;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        min-height: 44px;
        display: block;
        text-align: center;
        text-decoration: none;
        box-shadow: 0 3px 12px rgba(220, 53, 69, 0.3);
    }
    
    .btn-back:hover {
        background: linear-gradient(135deg, #c82333, #a02834) !important;
        color: white !important;
        box-shadow: 0 4px 15px rgba(220, 53, 69, 0.4);
        text-decoration: none;
    }
}

/* Tablet Responsive (768px - 1024px) */
@media (min-width: 768px) and (max-width: 1024px) {
    .test-mode-container {
        padding: 0 1.5rem 30px 1.5rem;
        max-width: 100%;
        width: 100%;
        border-radius: 16px;
        box-sizing: border-box;
        overflow-x: hidden;
    }
    
    .test-header {
        padding: 2rem 1.5rem;
        margin-bottom: 2rem;
        border-radius: 0 0 24px 24px;
    }
    
    .test-header h1 {
        font-size: 1.8rem;
    }
    
    .instructions-card {
        padding: 2rem;
        margin-bottom: 2rem;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    .sections-row {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 1.5rem;
        margin-bottom: 2rem;
        width: 100%;
        max-width: 100%;
    }
    
    /* Section Choice responsive for tablet */
    #sectionChoice.show {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
        margin: 24px 0 2rem 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
    
    .section-card {
        padding: 1.75rem;
        border-radius: 12px;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box;
        min-height: 200px;
    }
    
    .section-card .icon {
        font-size: 2rem;
        margin-bottom: 0.8rem;
    }
    
    .section-card h2 {
        font-size: 1.2rem;
        margin-bottom: 0.6rem;
    }
    
    .section-card p {
        font-size: 0.95rem;
        margin-bottom: 0.8rem;
        line-height: 1.4;
    }
    
    .section-card .meta {
        font-size: 0.85rem;
        margin-bottom: 1rem;
    }
    
    .section-card .start-btn {
        padding: 0.8rem 1.2rem;
        font-size: 0.9rem;
        min-height: 45px;
        max-width: 250px;
        background: var(--primary-gradient) !important;
        color: white !important;
        border: none !important;
        text-decoration: none !important;
    }
    
    .section-card.fulltest {
        min-height: 220px !important;
    }
    
    .section-card.fulltest .start-btn {
        background: linear-gradient(135deg, #ff6b35, #e55a2b) !important;
        color: white !important;
        border: none !important;
        font-weight: 600 !important;
        text-decoration: none !important;
    }
}

/* Desktop (1025px+) */
@media (min-width: 1025px) {
    .test-mode-container {
        max-width: 900px;
        border-radius: 18px;
        width: 100%;
        box-sizing: border-box;
        overflow-x: hidden;
        margin: 0 auto;
        padding: 0 1rem 40px 1rem;
    }
    
    .test-header {
        padding: 1.5rem 0;
        margin-bottom: 2rem;
        border-radius: 0 0 20px 20px;
    }
    
    .test-header h1 {
        font-size: 1.8rem;
        font-weight: 600;
    }
    
    .test-header .desc {
        font-size: 1rem;
    }
    
    .test-header .meta {
        font-size: 0.9rem;
        gap: 1.5rem;
    }
    
    .instructions-card {
        padding: 2rem;
        margin-bottom: 2rem;
        border-radius: 15px;
    }
    
    .sections-row {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
        width: 100%;
        max-width: 100%;
        margin-bottom: 2rem;
    }
    
    /* Section Choice responsive for desktop */
    #sectionChoice.show {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 2rem !important;
        margin: 24px 0 2rem 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
    
    .section-card {
        padding: 2rem;
        border-radius: 15px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        min-height: 280px;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
    }
    
    .section-card .icon {
        font-size: 2.3rem;
        margin-bottom: 1rem;
    }
    
    .section-card h2 {
        font-size: 1.1rem;
        font-weight: 600;
        margin-bottom: 0.5rem;
    }
    
    .section-card p {
        font-size: 0.85rem;
        line-height: 1.4;
        margin-bottom: 1rem;
        flex-grow: 1;
    }
    
    .section-card .meta {
        font-size: 0.8rem;
        margin-bottom: 1.2rem;
    }
    
    /* Ensure all buttons are visible and properly styled in desktop */
    .section-card .start-btn {
        background: var(--primary-gradient) !important;
        color: white !important;
        border: none !important;
        border-radius: 20px !important;
        padding: 0.7rem 1.5rem !important;
        font-size: 0.9rem !important;
        font-weight: 500 !important;
        text-decoration: none !important;
        display: inline-block !important;
        width: 100% !important;
        max-width: 180px !important;
        min-height: 44px !important;
        box-sizing: border-box !important;
        margin: 0 auto !important;
        cursor: pointer !important;
        transition: all 0.3s ease !important;
        box-shadow: 0 4px 15px rgba(106, 130, 251, 0.3) !important;
    }
    
    .section-card .start-btn:hover {
        transform: translateY(-2px) !important;
        box-shadow: 0 6px 20px rgba(106, 130, 251, 0.4) !important;
        color: white !important;
        background: var(--primary-gradient) !important;
    }
    
    .section-card.fulltest .start-btn {
        background: linear-gradient(135deg, #ff6b35, #e55a2b) !important;
        color: white !important;
        border: none !important;
        font-weight: 600 !important;
        text-decoration: none !important;
        box-shadow: 0 4px 15px rgba(255, 107, 53, 0.3) !important;
    }
    
    .section-card.fulltest .start-btn:hover {
        background: linear-gradient(135deg, #e55a2b, #cc4e24) !important;
        box-shadow: 0 6px 20px rgba(255, 107, 53, 0.4) !important;
        color: white !important;
        transform: translateY(-2px) !important;
    }
    
    .btn-back {
        background: linear-gradient(135deg, #dc3545, #c82333) !important;
        color: white !important;
        border: none !important;
        border-radius: 25px !important;
        padding: 0.8rem 2rem !important;
        font-size: 0.95rem !important;
        font-weight: 500 !important;
        text-decoration: none !important;
        display: block !important;
        width: fit-content !important;
        margin: 2rem auto 0 auto !important;
        min-height: 44px !important;
        box-sizing: border-box !important;
        cursor: pointer !important;
        transition: all 0.3s ease !important;
        box-shadow: 0 4px 15px rgba(220, 53, 69, 0.3) !important;
    }
    
    .btn-back:hover {
        background: linear-gradient(135deg, #c82333, #a02834) !important;
        transform: translateY(-2px) !important;
        box-shadow: 0 6px 20px rgba(220, 53, 69, 0.4) !important;
        color: white !important;
        text-decoration: none !important;
    }
}

/* Landscape Mobile Optimization */
@media screen and (max-height: 500px) and (orientation: landscape) and (max-width: 900px) {
    body {
        overflow-x: hidden;
    }
    
    .test-mode-container {
        padding: 0 1rem 15px 1rem;
        width: 100vw;
        max-width: 100vw;
        overflow-x: hidden;
        box-sizing: border-box;
    }
    
    .test-header {
        padding: 0.8rem;
        margin-bottom: 0.8rem;
        border-radius: 0;
    }

    .test-header h1 {
        font-size: 1.1rem;
        margin-bottom: 0.3rem;
    }

    .test-header .desc {
        font-size: 0.8rem;
        margin: 0.2rem 0;
    }

    .test-header .meta {
        font-size: 0.75rem;
        gap: 0.8rem;
    }

    .instructions-card {
        padding: 0.8rem;
        margin-bottom: 0.8rem;
        border-radius: 8px;
    }

    .instructions-card h2 {
        font-size: 1rem;
        margin-bottom: 0.5rem;
    }

    .instructions-card h3 {
        font-size: 0.9rem;
        margin: 0.8rem 0 0.4rem 0;
    }

    .instructions-card p, .instructions-card li {
        font-size: 0.8rem;
        line-height: 1.3;
        margin-bottom: 0.3rem;
    }

    .sections-row {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.8rem;
        margin-bottom: 0.8rem;
    }

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

    .section-card .icon {
        font-size: 1.3rem;
        margin-bottom: 0.4rem;
    }

    .section-card h2 {
        font-size: 0.9rem;
        margin-bottom: 0.3rem;
    }

    .section-card p {
        font-size: 0.75rem;
        margin-bottom: 0.5rem;
        line-height: 1.2;
    }

    .section-card .meta {
        font-size: 0.7rem;
        margin-bottom: 0.6rem;
    }

    .section-card .start-btn {
        padding: 0.6rem 0.8rem;
        font-size: 0.8rem;
        border-radius: 12px;
        min-height: 36px;
    }

    .btn-back {
        background: linear-gradient(135deg, #dc3545, #c82333) !important;
        color: white !important;
        margin: 0.8rem auto 0 auto;
        padding: 0.6rem 1.2rem;
        font-size: 0.8rem;
        border-radius: 12px;
        min-height: 36px;
        width: auto;
        max-width: 200px;
        box-shadow: 0 3px 12px rgba(220, 53, 69, 0.3);
    }
    
    .btn-back:hover {
        background: linear-gradient(135deg, #c82333, #a02834) !important;
        color: white !important;
        box-shadow: 0 4px 15px rgba(220, 53, 69, 0.4);
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    .section-card .start-btn,
    .btn-back {
        min-height: 44px;
        touch-action: manipulation;
    }

    .section-card {
        transition: transform 0.1s;
    }

    .section-card:active {
        transform: scale(0.98);
    }

    .section-card .start-btn:active,
    .btn-back:active {
        transform: scale(0.95);
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .section-card,
    .section-card .start-btn,
    .btn-back {
        transition: none;
    }

    .section-card:hover {
        transform: none;
    }
}

/* High DPI Display Support */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .test-header h1,
    .section-card h2 {
        text-rendering: optimizeLegibility;
    }
}
