:root {
    --primary: #667eea;
    --primary-dark: #5568d3;
    --secondary: #764ba2;
    --success: #4CAF50;
    --error: #f44336;
    --warning: #FF9800;
    --bg-main: #f5f7fa;
    --bg-card: #ffffff;
    --text-main: #2c3e50;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 20px 60px rgba(102, 126, 234, 0.25);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: var(--text-main);
}

.exam-container {
    max-width: 900px;
    margin: 0 auto;
    background: var(--bg-card);
    border-radius: 20px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

/* ===== HEADER ===== */
.exam-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    padding: 30px;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-icon {
    font-size: 3em;
    background: rgba(255, 255, 255, 0.2);
    width: 70px;
    height: 70px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}

.exam-header h1 {
    font-size: 1.8em;
    font-weight: 700;
    margin-bottom: 5px;
}

.subtitle {
    font-size: 0.95em;
    opacity: 0.9;
}

.exam-info {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.info-badge {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    padding: 10px 20px;
    border-radius: 25px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9em;
    font-weight: 500;
}

.badge-icon {
    font-size: 1.2em;
}

/* ===== SETUP SECTION ===== */
.setup-section {
    padding: 40px;
    display: flex;
    justify-content: center;
}

.setup-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 40px;
    max-width: 600px;
    width: 100%;
    text-align: center;
    box-shadow: var(--shadow);
}

.setup-icon {
    font-size: 4em;
    margin-bottom: 20px;
}

.setup-card h2 {
    font-size: 2em;
    margin-bottom: 10px;
    color: var(--primary);
}

.setup-description {
    color: var(--text-muted);
    margin-bottom: 30px;
}

.input-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.input-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    text-align: left;
}

.input-group.full-width {
    flex: 1 1 100%;
}

.input-group label {
    font-size: 0.9em;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
}

.label-icon {
    font-size: 1.1em;
}

.input-group input {
    padding: 14px 18px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 1em;
    font-family: 'Poppins', sans-serif;
    transition: all 0.3s ease;
    background: var(--bg-card);
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.btn-start {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1em;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.btn-start:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(102, 126, 234, 0.6);
}

/* ===== QUIZ SECTION ===== */
.quiz-section {
    padding: 30px;
}

.quiz-header {
    margin-bottom: 30px;
}

.progress-container {
    background: var(--bg-main);
    padding: 20px;
    border-radius: 15px;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 0.9em;
    font-weight: 600;
    color: var(--text-muted);
}

.progress-bar {
    width: 100%;
    height: 10px;
    background: var(--border-color);
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 100%);
    width: 0%;
    transition: width 0.5s ease;
    border-radius: 10px;
}

/* ===== QUESTION GROUPS ===== */
.question-group {
    margin-bottom: 40px;
}

.group-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 3px solid var(--primary);
}

.group-number {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8em;
    font-weight: 800;
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.group-header h3 {
    font-size: 1.5em;
    margin-bottom: 5px;
    color: var(--text-main);
}

.group-description {
    color: var(--text-muted);
    font-size: 0.9em;
}

/* ===== QUESTIONS ===== */
.question {
    background: var(--bg-main);
    padding: 25px;
    border-radius: 15px;
    margin-bottom: 20px;
    border-left: 5px solid var(--primary);
    transition: all 0.3s ease;
}

.question:hover {
    box-shadow: var(--shadow);
    transform: translateX(5px);
}

.question-text {
    font-size: 1.1em;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text-main);
    display: flex;
    gap: 15px;
    line-height: 1.5;
}

.question-number {
    background: var(--primary);
    color: white;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
}

.options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.option-label {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 20px;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.option-label:hover {
    border-color: var(--primary);
    background: rgba(102, 126, 234, 0.05);
    transform: translateX(5px);
}

.option-label input[type="radio"] {
    width: 20px;
    height: 20px;
    accent-color: var(--primary);
    cursor: pointer;
}

.option-label input[type="radio"]:checked + .option-text {
    font-weight: 600;
    color: var(--primary);
}

.option-text {
    font-size: 0.95em;
    color: var(--text-main);
    transition: all 0.3s ease;
}

/* V/F Options */
.vf-options {
    flex-direction: row;
    gap: 20px;
}

.vf-label {
    flex: 1;
    justify-content: center;
}

/* ===== MATCH GROUP ===== */
.match-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 15px;
}

.match-item {
    background: var(--bg-card);
    padding: 15px;
    border-radius: 12px;
    border: 2px solid var(--border-color);
}

.match-label {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.match-code {
    font-weight: 700;
    color: var(--primary);
    font-size: 1.1em;
    padding: 8px 12px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 8px;
    text-align: center;
}

.match-select {
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 0.95em;
    font-family: 'Poppins', sans-serif;
    background: var(--bg-card);
    cursor: pointer;
    transition: all 0.3s ease;
}

.match-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

/* ===== WORD BANK ===== */
.word-bank {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    padding: 25px;
    border-radius: 15px;
    margin-bottom: 25px;
    border: 2px dashed var(--primary);
}

.word-bank h4 {
    margin-bottom: 15px;
    color: var(--primary);
    font-size: 1.1em;
}

.word-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.word-tag {
    padding: 8px 16px;
    background: var(--bg-card);
    border: 2px solid var(--primary);
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 600;
    color: var(--primary);
}

/* ===== FILL INPUT ===== */
.fill-input {
    padding: 8px 15px;
    border: 2px solid var(--primary);
    border-radius: 8px;
    font-size: 1em;
    font-family: 'Poppins', sans-serif;
    background: var(--bg-card);
    min-width: 150px;
    transition: all 0.3s ease;
}

.fill-input:focus {
    outline: none;
    border-color: var(--secondary);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

/* ===== SUBMIT BUTTON ===== */
.btn-submit {
    width: 100%;
    padding: 18px;
    background: linear-gradient(135deg, var(--success) 0%, #45a049 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.2em;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 30px;
    box-shadow: 0 8px 25px rgba(76, 175, 80, 0.4);
}

.btn-submit:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(76, 175, 80, 0.6);
}

/* ===== HIDDEN ===== */
.hidden {
    display: none;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .exam-header {
        padding: 20px;
    }
    
    .header-content {
        flex-direction: column;
        text-align: center;
    }
    
    .logo-section {
        flex-direction: column;
    }
    
    .exam-info {
        justify-content: center;
    }
    
    .setup-section,
    .quiz-section {
        padding: 20px;
    }
    
    .input-row {
        flex-direction: column;
        gap: 15px;
    }
    
    .group-header {
        flex-direction: column;
        text-align: center;
    }
    
    .vf-options {
        flex-direction: column;
    }
    
    .match-group {
        grid-template-columns: 1fr;
    }
    
    .question-text {
        flex-direction: column;
        gap: 10px;
    }
}

/* ===== PRINT STYLES ===== */
@media print {
    body {
        background: white;
        padding: 0;
    }
    
    .exam-container {
        box-shadow: none;
        border-radius: 0;
    }
    
    .btn-submit,
    .btn-start,
    .quiz-header {
        display: none !important;
    }
    
    .question {
        break-inside: avoid;
    }
}