/**
 * Guna Lessons CSS
 * Specific styles for Guna language lessons
 */

/* Guna-specific color scheme — mola palette (no blue) */
:root {
    --guna-primary: #11802b;
    --guna-secondary: #d4a017;
    --guna-accent: #c0392b;
    --guna-sun: #ffb300;
    --guna-earth: #3d1f0a;
    --guna-cream: #f8f3ea;
    --guna-success: #2ECC71;
    --guna-warning: #F39C12;
    --guna-danger: #E74C3C;
    --guna-info: #1a5c2e;

    --guna-gradient-primary: linear-gradient(135deg, #11802b 0%, #1a5c2e 55%, #d4a017 100%);
    --guna-gradient-mola: linear-gradient(165deg, #fffef9 0%, #f8f3ea 35%, rgba(255, 179, 0, 0.18) 65%, rgba(17, 128, 43, 0.14) 100%);
    --guna-gradient-accent: linear-gradient(135deg, #c0392b, #ffb300);
    --guna-gradient-success: linear-gradient(135deg, #2ECC71, #11802b);
    --guna-mola-stripe: repeating-linear-gradient(
        90deg,
        #c0392b 0, #c0392b 10px,
        #ffb300 10px, #ffb300 20px,
        #11802b 20px, #11802b 30px,
        #d4a017 30px, #d4a017 40px
    );
}

/* Mola intro hero inside lesson viewer */
.lesson-intro--mola {
    text-align: center;
}

.intro-header--mola {
    background: var(--guna-gradient-mola);
    padding: 2rem 1.5rem;
    border-radius: 16px;
    margin-bottom: 1.5rem;
    border: 3px solid transparent;
    border-image: var(--guna-mola-stripe) 1;
    position: relative;
    overflow: hidden;
}

.intro-header--mola::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='40' viewBox='0 0 80 40'%3E%3Cpath d='M0 20 L10 10 L20 20 L30 10 L40 20 L50 10 L60 20 L70 10 L80 20' fill='none' stroke='%23c0392b' stroke-opacity='0.06' stroke-width='1.5'/%3E%3C/svg%3E");
    background-size: 80px 40px;
    opacity: 0.7;
    pointer-events: none;
}

.intro-header--mola h2 {
    position: relative;
    z-index: 1;
    color: var(--guna-earth);
    margin-bottom: 0.75rem;
}

.intro-header--mola p {
    position: relative;
    z-index: 1;
    color: rgba(61, 31, 10, 0.75);
}

.cultural-context--mola {
    background: linear-gradient(135deg, rgba(255, 179, 0, 0.08), rgba(17, 128, 43, 0.06));
    padding: 2rem;
    border-radius: 16px;
    border-left: 4px solid var(--guna-sun);
    margin: 2rem 0;
}

.cultural-context--mola h3 {
    color: var(--guna-earth);
    margin-bottom: 0.75rem;
}

/* Lesson viewer enhancements */
.guna-lesson-viewer {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Cultural context styling */
.cultural-context {
    background: linear-gradient(135deg, rgba(255, 179, 0, 0.08), rgba(17, 128, 43, 0.06));
    padding: 2rem;
    border-radius: 16px;
    border-left: 4px solid var(--guna-sun);
    margin: 2rem 0;
}

.cultural-highlights {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.highlight-item {
    background: white;
    padding: 1rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.highlight-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(17, 128, 43, 0.18);
    border-color: var(--guna-primary);
}

.highlight-item i {
    color: var(--guna-primary);
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    display: block;
}

/* Vocabulary table enhancements */
.vocabulary-table table {
    border: none;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.vocabulary-table th {
    background: var(--guna-gradient-primary);
    color: white;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.9rem;
}

.vocabulary-table td {
    padding: 1.25rem 1rem;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.3s ease;
}

.vocabulary-table tr:hover td {
    background: rgba(17, 128, 43, 0.06);
}

.vocabulary-table td:first-child {
    font-weight: 600;
    color: var(--guna-primary);
    font-size: 1.1rem;
}

/* Pronunciation tips styling */
.pronunciation-tips {
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.05), rgba(255, 138, 101, 0.05));
    border-left: 4px solid var(--guna-accent);
    padding: 2rem;
    border-radius: 12px;
    margin-top: 2rem;
}

.pronunciation-tips h4 {
    color: var(--guna-accent);
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.pronunciation-tips li {
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(255, 107, 53, 0.1);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pronunciation-tips li:last-child {
    border-bottom: none;
}

.pronunciation-tips li::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--guna-sun);
    flex-shrink: 0;
}

/* Quiz enhancements */
.quiz-question {
    background: white;
    padding: 2.5rem;
    border-radius: 16px;
    margin-bottom: 2rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.quiz-question:hover {
    border-color: var(--guna-primary);
    transform: translateY(-2px);
}

.quiz-question h4 {
    color: var(--guna-primary);
    font-size: 1.3rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.quiz-question h4::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 2px;
    background: var(--guna-sun);
    flex-shrink: 0;
}

.quiz-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.quiz-option {
    padding: 1.25rem;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 1rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.quiz-option::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transition: left 0.5s ease;
}

.quiz-option:hover::before {
    left: 100%;
}

.quiz-option:hover {
    background: var(--guna-primary);
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(17, 128, 43, 0.28);
    border-color: var(--guna-primary);
}

.quiz-option.selected {
    background: var(--guna-gradient-primary);
    color: white;
    border-color: var(--guna-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(17, 128, 43, 0.25);
}

.quiz-option.correct {
    background: var(--guna-gradient-success);
    color: white;
    border-color: var(--guna-success);
    animation: correctPulse 0.6s ease;
}

.quiz-option.incorrect {
    background: linear-gradient(135deg, var(--guna-danger), #c0392b);
    color: white;
    border-color: var(--guna-danger);
    animation: incorrectShake 0.6s ease;
}

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

@keyframes incorrectShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Matching exercise styling */
.matching-exercise {
    background: white;
    padding: 2.5rem;
    border-radius: 16px;
    margin-top: 1.5rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.matching-pairs {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.matching-item {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 12px;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
}

.matching-item:hover {
    background: rgba(255, 179, 0, 0.08);
    border-color: var(--guna-sun);
}

.guna-text {
    font-weight: 700;
    color: var(--guna-primary);
    font-size: 1.2rem;
    min-width: 150px;
    text-align: center;
    padding: 0.5rem 1rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.matching-select {
    padding: 0.75rem 1rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    background: white;
    font-size: 1rem;
    font-weight: 500;
    min-width: 200px;
    transition: all 0.3s ease;
}

.matching-select:focus {
    outline: none;
    border-color: var(--guna-primary);
    box-shadow: 0 0 0 3px rgba(0, 163, 224, 0.1);
}

.check-matching-btn {
    padding: 1rem 2rem;
    background: var(--guna-gradient-primary);
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(0, 163, 224, 0.3);
}

.check-matching-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 163, 224, 0.4);
}

/* Conversation scenarios */
.conversation-scenarios {
    margin: 2rem 0;
}

.scenario {
    background: white;
    padding: 2.5rem;
    border-radius: 16px;
    margin-bottom: 2rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    border-left: 4px solid var(--guna-primary);
}

.scenario h4 {
    color: var(--guna-primary);
    font-size: 1.3rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.scenario h4::before {
    content: '💬';
    font-size: 1.5rem;
}

.scenario-content p {
    margin-bottom: 1rem;
    font-size: 1.1rem;
    line-height: 1.6;
}

.scenario-options {
    display: flex;
    gap: 1rem;
    margin: 1.5rem 0;
    flex-wrap: wrap;
}

.scenario-option {
    padding: 1rem 1.5rem;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 1rem;
}

.scenario-option:hover {
    background: var(--guna-primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 163, 224, 0.3);
    border-color: var(--guna-primary);
}

.scenario-option.selected {
    background: var(--guna-gradient-primary);
    color: white;
    border-color: var(--guna-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 163, 224, 0.3);
}

.scenario-response {
    background: rgba(0, 163, 224, 0.05);
    padding: 1.5rem;
    border-radius: 12px;
    margin-top: 1rem;
    border-left: 4px solid var(--guna-primary);
    animation: slideIn 0.5s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Lesson summary styling */
.lesson-summary {
    text-align: left;
}

.summary-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.learned-greetings,
.cultural-notes,
.next-steps {
    background: white;
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    border-top: 4px solid var(--guna-primary);
    transition: all 0.3s ease;
}

.learned-greetings:hover,
.cultural-notes:hover,
.next-steps:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}

.learned-greetings h4,
.cultural-notes h4,
.next-steps h4 {
    color: var(--guna-primary);
    font-size: 1.3rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.learned-greetings h4::before,
.cultural-notes h4::before,
.next-steps h4::before {
    content: '';
    width: 4px;
    height: 1.1em;
    border-radius: 2px;
    background: var(--guna-mola-stripe);
    flex-shrink: 0;
}

.learned-greetings li::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--guna-green);
    flex-shrink: 0;
}

.learned-greetings ul,
.cultural-notes ul,
.next-steps ul {
    list-style: none;
    padding: 0;
}

.learned-greetings li,
.cultural-notes li,
.next-steps li {
    padding: 0.75rem 0;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.learned-greetings li:last-child,
.cultural-notes li:last-child,
.next-steps li:last-child {
    border-bottom: none;
}

.cultural-notes li::before,
.next-steps li::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--guna-sun);
    flex-shrink: 0;
}

/* Lesson completion buttons */
.lesson-completion {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 3rem;
}

.complete-lesson-btn,
.review-lesson-btn {
    padding: 1.25rem 2.5rem;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.complete-lesson-btn {
    background: var(--guna-gradient-success);
    color: white;
    box-shadow: 0 4px 16px rgba(46, 204, 113, 0.3);
}

.complete-lesson-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(46, 204, 113, 0.4);
}

.review-lesson-btn {
    background: #f8f9fa;
    color: var(--guna-primary);
    border: 2px solid var(--guna-primary);
}

.review-lesson-btn:hover {
    background: var(--guna-primary);
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 163, 224, 0.3);
}

/* Quiz results styling */
.quiz-results {
    background: white;
    padding: 3rem;
    border-radius: 16px;
    text-align: center;
    margin-top: 2rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    border: 2px solid var(--guna-success);
}

.quiz-results h4 {
    color: var(--guna-success);
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
}

.results-summary {
    margin: 2rem 0;
}

.results-summary p {
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

.correct-answers {
    color: var(--guna-success);
    font-weight: 700;
    font-size: 1.5rem;
}

.total-questions {
    color: var(--guna-primary);
    font-weight: 700;
    font-size: 1.5rem;
}

.quiz-results .progress-bar {
    width: 100%;
    height: 25px;
    background: #f0f0f0;
    border-radius: 12px;
    overflow: hidden;
    margin: 1.5rem 0;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.progress-fill {
    height: 100%;
    background: var(--guna-gradient-success);
    transition: width 1s ease;
    border-radius: 12px;
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Responsive design */
@media (max-width: 768px) {
    .cultural-highlights {
        grid-template-columns: 1fr;
    }
    
    .quiz-options {
        grid-template-columns: 1fr;
    }
    
    .matching-item {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .guna-text {
        min-width: auto;
        width: 100%;
    }
    
    .matching-select {
        min-width: auto;
        width: 100%;
    }
    
    .scenario-options {
        flex-direction: column;
    }
    
    .summary-content {
        grid-template-columns: 1fr;
    }
    
    .lesson-completion {
        flex-direction: column;
        align-items: center;
    }
    
    .complete-lesson-btn,
    .review-lesson-btn {
        width: 100%;
        max-width: 300px;
    }
}

/* Loading animation for lesson content */
.lesson-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    text-align: center;
    padding: 4rem 2rem;
}

.lesson-loading::before {
    content: '';
    width: 50px;
    height: 50px;
    border: 4px solid #f0f0f0;
    border-top: 4px solid var(--guna-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 2rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Accessibility improvements */
.quiz-option:focus,
.scenario-option:focus,
.matching-select:focus {
    outline: 2px solid var(--guna-primary);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .quiz-option,
    .scenario-option {
        border-width: 3px;
    }
    
    .vocabulary-table th {
        background: #000;
        color: #fff;
    }
    
    .quiz-option.correct {
        background: #000;
        color: #fff;
    }
    
    .quiz-option.incorrect {
        background: #000;
        color: #fff;
    }
}

.flashcard-deck { text-align: center; padding: 1rem; }
.flashcard {
    min-height: 200px; margin: 0 auto 1rem; max-width: 360px;
    background: white; border-radius: 16px; padding: 2rem;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1); cursor: pointer;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    border: 3px solid var(--guna-primary, #00A3E0);
}
.flashcard-icon { font-size: 3rem; }
.flashcard-guna { font-size: 2rem; color: var(--guna-primary); margin: 0.5rem 0; }
.flashcard-controls { display: flex; align-items: center; justify-content: center; gap: 1rem; }
.flashcard-btn, .flashcard-speak {
    width: 44px; height: 44px; border: none; border-radius: 50%;
    background: var(--guna-primary); color: white; cursor: pointer;
}
.pronunciation-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 0.75rem; }
.pronunciation-card {
    padding: 1rem; border: 2px solid #e0e0e0; border-radius: 12px;
    background: white; cursor: pointer; text-align: center;
}
.drag-drop-exercise { margin: 1.5rem 0; padding: 1.5rem; background: white; border-radius: 12px; }
.drag-items { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.5rem; }
.drag-item {
    padding: 0.75rem 1.25rem; background: var(--guna-primary); color: white;
    border-radius: 10px; cursor: grab; font-weight: 600;
}
.drop-zones { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0.75rem; }
.drop-zone { border: 2px dashed #ccc; border-radius: 12px; padding: 0.75rem; min-height: 80px; text-align: center; }
.drop-label { display: block; font-size: 0.85rem; color: #666; margin-bottom: 0.5rem; }
.check-drag-btn, .check-matching-btn {
    margin-top: 1rem; padding: 0.75rem 1.5rem; background: var(--guna-primary);
    color: white; border: none; border-radius: 10px; cursor: pointer; font-weight: 600;
}
.pronounce-btn {
    padding: 0.35rem 0.75rem; border: 1px solid var(--guna-primary);
    background: transparent; color: var(--guna-primary); border-radius: 8px; cursor: pointer;
}

/* Vocabulary card images */
.vocab-card-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 1rem;
    border: 2px solid var(--guna-primary);
}

/* Flashcard images */
.vocab-flashcard-image {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 1rem;
    border: 2px solid var(--guna-primary);
}

/* Memory match card images */
.card-image {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    border: 2px solid rgba(255,255,255,0.3);
}
