:root {
    --primary: #065f46;
    --primary-dark: #064e3b;
    --primary-light: #047857;
    --accent: #ea580c;
    --accent-dark: #c2410c;
    --accent-light: #fb923c;
    --success: #059669;
    --warning: #d97706;
    --danger: #dc2626;
    --secondary: #6b7280;
    --background: #f8fafc;
    --card-bg: #ffffff;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --border: #e5e7eb;
    --shadow: 0 4px 6px -1px rgba(6, 95, 70, 0.1);
    --shadow-hover: 0 10px 25px rgba(6, 95, 70, 0.15);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    padding-top: 80px;
}

/* Navbar Styles */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
    z-index: 1000;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
}

.logo {
    font-size: 28px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
    border: none;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.logo:hover {
    transform: scale(1.05);
}

.nav-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 16px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 12px;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.nav-btn:hover {
    background: rgba(6, 95, 70, 0.1);
    color: var(--primary);
    transform: translateY(-2px);
}

.nav-btn.active {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(6, 95, 70, 0.3);
}

.nav-icon {
    font-size: 20px;
    margin-bottom: 4px;
    transition: transform 0.3s ease;
}

.nav-btn:hover .nav-icon {
    transform: scale(1.1);
}

.nav-text {
    font-weight: 500;
    letter-spacing: 0.5px;
}

/* Section Styles */
.section {
    display: none;
    min-height: calc(100vh - 80px);
    padding: 40px 0;
}

.section.active {
    display: block;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

h1 {
    text-align: center;
    margin-bottom: 30px;
    color: var(--text-primary);
    font-size: 32px;
}

/* Welcome Section */
.welcome-section {
    text-align: center;
    margin-bottom: 40px;
    padding: 40px 20px;
    background: linear-gradient(135deg, rgba(6, 95, 70, 0.1), rgba(234, 88, 12, 0.05));
    border-radius: 20px;
    position: relative;
    overflow: hidden;
}

.welcome-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transform: translateX(-100%);
    animation: shimmer 3s infinite;
}

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

.welcome-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 15px;
    color: var(--text-primary);
    line-height: 1.2;
}

.brand-highlight {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.welcome-subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    font-weight: 400;
}

/* Card Styles */
.card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: var(--shadow);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Button Styles */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.2s;
    text-align: center;
    display: inline-block;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--secondary);
    color: white;
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-warning {
    background: var(--warning);
    color: white;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

/* Dashboard Styles */
.word-of-day-card {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 40px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(6, 95, 70, 0.1);
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease;
}

.word-of-day-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.card-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 25px;
    text-align: center;
}

.words-of-day-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 20px;
    margin-top: 20px;
}

.word-of-day {
    text-align: center;
    background: var(--background);
    border-radius: 15px;
    padding: 20px;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

.word-of-day:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(6, 95, 70, 0.1);
    border-color: var(--primary);
}

.word-display-main {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    gap: 15px;
}

.word-of-day .word {
    font-size: 1.8rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

.pronunciation-btn {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(6, 95, 70, 0.3);
}

.pronunciation-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(6, 95, 70, 0.4);
}

.sound-icon {
    font-size: 20px;
    filter: brightness(0) invert(1);
}

.word-details {
    margin-top: 15px;
}

.word-of-day .definition {
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 10px;
    font-weight: 600;
}

.word-of-day .example {
    font-style: italic;
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.4;
}

/* Quick Access Menu */
.quick-access {
    margin-bottom: 50px;
}

.quick-access h2 {
    text-align: center;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 30px;
}

.learning-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
}

.learning-card {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.learning-card:hover {
    transform: translateY(-8px);
    border-color: var(--primary);
    box-shadow: var(--shadow-hover);
}

.learning-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.learning-card:hover::before {
    opacity: 1;
}

.learning-icon {
    font-size: 3rem;
    margin-bottom: 15px;
    transition: transform 0.3s ease;
}

.learning-card:hover .learning-icon {
    transform: scale(1.2) rotate(5deg);
}

.learning-card h3 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.learning-card p {
    color: var(--text-secondary);
    margin-bottom: 12px;
    font-weight: 500;
}

.learning-description {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
    opacity: 0.8;
}

/* Stats Section */
.stats-section {
    margin-top: 50px;
}

.stats-section h2 {
    text-align: center;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 30px;
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
    max-width: 600px;
    margin: 0 auto;
}

.kpi-card {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 30px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--border);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.kpi-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.12);
}

