/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --sakura-pink: #ffb7c5;
    --sakura-light: #ffd6e0;
    --sakura-dark: #ff91a4;
    --text-dark: #4a4a4a;
    --text-light: #666;
    --background: #fff5f7;
    --card-background: #ffffff;
    --shadow: rgba(255, 145, 164, 0.2);
    --hover-shadow: rgba(255, 145, 164, 0.4);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, var(--background) 0%, #ffe4ec 100%);
    color: var(--text-dark);
    min-height: 100vh;
    line-height: 1.6;
}

/* Sakura petals animation */
.sakura-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.sakura {
    position: absolute;
    width: 20px;
    height: 20px;
    background: radial-gradient(ellipse at center, var(--sakura-pink) 0%, var(--sakura-light) 100%);
    border-radius: 50% 0 50% 0;
    opacity: 0.6;
    animation: fall linear infinite;
}

.sakura:nth-child(1) {
    left: 10%;
    animation-duration: 15s;
    animation-delay: 0s;
}

.sakura:nth-child(2) {
    left: 30%;
    animation-duration: 12s;
    animation-delay: 2s;
}

.sakura:nth-child(3) {
    left: 50%;
    animation-duration: 18s;
    animation-delay: 4s;
}

.sakura:nth-child(4) {
    left: 70%;
    animation-duration: 14s;
    animation-delay: 1s;
}

.sakura:nth-child(5) {
    left: 90%;
    animation-duration: 16s;
    animation-delay: 3s;
}

@keyframes fall {
    0% {
        top: -10%;
        transform: translateX(0) rotate(0deg);
    }
    50% {
        transform: translateX(50px) rotate(180deg);
    }
    100% {
        top: 110%;
        transform: translateX(-50px) rotate(360deg);
    }
}

/* Main container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 1;
}

/* Header */
header {
    text-align: center;
    padding: 40px 20px;
    background: var(--card-background);
    border-radius: 20px;
    box-shadow: 0 8px 30px var(--shadow);
    margin-bottom: 30px;
}

h1 {
    font-size: 3rem;
    color: var(--sakura-dark);
    margin-bottom: 10px;
    font-weight: 700;
}

.subtitle {
    font-size: 1.5rem;
    color: var(--text-light);
    margin-bottom: 10px;
}

.description {
    font-size: 1rem;
    color: var(--text-light);
    max-width: 600px;
    margin: 0 auto;
}

/* Input section */
.input-section {
    background: var(--card-background);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 4px 20px var(--shadow);
    margin-bottom: 30px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Input mode selector styles */
.input-mode-selector {
    display: flex;
    gap: 20px;
    padding: 10px;
    background: var(--sakura-light);
    border-radius: 10px;
    justify-content: center;
}

.input-mode-selector label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    padding: 8px 15px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.input-mode-selector label:hover {
    background: rgba(255, 255, 255, 0.5);
}

.input-mode-selector input[type="radio"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

label {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-dark);
}

input[type="text"] {
    padding: 15px 20px;
    font-size: 1.1rem;
    border: 2px solid var(--sakura-light);
    border-radius: 10px;
    outline: none;
    transition: all 0.3s ease;
}

input[type="text"]:focus {
    border-color: var(--sakura-pink);
    box-shadow: 0 0 0 3px rgba(255, 183, 197, 0.2);
}

/* Buttons */
.primary-btn, .secondary-btn {
    padding: 15px 30px;
    font-size: 1.1rem;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.primary-btn {
    background: linear-gradient(135deg, var(--sakura-pink) 0%, var(--sakura-dark) 100%);
    color: white;
    box-shadow: 0 4px 15px var(--shadow);
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--hover-shadow);
}

.secondary-btn {
    background: var(--card-background);
    color: var(--sakura-dark);
    border: 2px solid var(--sakura-pink);
}

.secondary-btn:hover {
    background: var(--sakura-light);
}

/* Syllables section */
.syllables-section {
    background: var(--card-background);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 4px 20px var(--shadow);
    margin-bottom: 30px;
}

.syllables-section h2 {
    color: var(--sakura-dark);
    margin-bottom: 10px;
    font-size: 2rem;
}

.hint {
    color: var(--text-light);
    margin-bottom: 20px;
    font-style: italic;
}

#syllablesContainer {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.syllable-group {
    border: 2px solid var(--sakura-light);
    border-radius: 15px;
    padding: 20px;
    background: linear-gradient(to bottom, #ffffff 0%, var(--background) 100%);
}

.syllable-header {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--sakura-dark);
    margin-bottom: 15px;
    text-align: center;
}

