/* General Styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #333;
    min-height: 100vh;
}

.homepage-body {
    background-image: linear-gradient(180deg, rgba(12, 42, 99, 0.1), rgba(32, 59, 111, 0.05)), url('image/student.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.container {
    max-width: 800px;
    margin: 50px auto;
    padding: 30px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    text-align: center;
    border: 1px solid rgba(255,255,255,0.2);
    backdrop-filter: blur(10px);
}

h1 {
    color: #4a5568;
    margin-bottom: 20px;
    font-size: 2.5em;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

h2 {
    color: #2d3748;
    margin: 20px 0;
    font-size: 1.8em;
    font-weight: 600;
}

p {
    font-size: 1.1em;
    line-height: 1.6;
    color: #4a5568;
}

.buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: 30px;
}

button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
}

button:active {
    transform: translateY(0);
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 24px;
    align-items: center;
    padding-bottom: 10px;
}

.hero-copy {
    text-align: left;
}

.eyebrow {
    display: inline-block;
    margin-bottom: 18px;
    padding: 10px 18px;
    border-radius: 999px;
    background: rgba(102, 126, 234, 0.16);
    color: #1a202c;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 0.85em;
}

.hero-copy h1 {
    font-size: 2.75em;
    line-height: 1.05;
    margin-bottom: 22px;
    color: #1e293b;
}

.hero-copy p {
    font-size: 1.15em;
    line-height: 1.8;
    color: #475569;
    max-width: 720px;
    margin-bottom: 24px;
}

.hero-buttons {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.hero-highlights {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}

.hero-highlight {
    background: #f8fafc;
    border: 1px solid rgba(102, 126, 234, 0.18);
    padding: 18px 20px;
    border-radius: 18px;
    min-width: 145px;
    box-shadow: 0 18px 40px rgba(102, 126, 234, 0.08);
}

.hero-highlight strong {
    display: block;
    font-size: 1.5em;
    margin-bottom: 6px;
    color: #1e293b;
}

.hero-highlight span {
    display: block;
    color: #475569;
    font-size: 0.95em;
}

.hero-visual {
    display: grid;
    gap: 18px;
}

.visual-card {
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 22px 60px rgba(15, 23, 42, 0.12);
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid rgba(148, 163, 184, 0.18);
}

.visual-card img {
    width: 100%;
    height: auto;
    display: block;
}

.visual-card.secondary {
    transform: translateY(20px);
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin-top: 34px;
}

.feature-card {
    background: #f8fafc;
    border-radius: 22px;
    padding: 24px;
    border: 1px solid rgba(102, 126, 234, 0.12);
    box-shadow: 0 16px 40px rgba(102, 126, 234, 0.08);
}

.feature-card h3 {
    margin-bottom: 14px;
    color: #1e293b;
    font-size: 1.25em;
}

.feature-card p {
    color: #475569;
    line-height: 1.75;
}

.info-section {
    margin-top: 40px;
}

.info-card {
    background: rgba(255, 255, 255, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 22px;
    padding: 28px;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.10);
}

.info-card h2 {
    margin-bottom: 16px;
    color: #1e293b;
}

.info-card p {
    color: #475569;
    line-height: 1.8;
}

.bottom-buttons {
    margin-top: 28px;
}

form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-width: 400px;
    margin: 0 auto;
}

input, select {
    padding: 12px 15px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
    background: #f7fafc;
}

input:focus, select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.subject-selection {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.subject-selection select {
    height: 120px;
    background: #f7fafc;
}

#selected-subjects {
    border: 2px solid #e2e8f0;
    min-height: 60px;
    padding: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    border-radius: 8px;
    background: #f7fafc;
}

.selected-subject {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.selected-subject:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.5);
}

.error {
    color: #e53e3e;
    font-weight: 600;
    background: #fed7d7;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #feb2b2;
}

/* Exam Layout */
body:has(#header) {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

#header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 25px;
    background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
    color: white;
    font-weight: bold;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    border-bottom: 3px solid #667eea;
}

#left-panel {
    position: fixed;
    left: 0;
    top: 70px;
    width: 220px;
    height: calc(100vh - 140px);
    background: linear-gradient(180deg, #f7fafc 0%, #edf2f7 100%);
    padding: 15px;
    overflow-y: auto;
    border-right: 2px solid #e2e8f0;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
}

.subject-tab {
    padding: 12px 15px;
    margin: 8px 0;
    cursor: pointer;
    background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e0 100%);
    border-radius: 10px;
    text-align: center;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.subject-tab:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.subject-tab.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

#main {
    margin-left: 240px;
    margin-right: 240px;
    padding: 25px;
    background: white;
    flex: 1;
    overflow-y: auto;
    border-radius: 15px 15px 0 0;
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
    margin-top: 20px;
    margin-bottom: 80px;
}

#question {
    font-size: 20px;
    margin-bottom: 25px;
    font-weight: 600;
    color: #2d3748;
    line-height: 1.6;
}