.kpi-card.streak {
    border-left: 4px solid #ff6b6b;
}

.kpi-card.learned {
    border-left: 4px solid var(--success);
}

.kpi-card.reviews {
    border-left: 4px solid var(--warning);
}

.kpi-icon {
    font-size: 2.5rem;
    opacity: 0.8;
}

.kpi-content h3 {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-weight: 600;
}

.kpi-value {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 4px;
    line-height: 1;
}

.kpi-unit {
    font-size: 0.9rem;
    color: var(--text-secondary);
    opacity: 0.8;
}

/* Learning Section Styles */
.session-info {
    text-align: center;
    margin-bottom: 30px;
    padding: 15px;
    background: linear-gradient(135deg, rgba(6, 95, 70, 0.1), rgba(234, 88, 12, 0.05));
    border-radius: 12px;
    font-size: 18px;
    font-weight: 600;
    color: var(--primary);
}

/* Session Start Screen */
.session-start {
    text-align: center;
    padding: 50px 40px;
}

.session-welcome .session-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

.session-welcome h2 {
    font-size: 2rem;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.session-welcome p {
    color: var(--text-secondary);
    margin-bottom: 30px;
    font-size: 1.1rem;
}

.session-details {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 40px;
}

.detail-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px;
    background: var(--background);
    border-radius: 10px;
    color: var(--text-secondary);
}

.detail-icon {
    font-size: 1.2rem;
}

.session-start-btn {
    padding: 15px 30px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 12px;
}

/* Learning Card Styles */
.learning-card {
    padding: 40px;
    transition: all 0.3s ease;
}

.word-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--border);
}

.word-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 15px;
}

.learning-card .word {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.pronunciation-btn.enhanced {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border: none;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(6, 95, 70, 0.3);
}

.pronunciation-btn.enhanced:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(6, 95, 70, 0.4);
}

.sound-waves {
    font-size: 24px;
    filter: brightness(0) invert(1);
}

.word-meta {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.phonetic {
    font-size: 1.1rem;
    color: var(--text-secondary);
    font-family: 'Courier New', monospace;
    background: var(--background);
    padding: 8px 12px;
    border-radius: 8px;
}

.pos {
    font-size: 0.9rem;
    color: var(--primary);
    font-style: italic;
    text-transform: uppercase;
    letter-spacing: 1px;
    background: rgba(6, 95, 70, 0.1);
    padding: 8px 12px;
    border-radius: 8px;
    font-weight: 600;
}

.word-content {
    margin-bottom: 30px;
}

.definition-section,
.example-section {
    margin-bottom: 25px;
    padding: 20px;
    background: var(--background);
    border-radius: 12px;
    border-left: 4px solid var(--primary);
}

.definition-section h4,
.example-section h4 {
    font-size: 1rem;
    color: var(--primary);
    margin-bottom: 10px;
    font-weight: 600;
}

.learning-card .definition {
    font-size: 1.2rem;
    color: var(--text-primary);
    line-height: 1.6;
    font-weight: 500;
}

.learning-card .example {
    font-style: italic;
    color: var(--text-secondary);
    line-height: 1.6;
    font-size: 1rem;
}

.response-section {
    text-align: center;
}

.response-prompt {
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 20px;
    font-weight: 500;
}

.response-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.response-buttons .btn {
    padding: 15px 25px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 12px;
    transition: all 0.2s ease;
    min-width: 180px;
}

.response-buttons .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* Session Complete Screen */
.session-complete {
    text-align: center;
    padding: 50px 40px;
}

.complete-content .complete-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    animation: celebration 1s ease-in-out;
}

@keyframes celebration {
    0% { transform: scale(0.5) rotate(0deg); }
    50% { transform: scale(1.2) rotate(180deg); }
    100% { transform: scale(1) rotate(360deg); }
}

.complete-content h2 {
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 10px;
}

.complete-content p {
    color: var(--text-secondary);
    margin-bottom: 30px;
    font-size: 1.1rem;
}

.session-stats {
    display: flex;
    justify-content: space-around;
    margin-bottom: 40px;
    gap: 20px;
    flex-wrap: wrap;
}

.stat-item {
    text-align: center;
    padding: 20px;
    background: var(--background);
    border-radius: 12px;
    flex: 1;
    min-width: 120px;
}