.kanji-options-section {
    margin-bottom: 20px;
}

.kanji-options-section:last-child {
    margin-bottom: 0;
}

.section-label {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 2px solid var(--sakura-light);
}

.kanji-options {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 15px;
}

.kanji-card {
    background: white;
    border: 2px solid var(--sakura-light);
    border-radius: 10px;
    padding: 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.kanji-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 15px var(--hover-shadow);
    border-color: var(--sakura-pink);
}

.kanji-card.selected {
    background: linear-gradient(135deg, var(--sakura-light) 0%, var(--sakura-pink) 100%);
    border-color: var(--sakura-dark);
    box-shadow: 0 4px 15px var(--hover-shadow);
}

.favorite-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 5px;
    transition: all 0.2s ease;
}

.favorite-btn:hover {
    transform: scale(1.2);
}

.favorite-btn.favorited {
    color: #ffd700;
}

.kanji-character {
    font-size: 3rem;
    font-weight: 700;
    color: var(--text-dark);
    margin: 10px 0;
    line-height: 1;
}

.kanji-card.selected .kanji-character {
    color: var(--sakura-dark);
}

.kanji-romaji {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 5px;
}

.kanji-meaning {
    font-size: 0.85rem;
    color: var(--text-light);
    font-style: italic;
}

/* Result section */
.result-section {
    background: var(--card-background);
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 4px 20px var(--shadow);
    margin-bottom: 30px;
    text-align: center;
}

.result-section h2 {
    color: var(--sakura-dark);
    margin-bottom: 30px;
    font-size: 2rem;
}

.result-display {
    background: linear-gradient(135deg, var(--sakura-light) 0%, #ffffff 100%);
    padding: 40px;
    border-radius: 15px;
    margin-bottom: 30px;
    border: 3px solid var(--sakura-pink);
}

.kanji-result {
    font-size: 5rem;
    font-weight: 700;
    color: var(--sakura-dark);
    margin-bottom: 20px;
    line-height: 1.2;
    letter-spacing: 10px;
}

.romaji-result {
    font-size: 1.5rem;
    color: var(--text-light);
    margin-bottom: 15px;
}

.meaning-result {
    font-size: 1.2rem;
    color: var(--text-dark);
    font-style: italic;
    line-height: 1.8;
}

/* Footer */
footer {
    text-align: center;
    padding: 30px 20px;
    color: var(--text-light);
}

/* Utility classes */
.hidden {
    display: none !important;
}

/* Responsive design */
@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 1.2rem;
    }

    .kanji-options {
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
        gap: 10px;
    }

    .kanji-character {
        font-size: 2.5rem;
    }

    .kanji-result {
        font-size: 3.5rem;
        letter-spacing: 5px;
    }

    .result-display {
        padding: 25px;
    }

    .input-section, .syllables-section, .result-section {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 1.5rem;
    }

    .kanji-options {
        grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    }

    .kanji-character {
        font-size: 2rem;
    }

    .kanji-result {
        font-size: 2.5rem;
        letter-spacing: 3px;
    }
}
/* Language Selector Styles - Add to existing styles.css */

.language-selector {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-top: 5px;
}

.language-dropdown {
    padding: 10px 15px;
    font-size: 1rem;
    border: 2px solid var(--sakura-light);
    border-radius: 8px;
    background: white;
    color: var(--text-dark);
    cursor: pointer;
    outline: none;
    transition: all 0.3s ease;
}

.language-dropdown:hover {
    border-color: var(--sakura-pink);
}

.language-dropdown:focus {
    border-color: var(--sakura-pink);
    box-shadow: 0 0 0 3px rgba(255, 183, 197, 0.2);
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .language-selector {
        font-size: 0.85rem;
    }
    
    .language-dropdown {
        padding: 8px 12px;
        font-size: 0.9rem;
    }
}
