/**
 * English Gems - Main Styles
 * Treasure hunter aesthetic with gradient designs
 */

/* Reset and Base */
#english-gems-app {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: #1F2937;
    line-height: 1.6;
}

#english-gems-app * {
    box-sizing: border-box;
}

/* Animations */
@keyframes gemPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

@keyframes shimmer {
    0% { background-position: -1000px 0; }
    100% { background-position: 1000px 0; }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Gem Cards */
.eg-gem-card {
    background: white;
    border-radius: 15px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.eg-gem-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(139,92,246,0.2);
    border-color: #8B5CF6;
}

.eg-gem-card.mastered {
    background: linear-gradient(135deg, #FEF3C7, #FDE68A);
    border-color: #F59E0B;
}

.eg-gem-card.mastered::before {
    content: '✨';
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 1.5em;
}

/* Section Cards */
.eg-section-card {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
}

.eg-section-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
}

.eg-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.eg-section-icon {
    font-size: 2.5em;
    margin-right: 15px;
}

.eg-section-title {
    font-size: 1.4em;
    color: #1F2937;
    margin: 0;
}

.eg-section-progress {
    font-size: 1.8em;
    font-weight: bold;
    color: #8B5CF6;
}

/* Progress Bars */
.eg-progress-bar {
    background: #E5E7EB;
    height: 20px;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.eg-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #8B5CF6, #EC4899);
    transition: width 1s ease;
    border-radius: 10px;
}

/* Badge System */
.eg-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #F59E0B, #F97316);
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: bold;
    box-shadow: 0 4px 12px rgba(245,158,11,0.3);
}

.eg-badge-icon {
    font-size: 1.3em;
}

.eg-badge.locked {
    background: #9CA3AF;
    opacity: 0.6;
}

/* Concept Detail Modal */
.eg-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 9999;
    overflow-y: auto;
    animation: fadeInUp 0.3s ease;
}

.eg-modal-content {
    background: white;
    max-width: 900px;
    margin: 30px auto;
    border-radius: 20px;
    overflow: hidden;
}

.eg-modal-header {
    background: linear-gradient(135deg, #8B5CF6, #EC4899);
    color: white;
    padding: 30px;
    text-align: center;
}

.eg-modal-body {
    padding: 40px;
}

.eg-close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 2em;
    color: white;
    cursor: pointer;
    background: none;
    border: none;
    padding: 10px;
    line-height: 1;
}

/* Example Lists */
.eg-examples-list {
    list-style: none;
    padding: 0;
    margin: 20px 0;
}

.eg-example-item {
    background: #F9FAFB;
    padding: 15px;
    border-left: 4px solid #8B5CF6;
    border-radius: 8px;
    margin-bottom: 10px;
}

.eg-example-text {
    font-size: 1.1em;
    color: #374151;
    margin-bottom: 5px;
}

.eg-example-explanation {
    font-size: 0.95em;
    color: #6B7280;
    font-style: italic;
}

/* Quiz Section */
.eg-quiz-question {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.eg-quiz-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 20px 0;
}

.eg-quiz-option {
    padding: 15px 20px;
    background: #F3F4F6;
    border: 2px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.eg-quiz-option:hover {
    background: #E5E7EB;
    border-color: #8B5CF6;
}

.eg-quiz-option.correct {
    background: #D1FAE5;
    border-color: #10B981;
}

.eg-quiz-option.incorrect {
    background: #FEE2E2;
    border-color: #EF4444;
}

/* Buttons */
.eg-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.eg-btn-primary {
    background: linear-gradient(135deg, #8B5CF6, #EC4899);
    color: white;
    box-shadow: 0 4px 15px rgba(139,92,246,0.3);
}

.eg-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139,92,246,0.4);
}

.eg-btn-secondary {
    background: #F3F4F6;
    color: #374151;
}

.eg-btn-secondary:hover {
    background: #E5E7EB;
}

/* Streak Display */
.eg-streak-indicator {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #F59E0B, #F97316);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: bold;
}

.eg-streak-flame {
    font-size: 1.5em;
    animation: gemPulse 1.5s infinite;
}

/* Loading State */
.eg-loading {
    text-align: center;
    padding: 60px;
    font-size: 1.2em;
    color: #9CA3AF;
}

.eg-loading::after {
    content: '...';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

/* Responsive Design */
@media (max-width: 768px) {
    .eg-sections-grid {
        grid-template-columns: 1fr !important;
    }

    .eg-gems-grid {
        grid-template-columns: 1fr !important;
    }

    .eg-modal-content {
        margin: 10px;
    }

    .eg-modal-body {
        padding: 20px;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .eg-dark-mode #english-gems-app {
        color: #E5E7EB;
    }

    .eg-dark-mode .eg-gem-card,
    .eg-dark-mode .eg-section-card,
    .eg-dark-mode .eg-modal-content {
        background: #1F2937;
        color: #E5E7EB;
    }
}
