/* assets/css/frontend.css */

@import url('https://fonts.googleapis.com/css2?family=Fira+Sans:wght@300;400;500;600;700&display=swap');

.duopharma-quiz-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    font-family: 'Fira Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
}

.quiz-header {
    background: linear-gradient(135deg, #DC143C 0%, #8B0000 100%);
    color: white;
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.quiz-title {
    margin: 0;
    font-size: 28px;
}

.quiz-stats {
    display: flex;
    gap: 20px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255,255,255,0.2);
    padding: 10px 15px;
    border-radius: 8px;
}

.stat-icon {
    font-size: 24px;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 20px;
    font-weight: bold;
}

.stat-label {
    font-size: 12px;
    opacity: 0.9;
}

/* Unit Selection Screen */
.quiz-screen h3 {
    font-size: 24px;
    margin-bottom: 20px;
    color: #333;
}

.sections-container {
    display: grid;
    gap: 20px;
}

.section-block {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
}

.section-header {
    background: linear-gradient(135deg, #DC143C 0%, #000000 100%);
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.section-letter {
    font-size: 24px;
    font-weight: bold;
}

.section-count {
    font-size: 14px;
    opacity: 0.9;
}

.units-list {
    padding: 15px;
    display: grid;
    gap: 10px;
}

.unit-button {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    text-align: left;
}

.unit-button:hover {
    background: #fff;
    border-color: #DC143C;
    transform: translateX(5px);
}

.unit-button.completed {
    background: #f0f8f0;
    border-color: #28a745;
}

.unit-button.completed .unit-icon::after {
    content: ' ✓';
    color: #28a745;
    font-weight: bold;
}

.unit-icon {
    font-size: 24px;
}

.unit-name {
    flex: 1;
    font-size: 16px;
    font-weight: 500;
    color: #333;
}

.unit-progress {
    width: 100px;
}

.progress-bar {
    display: block;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, #DC143C 0%, #8B0000 100%);
    transition: width 0.3s ease;
}

/* Quiz Screen */
.quiz-progress {
    margin-bottom: 30px;
}

.progress-bar-container {
    height: 12px;
    background: #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #DC143C 0%, #8B0000 100%);
    transition: width 0.5s ease;
    width: 0%;
}

.progress-text {
    font-size: 14px;
    color: #666;
    text-align: center;
    display: block;
}

.quiz-content {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.question-container h3 {
    font-size: 20px;
    color: #333;
    margin-bottom: 30px;
    line-height: 1.5;
}

.answer-options {
    display: grid;
    gap: 12px;
}

.answer-option {
    padding: 15px 20px;
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 16px;
    color: #333;
}

.answer-option:hover {
    background: #fff;
    border-color: #DC143C;
    transform: translateX(5px);
}

.answer-option.selected {
    background: #DC143C;
    color: white;
    border-color: #DC143C;
}

.answer-option.correct {
    background: #28a745;
    color: white;
    border-color: #28a745;
}

.answer-option.incorrect {
    background: #dc3545;
    color: white;
    border-color: #dc3545;
}

.answer-option.disabled {
    pointer-events: none;
    opacity: 0.7;
}

/* Feedback Container */
.feedback-container {
    margin-top: 20px;
    padding: 20px;
    border-radius: 8px;
    background: #f8f9fa;
}

.feedback-message {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    font-size: 18px;
    font-weight: bold;
}

.feedback-icon {
    font-size: 24px;
}

.feedback-container.correct .feedback-message {
    color: #28a745;
}

.feedback-container.incorrect .feedback-message {
    color: #dc3545;
}

.explanation-text {
    color: #666;
    line-height: 1.5;
    margin-bottom: 15px;
}

#next-question-btn {
    background: linear-gradient(135deg, #DC143C 0%, #8B0000 100%);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    transition: transform 0.3s ease;
}

#next-question-btn:hover {
    transform: translateY(-2px);
}

/* Quiz Actions */
.quiz-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
}

.button-secondary {
    background: #6c757d;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s ease;
}

.button-secondary:hover {
    background: #5a6268;
}

/* Results Screen */
.results-container {
    background: white;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    text-align: center;
}

.results-container h2 {
    font-size: 32px;
    margin-bottom: 30px;
    background: linear-gradient(135deg, #DC143C 0%, #000000 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.results-summary {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 50px;
    margin-bottom: 30px;
}

.score-circle {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: linear-gradient(135deg, #DC143C 0%, #8B0000 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
}

.score-percentage {
    font-size: 36px;
    font-weight: bold;
}

.score-label {
    font-size: 14px;
    opacity: 0.9;
}

.results-stats {
    text-align: left;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #e0e0e0;
    min-width: 250px;
}

.stat-row:last-child {
    border-bottom: none;
}

.stat-row .stat-label {
    color: #666;
}

.stat-row .stat-value {
    font-weight: bold;
    color: #333;
}

.results-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
}

.button-primary {
    background: linear-gradient(135deg, #DC143C 0%, #8B0000 100%);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.button-primary:hover {
    transform: translateY(-2px);
}

/* Answer Review */
.answer-review {
    text-align: left;
    margin-top: 30px;
    padding-top: 30px;
    border-top: 2px solid #e0e0e0;
}

.review-item {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
}

.review-question {
    font-weight: bold;
    margin-bottom: 10px;
    color: #333;
}

.review-answer {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.user-answer {
    color: #666;
}

.correct-answer {
    color: #28a745;
    font-weight: bold;
}

.review-explanation {
    font-size: 14px;
    color: #666;
    font-style: italic;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #DC143C;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    color: white;
    font-size: 18px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .quiz-header {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }
    
    .results-summary {
        flex-direction: column;
        gap: 30px;
    }
    
    .quiz-actions {
        flex-direction: column;
    }
    
    .button-secondary,
    .button-primary {
        width: 100%;
    }
}