.stat-number {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.complete-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.complete-actions .btn {
    padding: 12px 24px;
    font-weight: 600;
    border-radius: 10px;
}

/* Review Styles */
.review-info {
    text-align: center;
    margin-bottom: 20px;
    font-size: 18px;
    color: var(--text-secondary);
}

.reveal-section {
    text-align: center;
    margin: 20px 0;
}

/* Instant Compose Styles */
.japanese-text {
    font-size: 20px;
    color: var(--text-primary);
    background: var(--background);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
    border: 2px solid var(--border);
}

.input-section {
    margin-bottom: 20px;
}

.input-section textarea {
    width: 100%;
    min-height: 100px;
    padding: 15px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 16px;
    resize: vertical;
    margin-bottom: 15px;
}

.answer-section {
    text-align: center;
    margin: 20px 0;
}

.model-answer {
    font-size: 18px;
    color: var(--success);
    background: rgba(16, 185, 129, 0.1);
    padding: 20px;
    border-radius: 8px;
    margin-top: 15px;
    border: 2px solid var(--success);
}

.compose-controls {
    text-align: center;
    margin-top: 20px;
}

/* Shadowing Styles */
.passage-info {
    text-align: center;
    margin-bottom: 20px;
    font-size: 18px;
    color: var(--text-secondary);
}

.passage-info h3 {
    margin-top: 10px;
    color: var(--primary);
    font-size: 20px;
    font-weight: 600;
}

.passage-level {
    margin-top: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.playback-controls {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.speed-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.speed-controls label {
    font-weight: 600;
    color: var(--text-primary);
    margin-right: 10px;
}

.speed-btn {
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.2s ease;
    background: var(--background);
    color: var(--text-secondary);
    border: 2px solid var(--border);
}

.speed-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-1px);
}

.speed-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(6, 95, 70, 0.3);
}

/* Pronunciation Practice Styles */
.pronunciation-practice {
    text-align: center;
    margin: 20px 0;
}

.pronunciation-practice .btn {
    min-width: 250px;
    padding: 15px 25px;
    font-size: 16px;
    font-weight: 600;
}

.pronunciation-practice .btn.recording {
    background: var(--danger);
    color: white;
    animation: pulse-recording 1.5s infinite;
}

@keyframes pulse-recording {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.05); }
}

.pronunciation-feedback {
    margin-top: 20px;
    padding: 20px;
    border-radius: 12px;
    border-left: 4px solid var(--primary);
    background: var(--background);
}

.pronunciation-score {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--primary);
}

.pronunciation-score.excellent {
    color: var(--success);
}

.pronunciation-score.good {
    color: var(--warning);
}

.pronunciation-score.needs-improvement {
    color: var(--danger);
}

.pronunciation-details {
    display: grid;
    gap: 15px;
    margin-top: 15px;
}

.pronunciation-comparison {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: var(--card-bg);
    border-radius: 8px;
}

.pronunciation-target,
.pronunciation-recognized {
    flex: 1;
    text-align: center;
}

.pronunciation-target h4,
.pronunciation-recognized h4 {
    margin: 0 0 5px 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.pronunciation-target p,
.pronunciation-recognized p {
    margin: 0;
    font-size: 1rem;
    font-weight: 500;
}

.accuracy-meter {
    margin: 15px 0;
}

.accuracy-bar {
    width: 100%;
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
}

.accuracy-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--danger), var(--warning), var(--success));
    transition: width 0.5s ease;
}

.sentences-container {
    margin-bottom: 30px;
}

.sentence-pair {
    margin-bottom: 25px;
    padding: 20px;
    background: var(--background);
    border-radius: 8px;
    border: 1px solid var(--border);
}

.english-sentence {
    font-size: 18px;
    color: var(--text-primary);
    margin-bottom: 10px;
    font-weight: 500;
}

.japanese-translation {
    font-size: 16px;
    color: var(--text-secondary);
    font-style: italic;
}

.passage-controls {
    text-align: center;
}

/* Test Styles */
.test-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(135deg, rgba(6, 95, 70, 0.1), rgba(234, 88, 12, 0.05));
    border-radius: 15px;
    border-left: 4px solid var(--primary);
}