#question h3 {
    color: #4a5568;
    margin-bottom: 15px;
    font-size: 1.4em;
}

#options label {
    display: flex;
    align-items: center;
    margin: 12px 0;
    font-size: 16px;
    cursor: pointer;
    padding: 12px 15px;
    border-radius: 8px;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

#options label:hover {
    background: #f7fafc;
    border-color: #e2e8f0;
}

#options label span {
    flex: 1;
    word-break: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

#options input[type="radio"] {
    margin-right: 10px;
    flex-shrink: 0;
    transform: scale(1.2);
}

#right-panel {
    position: fixed;
    right: 0;
    top: 70px;
    width: 220px;
    height: calc(100vh - 140px);
    background: linear-gradient(180deg, #f7fafc 0%, #edf2f7 100%);
    padding: 15px;
    overflow-y: auto;
    border-left: 2px solid #e2e8f0;
    box-shadow: -2px 0 10px rgba(0,0,0,0.1);
}

#navigator {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.nav-btn {
    width: 45px;
    height: 45px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    font-size: 14px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.nav-btn.answered {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
}

.nav-btn.unanswered {
    background: linear-gradient(135deg, #f56565 0%, #e53e3e 100%);
    color: white;
}

.nav-btn.current {
    background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
    color: white;
    border: 3px solid #ffd700;
    box-shadow: 0 0 15px rgba(66, 153, 225, 0.6);
}

.nav-btn.flagged {
    background: linear-gradient(135deg, #ed8936 0%, #dd6b20 100%);
    color: white;
}

.nav-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

#bottom {
    position: fixed;
    bottom: 0;
    left: 240px;
    right: 240px;
    padding: 15px 25px;
    background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
    border-top: 3px solid #667eea;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.3);
}

#bottom button {
    padding: 10px 20px;
    font-size: 14px;
}

/* Instructions Page */
.container ul {
    text-align: left;
    max-width: 600px;
    margin: 0 auto 20px;
    padding: 0;
    list-style: none;
}

.container li {
    background: #f7fafc;
    margin: 8px 0;
    padding: 12px 15px;
    border-radius: 8px;
    border-left: 4px solid #667eea;
    font-size: 1.1em;
    line-height: 1.5;
}

.container li strong {
    color: #2d3748;
}

/* Result Page */
.result-highlight {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
    padding: 20px;
    border-radius: 10px;
    margin: 20px 0;
    font-size: 1.2em;
    font-weight: 600;
}

ul {
    list-style: none;
    padding: 0;
}

ul li {
    background: #f7fafc;
    margin: 8px 0;
    padding: 12px 15px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.1em;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.container {
    animation: fadeIn 0.6s ease-out;
}

.subject-tab, .nav-btn, button {
    animation: fadeIn 0.4s ease-out;
}

/* Enhanced Form Styling */
input[type="radio"]:checked + span {
    font-weight: bold;
    color: #667eea;
}

/* Timer Styling */
#timer {
    font-size: 1.2em;
    font-weight: bold;
    background: rgba(255,255,255,0.2);
    padding: 5px 10px;
    border-radius: 20px;
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Success/Error Messages */
.success {
    color: #38a169;
    background: #c6f6d5;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #9ae6b4;
    margin: 10px 0;
}

.warning {
    color: #d69e2e;
    background: #fef5e7;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #f6e05e;
    margin: 10px 0;
}

/* Enhanced Typography */
strong {
    color: #2d3748;
}

/* Card-like elements */
.card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    margin: 20px 0;
    border: 1px solid rgba(255,255,255,0.2);
}

/* Progress Bar for Timer */
.timer-progress {
    width: 100%;
    height: 8px;
    background: rgba(255,255,255,0.3);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 5px;
}

.timer-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #48bb78, #38a169);
    border-radius: 4px;
    transition: width 1s linear;
}

/* Enhanced Mobile Styles */
@media (max-width: 768px) {
    body {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    }

    .container {
        margin: 10px;
        padding: 20px;
        border-radius: 10px;
    }

    h1 {
        font-size: 1.8em;
    }

    #main {
        margin: 10px;
        padding: 15px;
        border-radius: 10px;
    }

    #header {
        padding: 10px 15px;
        font-size: 14px;
    }

    #bottom {
        padding: 10px 15px;
    }

    .nav-btn {
        width: 35px;
        height: 35px;
        font-size: 12px;
    }

    .hero-grid {
        grid-template-columns: 1fr;
    }

    .hero-copy {
        text-align: center;
    }

    .hero-copy h1 {
        font-size: 2.2em;
    }

    .hero-buttons,
    .hero-highlights {
        justify-content: center;
    }

    .feature-grid {
        grid-template-columns: 1fr;
    }

    .visual-card.secondary {
        transform: none;
    }

    .visual-card img {
        max-height: 320px;
        object-fit: cover;
    }
}
