/* css/spell.css */
/* Styles for the Spell Flashcard Interactive Mode */

#cards-container.spell-view {
    display: block;
}

.spell-flashcard-container {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: 0 8px 32px var(--shadow-color);
    max-width: 800px;
    margin: 0 auto;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 2rem;
    animation: fadeIn 0.4s ease-out;
}

.spell-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.spell-word-display {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
    flex: 1;
}

.spell-phoneme-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    background: rgba(255, 255, 255, 0.03);
    padding: 1.2rem;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    transition: transform 0.2s, box-shadow 0.2s;
    min-width: 80px;
}

[data-theme="light"] .spell-phoneme-group {
    background: rgba(0, 0, 0, 0.02);
}

.spell-phoneme-group:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px var(--shadow-color);
}

.spell-grapheme {
    font-size: 4rem;
    font-weight: 800;
    color: var(--text-color);
    line-height: 1;
    font-family: 'Montserrat', sans-serif;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

[data-theme="light"] .spell-grapheme {
    text-shadow: none;
}

.spell-audio-btn {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: none;
    background: #FF9B54; /* Orange default */
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 10px rgba(255, 155, 84, 0.3);
}

.spell-audio-btn.main-phoneme {
    background: #FF5A36; /* Darker/brighter orange for main */
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(255, 90, 54, 0.4);
}

.spell-audio-btn:hover {
    transform: scale(1.15);
    background: #FFB37A;
}

.spell-audio-btn.main-phoneme:hover {
    transform: scale(1.2);
    background: #FF7556;
}

.spell-audio-btn svg, .spell-full-audio-btn svg, .spell-next-btn svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

.spell-controls {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    justify-content: center;
}

.spell-full-audio-btn, .spell-next-btn {
    width: 65px;
    height: 65px;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: white;
}

.spell-full-audio-btn {
    background: var(--accent-color);
    box-shadow: 0 6px 16px rgba(100, 108, 255, 0.4);
}

.spell-full-audio-btn:hover {
    transform: scale(1.1) translateY(-2px);
    box-shadow: 0 8px 20px rgba(100, 108, 255, 0.6);
}

.spell-next-btn {
    background: var(--secondary-color);
    box-shadow: 0 6px 16px rgba(66, 184, 131, 0.4);
}

.spell-next-btn:hover {
    transform: scale(1.1) translateY(-2px);
    box-shadow: 0 8px 20px rgba(66, 184, 131, 0.6);
}

.spell-ipa-section {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    padding: 1.5rem;
    border-radius: 12px;
}

[data-theme="light"] .spell-ipa-section {
    background: rgba(0, 0, 0, 0.03);
}

.spell-ipa-text {
    font-size: 2.5rem;
    font-weight: 700;
    color: #FFD166; /* Standout color */
    font-family: 'Inter', sans-serif;
    letter-spacing: 2px;
}

[data-theme="light"] .spell-ipa-text {
    color: #E69B00;
}

.spell-accent-flag {
    font-size: 2.2rem;
}

.spell-translation {
    font-size: 1.5rem;
    color: var(--text-muted);
    font-style: italic;
    font-weight: 600;
}

.spell-mechanism {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 16px;
    padding: 2.5rem;
    border: 1px solid var(--border-color);
}

[data-theme="light"] .spell-mechanism {
    background: #ffffff;
}

.mechanism-title {
    font-size: 1.6rem;
    color: var(--text-color);
    margin-top: 0;
    margin-bottom: 2rem;
    text-align: center;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.mechanism-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}

.mechanism-img {
    width: 100%;
    max-width: 320px;
    height: auto;
    border-radius: 16px;
    margin: 0 auto;
    display: block;
    box-shadow: 0 6px 20px var(--shadow-color);
    border: 3px solid var(--border-color);
}

.mechanism-info {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.mechanism-desc {
    font-size: 1.2rem;
    line-height: 1.7;
    color: var(--text-muted);
}

.mechanism-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.mechanism-tag {
    background: var(--accent-light);
    color: var(--accent-color);
    padding: 0.6rem 1.2rem;
    border-radius: 20px;
    font-size: 1rem;
    font-weight: 700;
    border: 1px solid var(--accent-color);
    transition: all 0.2s;
}

[data-theme="dark"] .mechanism-tag {
    background: rgba(100, 108, 255, 0.2);
    color: #9b9eff;
    border-color: #9b9eff;
}

.mechanism-tag:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(100, 108, 255, 0.2);
}

.spell-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    margin-top: 1rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.spell-page-btn {
    background: transparent;
    border: 2px solid var(--border-color);
    color: var(--text-color);
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.spell-page-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--text-color);
}

[data-theme="light"] .spell-page-btn:hover:not(:disabled) {
    background: rgba(0, 0, 0, 0.05);
}

.spell-page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.spell-page-info {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--text-muted);
    letter-spacing: 2px;
}

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

@media (max-width: 768px) {
    .mechanism-content {
        grid-template-columns: 1fr;
    }
    
    .spell-controls {
        flex-wrap: wrap;
    }

    .spell-header {
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .spell-ipa-section {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .spell-ipa-text {
        font-size: 2rem;
    }
    
    .spell-grapheme {
        font-size: 2.5rem;
    }

    .spell-flashcard-container {
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .spell-grapheme { font-size: 2rem; }
    .spell-ipa-text { font-size: 1.5rem; }
    .spell-full-audio-btn, .spell-next-btn {
        width: 50px; height: 50px;
    }
    .spell-audio-btn {
        width: 35px; height: 35px;
    }
    .mechanism-info { gap: 1rem; }
    .spell-page-btn { padding: 0.6rem 1rem; font-size: 0.9rem; }
}
