/**
 * Sanskrit Learning Academy - Educational Styles
 * Shared CSS for all Sanskrit learning games
 */

/* Import Devanagari font for Sanskrit text */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Devanagari:wght@400;700&family=Inter:wght@400;600&display=swap');

/* Progress Bar Styles */
.progress-bar {
    background: rgba(255,255,255,0.3);
    height: 8px;
    border-radius: 4px;
    margin: 20px 0;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.progress-fill {
    background: linear-gradient(90deg, #FFD700, #FFA500);
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
    box-shadow: 0 2px 4px rgba(255,215,0,0.3);
}

/* Game Statistics Display */
.game-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin: 1rem 0;
    background: rgba(0,0,0,0.6);
    padding: 15px;
    border-radius: 10px;
    border: 2px solid #FFD700;
}

.stat-card {
    text-align: center;
    padding: 10px;
}

.stat-number {
    font-size: 1.5rem;
    font-weight: bold;
    color: #FFD700;
    display: block;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.stat-card span:last-child {
    font-size: 0.85rem;
    opacity: 0.9;
    color: white;
}

/* Concept Display */
.concept-display {
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 15px;
    border-radius: 10px;
    margin: 10px 0;
    border: 2px solid #FFD700;
    font-size: 0.95rem;
}

.concept-display strong {
    color: #FFD700;
}

/* Question Modal Overlay */
.edu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    display: none;
    z-index: 999;
    backdrop-filter: blur(2px);
}

/* Question Modal */
.edu-question {
    background: rgba(255, 255, 255, 0.95);
    color: #333;
    padding: 25px;
    border-radius: 15px;
    margin: 20px auto;
    max-width: 650px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
    display: none;
    max-height: 90vh;
    overflow-y: auto;
}

/* Category Badge */
.edu-category {
    background: linear-gradient(135deg, #4169E1, #1E90FF);
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    margin-bottom: 15px;
    display: inline-block;
    font-weight: 600;
}

/* Sanskrit Term Display */
.sanskrit-term {
    font-size: 2.2rem;
    color: #4169E1;
    margin: 15px 0;
    font-weight: bold;
    font-family: 'Noto Sans Devanagari', serif;
    text-align: center;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

/* Question Text */
#edu-question-text {
    font-size: 1.1rem;
    line-height: 1.6;
    margin: 20px 0;
}

#edu-question-text strong {
    color: #4169E1;
    font-weight: 600;
}

/* Explanation Box */
.edu-explanation {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 10px;
    margin: 15px 0;
    text-align: left;
    border-left: 4px solid #4169E1;
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Question Options */
.edu-options {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin: 20px 0;
}

.edu-btn {
    background: #4169E1;
    color: white;
    border: none;
    padding: 15px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
    text-align: left;
    line-height: 1.4;
}

.edu-btn:hover {
    background: #1E90FF;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(65,105,225,0.3);
}

.edu-btn.correct {
    background: #27ae60;
    box-shadow: 0 4px 12px rgba(39,174,96,0.3);
}

.edu-btn.incorrect {
    background: #e74c3c;
    box-shadow: 0 4px 12px rgba(231,76,60,0.3);
}

.edu-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Knowledge Reward Animation */
.knowledge-reward {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: #333;
    padding: 15px 25px;
    border-radius: 25px;
    margin: 15px 0;
    font-weight: bold;
    animation: rewardFloat 2s infinite ease-in-out;
    box-shadow: 0 8px 16px rgba(255,215,0,0.3);
    border: 2px solid rgba(255,255,255,0.5);
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

@keyframes rewardFloat {
    0%, 100% { 
        transform: translateY(0) scale(1); 
        box-shadow: 0 8px 16px rgba(255,215,0,0.3);
    }
    50% { 
        transform: translateY(-5px) scale(1.02); 
        box-shadow: 0 12px 20px rgba(255,215,0,0.4);
    }
}

/* Domain-specific color themes */
.domain-war {
    --primary-color: #B22222;
    --secondary-color: #DC143C;
    --accent-color: #FFD700;
}

.domain-vehicle {
    --primary-color: #FF6347;
    --secondary-color: #FF7F50;
    --accent-color: #FFD700;
}

.domain-maritime {
    --primary-color: #1E88E5;
    --secondary-color: #0D47A1;
    --accent-color: #FFD700;
}

.domain-underground {
    --primary-color: #654321;
    --secondary-color: #8B4513;
    --accent-color: #FFD700;
}

.domain-urban {
    --primary-color: #4169E1;
    --secondary-color: #87CEEB;
    --accent-color: #FFD700;
}

/* Apply domain themes */
.domain-war .edu-category {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

.domain-war .sanskrit-term {
    color: var(--primary-color);
}

.domain-war .edu-btn {
    background: var(--primary-color);
}

.domain-war .edu-btn:hover {
    background: var(--secondary-color);
}

.domain-vehicle .edu-category {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

.domain-vehicle .sanskrit-term {
    color: var(--primary-color);
}

.domain-vehicle .edu-btn {
    background: var(--primary-color);
}

.domain-vehicle .edu-btn:hover {
    background: var(--secondary-color);
}

.domain-maritime .edu-category {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

.domain-maritime .sanskrit-term {
    color: var(--primary-color);
}

.domain-maritime .edu-btn {
    background: var(--primary-color);
}

.domain-maritime .edu-btn:hover {
    background: var(--secondary-color);
}

.domain-underground .edu-category {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

.domain-underground .sanskrit-term {
    color: var(--primary-color);
}

.domain-underground .edu-btn {
    background: var(--primary-color);
}

.domain-underground .edu-btn:hover {
    background: var(--secondary-color);
}

.domain-urban .edu-category {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

.domain-urban .sanskrit-term {
    color: var(--primary-color);
}

.domain-urban .edu-btn {
    background: var(--primary-color);
}

.domain-urban .edu-btn:hover {
    background: var(--secondary-color);
}

/* Responsive Design */
@media (max-width: 768px) {
    .game-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .edu-question {
        margin: 10px;
        max-width: calc(100% - 20px);
        padding: 20px;
    }
    
    .sanskrit-term {
        font-size: 1.8rem;
    }
}

@media (max-width: 480px) {
    .game-stats {
        grid-template-columns: 1fr;
    }
    
    .edu-question {
        padding: 15px;
    }
    
    .sanskrit-term {
        font-size: 1.5rem;
    }
    
    .edu-btn {
        padding: 12px;
        font-size: 0.95rem;
    }
}

/* Animation for smooth transitions */
.edu-question, .edu-overlay {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.edu-question.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.edu-question.hide {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.95);
}

/* Loading animation */
.edu-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #FFD700;
    animation: eduSpin 1s ease-in-out infinite;
}

@keyframes eduSpin {
    to { transform: rotate(360deg); }
}

/* Success/Error states */
.edu-success {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
}

.edu-error {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
}

/* Cultural context styling */
.cultural-context {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid var(--accent-color, #FFD700);
    border-radius: 10px;
    padding: 15px;
    margin: 15px 0;
    text-align: left;
    color: white;
}

.cultural-context h3 {
    color: var(--accent-color, #FFD700);
    margin-bottom: 10px;
}

/* Enhanced accessibility */
.edu-btn:focus {
    outline: 2px solid #FFD700;
    outline-offset: 2px;
}

.sanskrit-term:focus {
    outline: 2px solid #FFD700;
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .edu-overlay, .edu-question {
        display: none !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .edu-btn {
        border: 2px solid white;
    }
    
    .sanskrit-term {
        text-shadow: 2px 2px 0px black;
    }
}