.test-progress {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.test-progress::before {
    content: '📝';
    font-size: 1.2em;
}

.test-difficulty {
    font-size: 14px;
    color: var(--secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: rgba(107, 114, 128, 0.1);
    padding: 4px 8px;
    border-radius: 6px;
}

.test-question {
    margin-bottom: 30px;
    padding: 25px;
    background: var(--card-bg);
    border-radius: 15px;
    border: 2px solid transparent;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    position: relative;
    overflow: hidden;
}

.test-question::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
}

.test-question h3 {
    font-size: 22px;
    line-height: 1.6;
    color: var(--text-primary);
    margin-bottom: 15px;
    font-weight: 600;
}

.test-options {
    margin-bottom: 25px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.test-option {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 18px 24px;
    border: 2px solid var(--border);
    background: var(--card-bg);
    border-radius: 12px;
    text-align: left;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 16px;
    font-weight: 500;
    position: relative;
    overflow: hidden;
}

.test-option::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: transparent;
    transition: all 0.3s ease;
}

.test-option:hover {
    border-color: var(--primary);
    background: rgba(6, 95, 70, 0.08);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(6, 95, 70, 0.15);
}

.test-option:hover::before {
    background: var(--primary);
}

.test-option:active {
    transform: translateY(0);
    box-shadow: 0 4px 15px rgba(6, 95, 70, 0.1);
}

.test-option.selected {
    border-color: var(--primary);
    background: rgba(6, 95, 70, 0.1);
    color: var(--primary);
    font-weight: 600;
}

.test-option.selected::before {
    background: var(--primary);
}

.test-option:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.test-input {
    width: 100%;
    padding: 18px 20px;
    border: 2px solid var(--border);
    border-radius: 12px;
    font-size: 18px;
    margin-bottom: 20px;
    transition: all 0.3s ease;
    background: var(--card-bg);
    font-weight: 500;
}

.test-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(6, 95, 70, 0.1);
    transform: translateY(-2px);
}

.test-input::placeholder {
    color: var(--text-secondary);
    font-style: italic;
}

.test-feedback {
    background: var(--background);
    padding: 25px;
    border-radius: 15px;
    margin-bottom: 25px;
    border-left: 4px solid var(--primary);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.feedback-result {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.feedback-result.correct {
    color: var(--success);
}

.feedback-result.correct::before {
    content: '🎉';
    font-size: 1.2em;
}

.feedback-result.incorrect {
    color: var(--danger);
}

.feedback-result.incorrect::before {
    content: '💡';
    font-size: 1.2em;
}

.feedback-explanation {
    color: var(--text-secondary);
    line-height: 1.6;
    font-size: 16px;
}

.feedback-explanation-jp {
    color: var(--text-primary);
    font-weight: 500;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
    font-size: 14px;
}

.test-controls {
    text-align: center;
}

.test-next-btn {
    padding: 15px 30px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.test-next-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(6, 95, 70, 0.3);
}

.test-results {
    text-align: center;
    padding: 50px 30px;
    background: linear-gradient(135deg, rgba(6, 95, 70, 0.05), rgba(234, 88, 12, 0.02));
    border-radius: 20px;
    position: relative;
    overflow: hidden;
}

.test-results::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transform: translateX(-100%);
    animation: shimmer 3s infinite;
}

.test-results h2 {
    margin-bottom: 30px;
    color: var(--primary);
    font-size: 2.2rem;
    font-weight: 800;
}

.score-display {
    margin-bottom: 40px;
    position: relative;
    z-index: 1;
}

.score-number {
    font-size: 4rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 15px;
    animation: pulse 2s infinite;
}

.score-percentage {
    font-size: 2.5rem;
    color: var(--text-secondary);
    margin-bottom: 15px;
    font-weight: 700;
}

.score-grade {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--success);
    padding: 10px 20px;
    background: rgba(16, 185, 129, 0.1);
    border-radius: 25px;
    display: inline-block;
    border: 2px solid var(--success);
}

