/* Base Styles */
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css');
body { font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; line-height: 1.6; padding: 20px; background: #f5f5f5; color: #333; }
.quiz-container { max-width: 900px; margin: 0 auto; background: white; padding: 20px; border-radius: 8px; box-shadow: 0 2px 15px rgba(0,0,0,0.1); }

/* Header Controls */
.header-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 15px 0;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.timer-container {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.1em;
    font-weight: 600;
    color: #2c3e50;
    background: #f8f9fa;
    padding: 8px 15px;
    border-radius: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.timer-container.warning {
    color: #e74c3c;
    animation: pulse 1s infinite;
}

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

.score-container {
    font-size: 1.1em;
    font-weight: 600;
    color: #2c3e50;
}

/* Buttons */
button { background: #4CAF50; color: white; border: none; padding: 10px 20px; border-radius: 4px; cursor: pointer; margin: 5px; }
button:hover { background: #45a049; }
button:disabled { background: #cccccc; }

/* Quiz Elements */
.progress-bar { width: 100%; height: 8px; background: #e0e0e0; margin: 15px 0; }
.progress { height: 100%; background: #4CAF50; width: 0%; }
.options-container { margin: 20px 0; }
.option-btn { 
    display: flex;
    align-items: center;
    width: 100%;
    padding: 12px 15px;
    margin: 8px 0;
    text-align: left;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    background: white;
    transition: all 0.2s ease;
    font-size: 1rem;
    color: #333;
}

.option-btn:hover {
    background: #f5f5f5;
    border-color: #4CAF50;
}

.option-label {
    display: inline-block;
    width: 24px;
    height: 24px;
    line-height: 24px;
    text-align: center;
    background: #4CAF50;
    color: white;
    border-radius: 50%;
    margin-right: 12px;
    font-weight: bold;
    flex-shrink: 0;
}
.option-btn.correct { 
    background: #d4edda; 
    border-color: #28a745;
    color: #155724;
}
.option-btn.correct .option-label {
    background: #28a745;
}
.option-btn.wrong { 
    background: #f8d7da; 
    border-color: #dc3545;
    color: #721c24;
}
.option-btn.wrong .option-label {
    background: #dc3545;
}
.option-btn:disabled {
    cursor: not-allowed;
    opacity: 0.8;
}

/* Screens */
#start-screen, #quiz-screen, #result-screen { text-align: center; padding: 20px; }
#explanation { background: #f8f9fa; padding: 15px; border-radius: 4px; margin: 15px 0; text-align: left; }

/* Certificate Styles */
.certificate-container {
    max-width: 800px;
    margin: 2rem auto;
    text-align: center;
}

.certificate {
    background: #fff;
    border: 15px solid #1a365d;
    padding: 3rem 2rem;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    background-image: url('data:image/svg+xml;utf8,<svg width="100" height="100" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"><path d="M30,10 L70,10 L90,30 L90,90 L10,90 L10,30 L30,10 Z" fill="none" stroke="%23e2e8f0" stroke-width="2" stroke-dasharray="5,5"/></svg>');
    background-size: 200px;
    background-position: center;
    background-repeat: no-repeat;
    background-blend-mode: overlay;
}

.watermark {
    position: absolute;
    opacity: 0.1;
    font-size: 8rem;
    font-weight: bold;
    color: #1a365d;
    transform: rotate(-30deg);
    top: 30%;
    left: 0;
    right: 0;
    pointer-events: none;
}

.certificate-header h1 {
    color: #1a365d;
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    position: relative;
    padding-bottom: 1rem;
}

.certificate-header h1:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 3px;
    background: linear-gradient(90deg, #1a365d, #4299e1, #1a365d);
}

.student-name h2 {
    color: #2b6cb0;
    font-size: 2rem;
    margin: 1.5rem 0;
    padding: 1rem 2rem;
    display: inline-block;
    border-bottom: 2px solid #4299e1;
    position: relative;
}

.certificate-body h3 {
    color: #2c5282;
    font-size: 1.5rem;
    margin: 1rem 0;
}

.certificate-body p {
    color: #4a5568;
    font-size: 1.1rem;
    margin: 0.5rem 0;
    line-height: 1.6;
}

.date-issued {
    margin: 2rem 0;
    font-style: italic;
    color: #718096;
}

.signatures {
    display: flex;
    justify-content: space-around;
    margin-top: 3rem;
    padding-top: 1rem;
    border-top: 2px solid #e2e8f0;
}

.signature {
    text-align: center;
    min-width: 200px;
}

.signature-line {
    height: 1px;
    background: #cbd5e0;
    margin: 0.5rem 0;
    position: relative;
}

.signature-line:after {
    content: '';
    position: absolute;
    top: -10px;
    left: 0;
    right: 0;
    height: 1px;
    background: #cbd5e0;
}

/* Certificate Actions */
.certificate-actions {
    margin-top: 2rem;
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.btn-download, .btn-share, .btn-try-again, .btn-home {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.btn-download {
    background: #2b6cb0;
    color: white;
}

.btn-download:hover {
    background: #2c5282;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.btn-share {
    background: #4299e1;
    color: white;
}

.btn-share:hover {
    background: #3182ce;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.btn-try-again {
    background: #e53e3e;
    color: white;
    margin-top: 1rem;
}

.btn-try-again:hover {
    background: #c53030;
    transform: translateY(-2px);
}

.btn-home {
    background: #4a5568;
    color: white;
    margin-top: 2rem;
}

.btn-home:hover {
    background: #2d3748;
    transform: translateY(-2px);
}

/* Try Again Section */
.try-again-container {
    background: #fff5f5;
    border: 1px solid #fed7d7;
    border-radius: 8px;
    padding: 2rem;
    margin: 2rem 0;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.try-again-container h3 {
    color: #c53030;
    margin-top: 0;
}

#try-again-score {
    font-weight: bold;
    color: #c53030;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .certificate {
        padding: 2rem 1rem;
    }
    
    .certificate-header h1 {
        font-size: 2rem;
    }
    
    .student-name h2 {
        font-size: 1.5rem;
    }
    
    .certificate-actions {
        flex-direction: column;
    }
    
    .btn-download, .btn-share {
        width: 100%;
        justify-content: center;
    }
}
