/* Combined styles for the chemistry exam website */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    background-color: #f5f5f5;
}

h1, h2, h3 {
    color: #2c3e50;
}

h1 {
    text-align: center;
    margin-bottom: 30px;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
}

h2 {
    margin-top: 40px;
    border-left: 4px solid #3498db;
    padding-left: 10px;
}

.question {
    background-color: white;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: transform 0.2s ease;
}

.question:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.options {
    margin-left: 20px;
}

.option {
    margin-bottom: 8px;
}

input[type="radio"], 
input[type="checkbox"], 
input[type="text"] {
    margin-right: 10px;
}

input[type="text"] {
    border: none;
    border-bottom: 1px solid #3498db;
    padding: 5px;
    width: 200px;
    background-color: #f8f9fa;
}

input[type="text"]:focus {
    outline: none;
    border-bottom: 2px solid #2980b9;
    background-color: #e8f4f8;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

th, td {
    padding: 10px;
    border: 1px solid #ddd;
    text-align: left;
}

th {
    background-color: #f2f2f2;
}

.matching-option {
    width: 80px;
    padding: 5px;
    border-radius: 3px;
    border: 1px solid #ddd;
}

.matching-option:focus {
    outline: none;
    border-color: #3498db;
}

button {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    margin-top: 20px;
    transition: background-color 0.3s ease;
}

button:hover {
    background-color: #2980b9;
}

.result {
    margin-top: 20px;
    padding: 15px;
    border-radius: 5px;
    display: none;
}

.correct {
    background-color: #d4edda;
    color: #155724;
    padding: 5px 10px;
    border-radius: 3px;
}

.incorrect {
    background-color: #f8d7da;
    color: #721c24;
    padding: 5px 10px;
    border-radius: 3px;
}

.header-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 30px;
}

.header-field {
    flex: 1;
    margin-right: 10px;
}

.header-field label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.header-field input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.section {
    margin-bottom: 40px;
    border-bottom: 1px dashed #ccc;
    padding-bottom: 20px;
}

.feedback {
    font-weight: bold;
    margin-top: 10px;
}

#finalScore {
    font-size: 24px;
    text-align: center;
    margin: 20px 0;
    font-weight: bold;
    padding: 15px;
    background-color: #e8f4f8;
    border-radius: 5px;
    border-left: 5px solid #3498db;
}

.print-button {
    background-color: #27ae60;
}

.print-button:hover {
    background-color: #219653;
}

.reset-button {
    background-color: #e74c3c;
    margin-left: 10px;
}

.reset-button:hover {
    background-color: #c0392b;
}

.button-container {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 30px;
}

/* Exam controls styles */
.exam-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #f0f8ff;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.timer-container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

#timer {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 5px;
}

.progress-container {
    flex-grow: 1;
    margin-left: 20px;
}

.progress-bar-container {
    width: 100%;
    height: 20px;
    background-color: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background-color: #3498db;
    width: 0%;
    transition: width 0.3s ease;
}

#progressText {
    text-align: center;
    margin-top: 5px;
    font-size: 14px;
}

@media print {
    button, .button-container, .exam-controls {
        display: none;
    }
    
    body {
        background-color: white;
        padding: 0;
    }
    
    .question {
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .feedback {
        display: none;
    }
}

@media (max-width: 600px) {
    .header-info {
        flex-direction: column;
    }
    
    .header-field {
        margin-right: 0;
        margin-bottom: 10px;
    }
    
    table {
        font-size: 14px;
    }
    
    .matching-option {
        width: 60px;
    }
    
    .exam-controls {
        flex-direction: column;
    }
    
    .progress-container {
        margin-left: 0;
        margin-top: 10px;
        width: 100%;
    }
}