/* Tablet Optimization */
@media (min-width: 769px) and (max-width: 1024px) {
    .container {
        max-width: 700px;
    }

    .learning-options {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .nav-btn {
        padding: 10px 14px;
        min-height: 50px;
    }

    .btn {
        min-height: 44px;
        padding: 12px 18px;
    }
}

/* Enhanced Mobile Responsiveness */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        height: auto;
        padding: 12px 15px;
    }

    .nav-buttons {
        margin-top: 12px;
        justify-content: center;
        gap: 4px;
        width: 100%;
    }

    .nav-btn {
        padding: 12px 8px;
        min-width: 70px;
        min-height: 60px;
        border-radius: 8px;
        flex: 1;
        max-width: 80px;
    }

    .nav-icon {
        font-size: 18px;
        margin-bottom: 3px;
    }

    .nav-text {
        font-size: 11px;
        font-weight: 600;
    }

    body {
        padding-top: 120px;
        font-size: 16px; /* Better readability on mobile */
    }

    .welcome-section {
        padding: 30px 15px;
    }

    .welcome-title {
        font-size: 2rem;
    }

    .welcome-subtitle {
        font-size: 1rem;
    }

    .learning-options {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .learning-card {
        padding: 25px;
    }

    .kpi-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .kpi-card {
        padding: 20px;
    }

    .kpi-value {
        font-size: 2rem;
    }

    .card {
        padding: 20px;
        margin-bottom: 20px;
    }

    h1 {
        font-size: 24px;
        margin-bottom: 20px;
    }

    /* Enhanced Button Styles for Mobile */
    .btn {
        min-height: 48px; /* Apple's recommended touch target */
        padding: 14px 20px;
        font-size: 16px;
        font-weight: 600;
    }

    .response-buttons {
        flex-direction: column;
        gap: 15px;
    }

    .response-buttons .btn {
        width: 100%;
        min-height: 56px;
        font-size: 18px;
    }

    .playback-controls {
        flex-direction: column;
        align-items: center;
        gap: 12px;
    }

    .playback-controls .btn {
        width: 90%;
        max-width: 300px;
    }

    .speed-controls {
        flex-wrap: wrap;
        gap: 8px;
    }

    .speed-btn {
        min-width: 60px;
        min-height: 44px;
        padding: 10px 16px;
    }

    .word-of-day .word {
        font-size: 2rem;
    }
}

/* Enhanced Small Mobile Devices */
@media (max-width: 480px) {
    body {
        font-size: 16px; /* Maintain readability */
    }

    .logo {
        font-size: 22px;
    }

    .nav-btn {
        min-height: 56px;
        padding: 8px 6px;
    }

    .learning-card .word {
        font-size: 28px;
    }

    .word-of-day .word {
        font-size: 24px;
    }

    .kpi-value {
        font-size: 32px;
    }

    .japanese-text {
        font-size: 18px;
        padding: 20px;
        line-height: 1.6;
    }

    .english-sentence {
        font-size: 16px;
        line-height: 1.5;
    }

    /* Test Options Enhancement */
    .test-option {
        padding: 20px;
        font-size: 16px;
        min-height: 56px;
    }

    .test-input {
        padding: 16px;
        font-size: 18px;
        min-height: 56px;
    }

    /* Words of the Day Mobile */
    .words-of-day-container {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        gap: 15px;
    }

    .word-of-day .word {
        font-size: 1.5rem;
    }

    .word-of-day .definition {
        font-size: 0.95rem;
    }

    .word-of-day .example {
        font-size: 0.85rem;
    }

    /* Card Improvements */
    .card {
        margin: 10px;
        padding: 20px;
    }

    .container {
        padding: 0 15px;
    }
}

/* Enhanced Feedback Styles */
.detailed-feedback {
    margin-top: 20px;
    background: var(--background);
    border-radius: 15px;
    padding: 20px;
    border: 1px solid var(--border);
}

.feedback-section {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(6, 95, 70, 0.1);
}

