* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 900px;
    margin: 0 auto;
}

header {
    text-align: center;
    color: white;
    margin-bottom: 30px;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
}

.category-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-bottom: 20px;
}

.cat-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 25px;
    background: rgba(255,255,255,0.2);
    color: white;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 1rem;
}

.cat-btn:hover, .cat-btn.active {
    background: white;
    color: #667eea;
    transform: scale(1.05);
}

.mode-toggle {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 25px;
}

.mode-btn {
    padding: 12px 30px;
    border: 2px solid white;
    border-radius: 30px;
    background: transparent;
    color: white;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.3s;
}

.mode-btn:hover, .mode-btn.active {
    background: white;
    color: #667eea;
}

main {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.phrase-card {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
}

.phrase-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.3);
}

.phrase-card .category-tag {
    display: inline-block;
    padding: 5px 12px;
    background: #667eea;
    color: white;
    border-radius: 15px;
    font-size: 0.8rem;
    margin-bottom: 15px;
}

.phrase-card .japanese {
    font-size: 1.8rem;
    color: #333;
    margin-bottom: 10px;
    line-height: 1.4;
}

.phrase-card .romaji {
    font-size: 1.1rem;
    color: #888;
    margin-bottom: 15px;
    font-style: italic;
}

.phrase-card .korean {
    font-size: 1.2rem;
    color: #667eea;
    padding-top: 15px;
    border-top: 2px dashed #eee;
    opacity: 0;
    transition: opacity 0.3s;
}

.phrase-card.revealed .korean {
    opacity: 1;
}

.phrase-card .breakdown {
    font-size: 0.9rem;
    color: #764ba2;
    background: linear-gradient(135deg, #f3e7ff 0%, #e8d5ff 100%);
    padding: 10px 12px;
    border-radius: 8px;
    margin-top: 12px;
    line-height: 1.5;
    font-weight: 500;
    border-left: 3px solid #764ba2;
    opacity: 0;
    transition: opacity 0.3s;
}

.phrase-card.revealed .breakdown {
    opacity: 1;
}

.phrase-card .context {
    font-size: 0.95rem;
    color: #666;
    background: #f8f9fa;
    padding: 12px;
    border-radius: 10px;
    margin-top: 12px;
    line-height: 1.5;
    opacity: 0;
    transition: opacity 0.3s;
}

.phrase-card.revealed .context {
    opacity: 1;
}

.phrase-card .speak-btn {
    margin-top: 15px;
    padding: 8px 20px;
    background: #ff6b6b;
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.3s;
}

.phrase-card .speak-btn:hover {
    background: #ee5a5a;
}

.hidden {
    display: none !important;
}

/* Quiz Mode */
#quizArea {
    max-width: 600px;
    margin: 0 auto;
}

.quiz-card {
    background: white;
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.quiz-question {
    font-size: 2rem;
    color: #333;
    margin-bottom: 30px;
    line-height: 1.5;
}

.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.quiz-option {
    padding: 15px 25px;
    border: 2px solid #667eea;
    border-radius: 10px;
    background: white;
    color: #667eea;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.3s;
}

.quiz-option:hover {
    background: #667eea;
    color: white;
}

.quiz-option.correct {
    background: #2ecc71;
    border-color: #2ecc71;
    color: white;
}

.quiz-option.wrong {
    background: #e74c3c;
    border-color: #e74c3c;
    color: white;
}

.quiz-result {
    margin-top: 20px;
    font-size: 1.3rem;
    font-weight: bold;
}

.quiz-result.correct {
    color: #2ecc71;
}

.quiz-result.wrong {
    color: #e74c3c;
}

.next-btn {
    margin-top: 25px;
    padding: 12px 30px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: background 0.3s;
}

.next-btn:hover {
    background: #5a6fd6;
}

.quiz-score {
    text-align: center;
    margin-top: 25px;
    color: white;
    font-size: 1.5rem;
}

/* Schedule Mode */
#scheduleArea {
    max-width: 700px;
    margin: 0 auto;
}

.schedule-header {
    text-align: center;
    color: white;
    margin-bottom: 25px;
}

.schedule-header h2 {
    font-size: 1.8rem;
    margin-bottom: 8px;
}

.schedule-header p {
    opacity: 0.9;
}

.schedule-progress {
    background: rgba(255,255,255,0.2);
    border-radius: 20px;
    padding: 15px 20px;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.progress-bar {
    flex: 1;
    height: 12px;
    background: rgba(255,255,255,0.3);
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #2ecc71, #27ae60);
    border-radius: 10px;
    transition: width 0.5s ease;
}

.progress-text {
    color: white;
    font-weight: bold;
    white-space: nowrap;
}

.schedule-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.schedule-item {
    background: white;
    border-radius: 15px;
    padding: 20px;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    gap: 20px;
    align-items: center;
}

.schedule-item:hover {
    transform: translateX(10px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.schedule-item.completed {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border-left: 5px solid #2ecc71;
}

.schedule-item.today {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeeba 100%);
    border-left: 5px solid #ffc107;
}

.schedule-item.missed {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    border-left: 5px solid #dc3545;
}

.schedule-day {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 80px;
}

.day-number {
    font-size: 1.2rem;
    font-weight: bold;
    color: #667eea;
}

.day-date {
    font-size: 0.85rem;
    color: #888;
    margin-top: 4px;
}

.day-status {
    font-size: 1.5rem;
    margin-top: 8px;
}

.schedule-content {
    flex: 1;
}

.schedule-content h3 {
    font-size: 1.2rem;
    color: #333;
    margin-bottom: 8px;
}

.phrase-count {
    font-size: 0.9rem;
    color: #667eea;
    font-weight: 500;
}

.day-goal {
    font-size: 0.85rem;
    color: #666;
    margin-top: 5px;
}

/* Day Study Area */
#dayStudyArea {
    max-width: 800px;
    margin: 0 auto;
}

.back-btn {
    background: rgba(255,255,255,0.2);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 1rem;
    margin-bottom: 20px;
    transition: background 0.3s;
}

.back-btn:hover {
    background: rgba(255,255,255,0.3);
}

.day-header {
    background: white;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.day-info h2 {
    font-size: 1.5rem;
    color: #333;
    margin-bottom: 5px;
}

.day-date-large {
    color: #667eea;
    font-size: 1.1rem;
}

.day-tip {
    background: #fff3cd;
    padding: 15px;
    border-radius: 10px;
    margin-top: 15px;
    color: #856404;
}

.day-goal-box {
    background: #e8f4fd;
    padding: 15px;
    border-radius: 10px;
    margin-top: 10px;
    color: #0c5460;
}

.day-phrases {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.day-card {
    background: white;
}

.day-actions {
    text-align: center;
    margin-top: 20px;
}

.complete-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 30px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
}

.complete-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.complete-btn.completed {
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
    cursor: default;
}

/* Celebration Animation */
.celebration {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 40px 60px;
    border-radius: 20px;
    font-size: 2rem;
    font-weight: bold;
    color: #667eea;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: celebrate 0.5s ease;
    z-index: 1000;
}

@keyframes celebrate {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.2);
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 600px) {
    header h1 {
        font-size: 1.8rem;
    }

    .phrase-card .japanese {
        font-size: 1.5rem;
    }

    .quiz-question {
        font-size: 1.5rem;
    }

    .mode-toggle {
        flex-wrap: wrap;
    }

    .mode-btn {
        padding: 10px 20px;
        font-size: 1rem;
    }

    .schedule-item {
        flex-direction: column;
        text-align: center;
    }

    .schedule-day {
        flex-direction: row;
        gap: 15px;
    }
}