.feedback-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.feedback-section h4 {
    color: var(--primary);
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.correct-answer, .why-correct, .sentence-context {
    margin-bottom: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.correct-answer .label, .why-correct .label, .sentence-context .label {
    font-weight: 600;
    color: var(--text-primary);
    min-width: 120px;
}

.correct-answer .answer {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
    padding: 4px 8px;
    border-radius: 6px;
    font-weight: 600;
}

.context strong {
    color: var(--primary);
    background: rgba(6, 95, 70, 0.1);
    padding: 2px 4px;
    border-radius: 4px;
}

.related-vocabulary {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.related-word {
    background: rgba(6, 95, 70, 0.05);
    padding: 10px;
    border-radius: 8px;
    border-left: 3px solid var(--primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.related-word .word {
    font-weight: 600;
    color: var(--primary);
}

.related-word .definition {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.study-tip {
    background: rgba(234, 88, 12, 0.1);
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 8px;
    border-left: 3px solid var(--accent);
    font-size: 0.9rem;
    line-height: 1.4;
}

.no-related {
    color: var(--text-secondary);
    font-style: italic;
    text-align: center;
    padding: 15px;
}

/* Learning Feedback Modal Styles */
.learning-feedback-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.learning-feedback-modal.show {
    opacity: 1;
    visibility: visible;
}

.learning-feedback-content {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 30px;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    margin: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: translateY(50px);
    transition: all 0.3s ease;
}

.learning-feedback-modal.show .learning-feedback-content {
    transform: translateY(0);
}

.feedback-header h3 {
    color: var(--primary);
    text-align: center;
    margin-bottom: 20px;
    font-size: 1.3rem;
}

.word-focus {
    text-align: center;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 20px;
    position: relative;
}

.word-main {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 5px;
}

.word-phonetic {
    font-size: 1rem;
    opacity: 0.9;
    margin-bottom: 10px;
}

.pronunciation-btn-mini {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
}

.pronunciation-btn-mini:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.enhanced-explanation {
    margin-bottom: 20px;
}

.explanation-section {
    margin-bottom: 15px;
    padding: 15px;
    background: var(--background);
    border-radius: 10px;
    border: 1px solid var(--border);
}

.explanation-section h4 {
    color: var(--primary);
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.english-def {
    color: var(--text-secondary);
    font-style: italic;
    margin-top: 5px;
}

.example-sentence {
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.5;
}

.japanese-example {
    color: var(--text-secondary);
    margin-top: 5px;
}

.related-word-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px;
    background: rgba(6, 95, 70, 0.05);
    border-radius: 6px;
    margin-bottom: 6px;
    border-left: 3px solid var(--primary);
}

.related-word-name {
    font-weight: 600;
    color: var(--primary);
}

.related-word-def {
    color: var(--text-secondary);
    font-size: 0.9rem;
    flex: 1;
}

.similarity-indicator {
    font-size: 0.8rem;
    color: var(--primary);
    font-weight: 600;
    background: rgba(6, 95, 70, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 8px;
}

.memory-tip {
    background: rgba(234, 88, 12, 0.1);
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 8px;
    border-left: 3px solid var(--accent);
    font-size: 0.9rem;
    line-height: 1.4;
}

.no-related-words {
    color: var(--text-secondary);
    font-style: italic;
    text-align: center;
    padding: 10px;
}

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

.feedback-actions .btn {
    padding: 12px 24px;
    font-size: 1rem;
    min-width: 200px;
}

/* Mobile Responsive for Feedback */
@media (max-width: 768px) {
    .learning-feedback-content {
        margin: 10px;
        padding: 20px;
        max-height: 90vh;
    }
    
    .word-main {
        font-size: 1.5rem;
    }
    
    .related-word-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .correct-answer, .why-correct, .sentence-context {
        flex-direction: column;
        gap: 4px;
    }
    
    .correct-answer .label, .why-correct .label, .sentence-context .label {
        min-width: auto;
    }
}

.compose-card {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 35px;
    margin-bottom: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    border: 1px solid rgba(6, 95, 70, 0.1);
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease;
}

.compose-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

/* Gamification Notifications */
.badge-notification,
.level-up-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(6, 95, 70, 0.3);
    z-index: 10000;
    transform: translateX(400px);
    opacity: 0;
    transition: all 0.3s ease;
    max-width: 300px;
    min-width: 250px;
}

.badge-notification.show,
.level-up-notification.show {
    transform: translateX(0);
    opacity: 1;
}

.badge-notification-content,
.level-up-content {
    display: flex;
    align-items: center;
    gap: 15px;
}

.badge-icon,
.level-up-icon {
    font-size: 2.5rem;
    animation: bounce 1s infinite;
}

.badge-info h3,
.level-up-content h2 {
    margin: 0 0 5px 0;
    font-size: 1.1rem;
    font-weight: 700;
}

.badge-info h4,
.level-up-content h3 {
    margin: 0 0 5px 0;
    font-size: 1rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
}

.badge-info p,
.level-up-content p {
    margin: 0 0 8px 0;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
}

.xp-reward {
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.level-up-content {
    flex-direction: column;
    text-align: center;
    gap: 10px;
}

/* Mobile notification adjustments */
@media (max-width: 480px) {
    .badge-notification,
    .level-up-notification {
        right: 10px;
        left: 10px;
        max-width: none;
        transform: translateY(-100px);
    }
    
    .badge-notification.show,
    .level-up-notification.show {
        transform: translateY(0);
    }
}
