/* Kotoba Quiz Specific Styles - Red/Orange Theme */

/* Answer Option Reading Display */
.option-text-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    width: 100%;
}

.option-kanji {
    font-family: var(--font-japanese);
    font-size: 1.2rem;
    font-weight: 600;
    line-height: 1.2;
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.option-reading {
    font-family: var(--font-japanese);
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    opacity: 0.7;
    transition: all 0.3s ease;
    line-height: 1;
    background: rgba(231, 76, 60, 0.1);
    padding: 2px 8px;
    border-radius: 8px;
    border: 1px solid rgba(231, 76, 60, 0.2);
}

.option-reading.hidden {
    display: none !important;
}

.answer-option:hover .option-kanji {
    color: #e74c3c;
    transform: scale(1.02);
}

.answer-option:hover .option-reading {
    opacity: 1;
    background: rgba(231, 76, 60, 0.15);
    border-color: rgba(231, 76, 60, 0.3);
    color: #c0392b;
}

.answer-option.selected .option-kanji {
    color: #c0392b;
    font-weight: 700;
    transform: scale(1.02);
}

.answer-option.selected .option-reading {
    opacity: 1;
    background: rgba(192, 57, 43, 0.2);
    border-color: rgba(192, 57, 43, 0.4);
    color: #c0392b;
    font-weight: 600;
}

.answer-option.correct .option-kanji,
.answer-option.correct .option-reading {
    color: #155724;
}

.answer-option.incorrect .option-kanji,
.answer-option.incorrect .option-reading {
    color: #721c24;
}

/* Update existing option-text for simple text answers */
.option-text.simple-text {
    font-family: var(--font-primary);
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
    word-break: break-word;
    color: var(--text-primary);
    transition: all 0.3s ease;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 30px 0 10px;
}

/* Sound Toggle Button */
.btn-sound-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    font-weight: 500;
    backdrop-filter: blur(10px);
}

.btn-sound-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
}

.btn-sound-toggle.sound-off {
    background: rgba(220, 53, 69, 0.2);
    border-color: rgba(220, 53, 69, 0.5);
}

.btn-sound-toggle.sound-off:hover {
    background: rgba(220, 53, 69, 0.3);
}

.btn-sound-toggle i {
    font-size: 1.1rem;
}

/* Quiz Header */
.quiz-header {
    background-color: var(--bg-primary);
    border-bottom: 2px solid #e74c3c; /* Red theme for kotoba */
    padding: 10px 0;
}

.quiz-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.quiz-header-info {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
}

.quiz-title {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-weight: 600;
    color: var(--text-primary);
}

.quiz-title i {
    color: #e74c3c; /* Red theme */
    font-size: 1.2rem;
}

.quiz-progress-header {
    background-color: var(--bg-secondary);
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 500;
    color: var(--text-primary);
}

.quiz-controls {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.timer {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    background-color: #c0392b; /* Red secondary theme */
    color: var(--white);
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
}

.timer.warning {
    background-color: #dc3545; /* Darker red warning */
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.btn-quit {
    background-color: var(--border-medium);
    color: var(--text-primary);
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    transition: var(--transition-normal);
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.btn-quit:hover {
    background-color: #e74c3c; /* Red theme */
    color: var(--white);
}

/* Quiz Setup Section */
.quiz-setup-section {
    padding: 100px 0 var(--spacing-xl);
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%); /* Red gradient */
    color: var(--white);
    min-height: 100vh;
}

.setup-content {
    max-width: 900px; /* Slightly wider for more options */
    margin: 0 auto;
    text-align: center;
}

.setup-header {
    margin-bottom: var(--spacing-xl);
}

.setup-icon {
    width: 80px;
    height: 80px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--spacing-lg);
    font-size: 2rem;
}

.setup-header h1 {
    font-size: 2.5rem;
    margin-bottom: var(--spacing-md);
}

.setup-options {
    margin-bottom: var(--spacing-xl);
}

.option-group {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius-lg);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    backdrop-filter: blur(10px);
}

.option-group h3 {
    margin-bottom: var(--spacing-lg);
    font-size: 1.3rem;
}

/* JLPT Level Options */
.jlpt-level-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: var(--spacing-md);
}

.jlpt-level-option {
    background-color: rgba(255, 255, 255, 0.1);
    border: 2px solid transparent;
    border-radius: var(--border-radius-md);
    padding: var(--spacing-lg);
    cursor: pointer;
    transition: var(--transition-normal);
    text-align: center;
    position: relative;
}

.jlpt-level-option:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.jlpt-level-option.active {
    border-color: var(--white);
    background-color: rgba(255, 255, 255, 0.2);
}

.level-badge {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--spacing-sm);
    font-weight: 700;
    font-size: 1.1rem;
    color: white;
}

.level-badge.n5 { background: linear-gradient(135deg, #27ae60, #2ecc71); }
.level-badge.n4 { background: linear-gradient(135deg, #3498db, #5dade2); }
.level-badge.n3 { background: linear-gradient(135deg, #e74c3c, #c0392b); } /* Red for N3 */
.level-badge.n2 { background: linear-gradient(135deg, #8e44ad, #bb8fce); }
.level-badge.n1 { background: linear-gradient(135deg, #34495e, #7f8c8d); }
.level-badge.favorites { background: linear-gradient(135deg, #e74c3c, #c0392b); } /* Red for favorites */

.jlpt-level-option h4 {
    margin-bottom: var(--spacing-xs);
    font-size: 1.1rem;
}

.jlpt-level-option p {
    font-size: 0.9rem;
    opacity: 0.8;
    margin-bottom: var(--spacing-sm);
}

.vocab-count {
    background-color: rgba(255, 255, 255, 0.2);
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* Favorites Option Special Styling */
.jlpt-level-option[data-level="favorites"] {
    background: linear-gradient(135deg, rgba(231, 76, 60, 0.1) 0%, rgba(192, 57, 43, 0.2) 100%);
    border: 2px solid rgba(231, 76, 60, 0.3);
}

.jlpt-level-option[data-level="favorites"]:hover {
    background: linear-gradient(135deg, rgba(231, 76, 60, 0.2) 0%, rgba(192, 57, 43, 0.3) 100%);
    border-color: rgba(231, 76, 60, 0.5);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(231, 76, 60, 0.2);
}

.jlpt-level-option[data-level="favorites"].active {
    border-color: #e74c3c;
    background: linear-gradient(135deg, rgba(231, 76, 60, 0.3) 0%, rgba(192, 57, 43, 0.4) 100%);
    box-shadow: 0 8px 25px rgba(231, 76, 60, 0.3);
}

/* Category Options */
.category-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-md);
}

.category-option {
    background-color: rgba(255, 255, 255, 0.1);
    border: 2px solid transparent;
    border-radius: var(--border-radius-md);
    padding: var(--spacing-lg);
    cursor: pointer;
    transition: var(--transition-normal);
    text-align: center;
}

.category-option:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.category-option.active {
    border-color: var(--white);
    background-color: rgba(255, 255, 255, 0.2);
}

.category-option i {
    font-size: 2rem;
    margin-bottom: var(--spacing-md);
    color: #e74c3c; /* Red theme */
}

.category-option h4 {
    margin-bottom: var(--spacing-sm);
    font-size: 1.1rem;
}

.category-option p {
    font-size: 0.9rem;
    opacity: 0.8;
    margin: 0;
}

/* Set Options */
.set-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    max-height: 500px; /* Tingkatkan dari 400px */
    overflow-y: auto;
}

.set-option {
    background-color: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--border-radius-md);
    padding: var(--spacing-md);
    cursor: pointer;
    transition: var(--transition-normal);
    text-align: center;
    color: white;
    position: relative;
    min-height: 80px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.set-option:hover {
    background-color: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
}

.set-option.active {
    background-color: rgba(255, 255, 255, 0.25);
    border-color: white;
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.set-number {
    background-color: rgba(231, 76, 60, 0.8);
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    margin: 0 auto var(--spacing-xs);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.set-info h4 {
    font-size: 0.9rem;
    margin: 0 0 var(--spacing-xs);
    font-weight: 600;
}

.set-range {
    font-size: 0.8rem;
    opacity: 0.9;
    margin: 0;
}

.set-option.active::after {
    content: '✓';
    position: absolute;
    top: 8px;
    right: 8px;
    background-color: #28a745;
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Direction Options */
.direction-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-md);
}

.direction-option {
    background-color: rgba(255, 255, 255, 0.1);
    border: 2px solid transparent;
    border-radius: var(--border-radius-md);
    padding: var(--spacing-lg);
    cursor: pointer;
    transition: var(--transition-normal);
    text-align: center;
}

.direction-option:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.direction-option.active {
    border-color: var(--white);
    background-color: rgba(255, 255, 255, 0.2);
}

.direction-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
    font-size: 1.2rem;
}

.japanese-text {
    font-family: var(--font-japanese);
    font-size: 1.8rem;
    font-weight: 600;
    color: #e74c3c; /* Red theme */
}

.meaning-text {
    font-size: 1.2rem;
    font-weight: 600;
    color: white;
}

.direction-option h4 {
    margin-bottom: var(--spacing-sm);
    font-size: 1.1rem;
}

.direction-option p {
    font-size: 0.9rem;
    opacity: 0.8;
    margin: 0;
}

/* Mode Options */
.mode-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-md);
}

.mode-option {
    background-color: rgba(255, 255, 255, 0.1);
    border: 2px solid transparent;
    border-radius: var(--border-radius-md);
    padding: var(--spacing-lg);
    cursor: pointer;
    transition: var(--transition-normal);
    text-align: center;
}

.mode-option:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.mode-option.active {
    border-color: var(--white);
    background-color: rgba(255, 255, 255, 0.2);
}

.mode-option i {
    font-size: 2rem;
    margin-bottom: var(--spacing-md);
}

.mode-option h4 {
    margin-bottom: var(--spacing-sm);
    font-size: 1.1rem;
}

.mode-option p {
    font-size: 0.9rem;
    opacity: 0.8;
    margin: 0;
}

/* Selection Helper Text */
.selection-helper {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius-sm);
    padding: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
    text-align: center;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.9);
}

.selection-helper i {
    color: #ffd700;
    margin-right: var(--spacing-xs);
}

/* Setup Actions */
.setup-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--spacing-lg);
    flex-wrap: wrap;
}

.primary-actions {
    display: flex;
    gap: var(--spacing-md);
    align-items: center;
}

.btn-start-quiz {
    padding: 15px 30px;
    font-size: 1.1rem;
    background-color: var(--white);
    color: #e74c3c; /* Red theme */
    border: none;
}

.btn-start-quiz:hover {
    background-color: var(--off-white);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.btn-learn {
    padding: 15px 30px;
    font-size: 1.1rem;
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--white);
    border: 2px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.btn-learn:hover {
    background-color: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(255, 255, 255, 0.1);
    color: var(--white);
    text-decoration: none;
}

/* Quiz Game Section */
.quiz-game-section {
    padding: 100px 0 var(--spacing-xl);
    background-color: var(--bg-secondary);
    min-height: 100vh;
}

.quiz-progress-bar {
    width: 100%;
    height: 8px;
    background-color: var(--bg-primary);
    border-radius: 4px;
    margin-bottom: var(--spacing-xl);
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #e74c3c, #c0392b); /* Red gradient */
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 4px;
}

.question-card {
    background-color: var(--bg-primary);
    border-radius: var(--border-radius-lg);
    padding: 1.8rem; /* Kurangi padding */
    box-shadow: var(--box-shadow);
    margin-bottom: var(--spacing-lg);
    max-width: 750px; /* Kurangi width maksimal */
    margin-left: auto;
    margin-right: auto;
    border: 1px solid var(--border-light);
}

.question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-light);
    flex-wrap: wrap;
    gap: var(--spacing-sm);
}

.question-number {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1.1rem;
}

.question-info {
    display: flex;
    gap: var(--spacing-sm);
    align-items: center;
}

.question-level {
    background-color: #e74c3c; /* Red theme */
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.question-set {
    background-color: #c0392b; /* Darker red */
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.question-points {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    color: #c0392b; /* Red theme */
    font-weight: 600;
}

.question-points i {
    color: #e74c3c; /* Red theme */
}

/* Pastikan kontainer tidak memotong elemen yang overflow */
.vocabulary-display {
    position: relative;
    margin-bottom: 2rem;
    text-align: center;
    background: linear-gradient(135deg, rgba(231, 76, 60, 0.08), rgba(192, 57, 43, 0.12));
    border: 2px solid rgba(231, 76, 60, 0.15);
    border-radius: 12px;
    padding: 2rem 1rem 1.5rem 1rem; /* Padding top lebih besar untuk kategori */
    overflow: visible;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.vocabulary-display::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.03) 50%, transparent 70%);
    pointer-events: none;
}

/* KANJI - Ukuran yang lebih proporsional */
.vocabulary-display span {
    font-size: 2.8rem; /* Dikurangi dari 4rem */
    color: #ffffff;
    font-weight: 800; /* Sedikit kurangi weight */
    display: block;
    margin-bottom: 1rem; /* Kurangi margin */
    font-family: var(--font-japanese);
    line-height: 1;
    text-shadow: 0 2px 4px rgba(192, 57, 43, 0.1); /* Shadow lebih halus */
    letter-spacing: 0.01em;
    position: relative;
    z-index: 1;
}

.vocab-info {
    margin-top: 1rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 0.5rem; /* Gap normal untuk reading */
    align-items: center;
    position: relative;
    z-index: 1;
}

/* KANA/READING - Ukuran sedang yang seimbang */
.reading-display {
    background: linear-gradient(135deg, rgba(231, 76, 60, 0.9), rgba(192, 57, 43, 0.9)); /* Transparansi untuk keseimbangan */
    color: white;
    padding: 6px 14px; /* Padding sedang */
    border-radius: 20px;
    font-size: 1rem; /* Ukuran sedang */
    font-weight: 600;
    font-family: var(--font-japanese);
    display: inline-block;
    box-shadow: 0 2px 8px rgba(231, 76, 60, 0.15); /* Shadow lebih halus */
    border: 2px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(5px);
    letter-spacing: 0.01em;
    position: relative;
    overflow: hidden;
}

.reading-display::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
    transition: left 0.5s ease;
}

.reading-display:hover::before {
    left: 100%;
}

/* KATEGORI - Ukuran kecil yang proporsional */
.part-of-speech {
    display: inline-block !important;
    background: linear-gradient(135deg, rgba(192, 57, 43, 0.7), rgba(231, 76, 60, 0.7));
    color: white;
    padding: 4px 10px; /* Padding lebih besar untuk teks panjang */
    border-radius: 6px;
    font-size: 0.8rem !important; /* Font size yang lebih kecil untuk teks panjang */
    font-weight: 500; /* Weight sedikit lebih berat untuk keterbacaan */
    text-transform: uppercase;
    letter-spacing: 0.05px;
    margin: 0;
    box-shadow: 0 1px 2px rgba(192, 57, 43, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.15);
    opacity: 0.8;
    position: absolute;
    top: 6px;
    right: 6px;
    z-index: 2;
    max-width: 200px; /* Lebar maksimal yang lebih besar */
    min-width: auto; /* Hilangkan min-width agar fleksibel */
    width: auto; /* Lebar otomatis sesuai konten */
    font-family: var(--font-primary) !important;
    line-height: 1.2; /* Line height sedikit lebih besar */
    white-space: nowrap; /* Tetap dalam satu baris */
    overflow: visible; /* Tidak terpotong */
    text-overflow: clip;
    text-align: center;
}

.meaning-display {
    position: relative;
    margin-bottom: 2rem;
    padding: 2rem 1rem 1.5rem 1rem; /* Padding top lebih besar untuk kategori */
    background: linear-gradient(135deg, rgba(231, 76, 60, 0.08), rgba(192, 57, 43, 0.12));
    border: 2px solid rgba(231, 76, 60, 0.15);
    border-radius: 12px;
    text-align: center;
    overflow: visible;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.meaning-display::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.03) 50%, transparent 70%);
    pointer-events: none;
}

.meaning-display span {
    font-size: 1.8rem;
    font-weight: 600;
    color: #c0392b;
    display: block;
    margin-bottom: 0.3rem; /* Margin kecil untuk kategori mini */
    line-height: 1.3;
    position: relative;
    z-index: 1;
}

.category-display {
    display: inline-block !important;
    background: linear-gradient(135deg, rgba(192, 57, 43, 0.7), rgba(231, 76, 60, 0.7));
    color: white;
    padding: 4px 10px; /* Padding lebih besar untuk teks panjang */
    border-radius: 6px;
    font-size: 0.8rem !important; /* Font size yang lebih kecil untuk teks panjang */
    font-weight: 500; /* Weight sedikit lebih berat untuk keterbacaan */
    text-transform: uppercase;
    letter-spacing: 0.05px;
    margin: 0;
    box-shadow: 0 1px 2px rgba(192, 57, 43, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.15);
    opacity: 0.8;
    position: absolute;
    top: 6px;
    right: 6px;
    z-index: 2;
    max-width: 200px; /* Lebar maksimal yang lebih besar */
    min-width: auto; /* Hilangkan min-width agar fleksibel */
    width: auto; /* Lebar otomatis sesuai konten */
    font-family: var(--font-primary) !important;
    line-height: 1.2; /* Line height sedikit lebih besar */
    white-space: nowrap; /* Tetap dalam satu baris */
    overflow: visible; /* Tidak terpotong */
    text-overflow: clip;
    text-align: center;
}

/* Question Text - Spacing yang lebih seimbang */
.question-text {
    text-align: center;
    margin-bottom: 2rem; /* Kurangi margin */
}

.question-text h2 {
    color: var(--text-primary);
    font-size: 1.3rem; /* Sedikit kurangi */
    margin: 0 0 0.6rem 0; /* Kurangi margin */
    line-height: 1.4;
    font-weight: 600;
}

.question-text p {
    color: var(--text-secondary);
    font-size: 0.95rem; /* Sedikit kurangi */
    margin: 0;
    opacity: 0.8;
    line-height: 1.5;
}

/* Answer Options */
.answer-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    gap: 16px; /* Sedikit lebih besar */
    margin-bottom: var(--spacing-lg);
    max-width: 550px; /* Sedikit lebih besar */
    margin-left: auto;
    margin-right: auto;
    padding: 0 20px; /* Sedikit lebih besar */
}

.answer-option {
    background-color: var(--bg-secondary);
    border: 2px solid var(--border-medium);
    border-radius: var(--border-radius-md);
    padding: 16px 20px; /* Padding sedang */
    cursor: pointer;
    transition: var(--transition-normal);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 90px; /* Tinggi sedang */
    height: auto;
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.answer-option:hover {
    border-color: #c0392b;
    background-color: var(--bg-primary);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(231, 76, 60, 0.15);
}

.answer-option:focus {
    outline: 3px solid rgba(231, 76, 60, 0.3);
    outline-offset: 2px;
}

.answer-option.selected {
    border-color: #c0392b;
    background-color: rgba(192, 57, 43, 0.1);
    color: #e74c3c;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3);
}

.answer-option.correct {
    border-color: #28a745;
    background-color: #d4edda;
    color: #155724;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.answer-option.incorrect {
    border-color: #dc3545;
    background-color: #f8d7da;
    color: #721c24;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.3);
}

.option-letter {
    width: 22px;
    height: 22px;
    background-color: rgba(231, 76, 60, 0.7);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.7rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
    position: absolute;
    top: 10px;
    left: 10px;
    opacity: 0.9;
    transition: all 0.3s ease;
}

.answer-option:hover .option-letter {
    opacity: 1;
    background-color: #e74c3c;
    transform: scale(1.1);
}

.answer-option.selected .option-letter {
    background-color: #c0392b;
    opacity: 1;
    transform: scale(1.05);
}

.answer-option.correct .option-letter {
    background-color: #28a745;
    opacity: 1;
}

.answer-option.incorrect .option-letter {
    background-color: #dc3545;
    opacity: 1;
}

.option-text {
    font-family: var(--font-japanese);
    font-size: 1.1rem; /* Ukuran sedang */
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
    word-break: break-word;
    color: var(--text-primary);
    transition: all 0.3s ease;
    letter-spacing: 0.01em;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); /* Shadow lebih halus */
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 30px 0 10px; /* Adjust padding */
}

.answer-option:hover .option-text {
    color: #e74c3c;
    transform: scale(1.02);
    text-shadow: 0 2px 4px rgba(231, 76, 60, 0.2);
}

.answer-option.selected .option-text {
    color: #c0392b;
    font-weight: 700;
    transform: scale(1.02);
}

/* Typing Mode Styles */
.typing-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin: 2rem 0;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.typing-input-group {
    display: flex;
    gap: 0.5rem;
    align-items: stretch;
}

#answerInput {
    flex: 1;
    padding: 1rem 1.5rem;
    border: 2px solid var(--border-medium);
    border-radius: var(--border-radius-md);
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 1.2rem;
    font-family: var(--font-primary);
    text-align: center;
    outline: none;
    transition: all 0.3s ease;
    min-height: 50px;
}

#answerInput:focus {
    border-color: #c0392b; /* Red theme */
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1);
    background-color: var(--bg-primary);
}

#answerInput::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}

#answerInput:disabled {
    background-color: var(--border-light);
    color: var(--text-secondary);
    cursor: not-allowed;
}

.submit-typing-btn {
    padding: 1rem 1.5rem;
    background-color: #c0392b; /* Red theme */
    border: 2px solid #c0392b;
    border-radius: var(--border-radius-md);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    min-width: 120px;
    justify-content: center;
}

.submit-typing-btn:hover {
    background-color: #e74c3c; /* Lighter red */
    border-color: #e74c3c;
    transform: translateY(-2px);
}

.submit-typing-btn:disabled {
    background-color: var(--border-medium);
    border-color: var(--border-medium);
    cursor: not-allowed;
    transform: none;
}

.typing-hint {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
    background-color: var(--bg-secondary);
    padding: 1rem;
    border-radius: var(--border-radius-md);
    border: 1px solid var(--border-light);
}

.typing-hint p {
    margin: 0;
}

/* Quiz Actions */
.quiz-actions {
    display: flex;
    justify-content: center;
    gap: var(--spacing-lg);
}

/* Quiz Results Section */
.quiz-results-section {
    padding: 100px 0 var(--spacing-xl);
    background: linear-gradient(135deg, #c0392b 0%, #e74c3c 100%); /* Red gradient */
    color: var(--white);
    min-height: 100vh;
}

.results-content {
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
}

.results-header {
    margin-bottom: var(--spacing-xl);
}

.results-icon {
    width: 100px;
    height: 100px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--spacing-lg);
    font-size: 3rem;
}

.results-header h1 {
    font-size: 3rem;
    margin-bottom: var(--spacing-md);
}

.results-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
}

.stat-card {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius-lg);
    padding: var(--spacing-lg);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.stat-icon {
    width: 60px;
    height: 60px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--spacing-md);
    font-size: 1.5rem;
}

.stat-content h3 {
    font-size: 2rem;
    margin-bottom: var(--spacing-xs);
    font-weight: 700;
}

.stat-content p {
    font-size: 0.9rem;
    opacity: 0.8;
    margin: 0;
}

.results-analysis {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius-lg);
    padding: var(--spacing-xl);
    margin-bottom: var(--spacing-xl);
    text-align: left;
    backdrop-filter: blur(10px);
}

.results-analysis h3 {
    text-align: center;
    margin-bottom: var(--spacing-lg);
    font-size: 1.5rem;
}

.performance-message {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius-md);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    text-align: center;
}

.mistake-review {
    margin-top: var(--spacing-lg);
}

.mistake-review h4 {
    margin-bottom: var(--spacing-md);
    color: #ffb3ba; /* Light red for contrast */
}

.mistakes-list {
    display: grid;
    gap: var(--spacing-md);
}

.mistake-item {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius-md);
    padding: var(--spacing-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.mistake-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
}

.mistake-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.btn-favorite {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid transparent;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    min-width: 120px;
    justify-content: center;
}

.btn-favorite:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
}

.btn-favorite.favorited {
    background: rgba(231, 76, 60, 0.8); /* Red theme for kotoba favorites */
    border-color: #e74c3c;
    color: white;
}

.btn-favorite.favorited:hover {
    background: rgba(231, 76, 60, 0.9);
}

.mistake-vocabulary {
    font-family: var(--font-japanese);
    font-size: 1.5rem;
    font-weight: 600;
}

.mistake-answer {
    font-size: 0.9rem;
}

.correct-answer {
    color: #90EE90;
}

.wrong-answer {
    color: #FFB6C1;
    text-decoration: line-through;
}

.results-actions {
    display: flex;
    justify-content: center;
    gap: var(--spacing-lg);
    flex-wrap: wrap;
}

/* Time Slider Styles */
.time-slider-container {
    margin: 1rem 0;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    backdrop-filter: blur(10px);
}

.time-slider-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: white;
    text-align: center;
}

.time-slider {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.3);
    outline: none;
    opacity: 0.9;
    transition: opacity 0.2s;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

.time-slider:hover {
    opacity: 1;
}

.time-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%); /* Red gradient */
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    transition: transform 0.2s ease;
}

.time-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.time-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%); /* Red gradient */
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    transition: transform 0.2s ease;
    border: none;
}

.time-slider::-moz-range-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.time-slider::-moz-range-track {
    height: 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.3);
    border: none;
}

.time-display {
    text-align: center;
    margin-top: 0.5rem;
    font-size: 1.1rem;
    font-weight: 700;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    color: #333;
    transition: all 0.3s ease;
}

.time-marks {
    display: flex;
    justify-content: space-between;
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
}

.time-marks span {
    flex: 1;
    text-align: center;
}

/* Quiz Footer Styles - Red theme for kotoba */
.quiz-footer {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f172a 100%);
    color: white;
    padding: 3rem 0 1rem;
    margin-top: 2rem;
    border-top: 3px solid #e74c3c; /* Red theme */
    position: relative;
    overflow: hidden;
}

.quiz-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="kotoba" patternUnits="userSpaceOnUse" width="100" height="100"><text x="20" y="30" font-family="serif" font-size="20" fill="rgba(255,255,255,0.03)">語</text><text x="70" y="70" font-family="serif" font-size="15" fill="rgba(255,255,255,0.02)">彙</text><text x="10" y="80" font-family="serif" font-size="18" fill="rgba(255,255,255,0.025)">本</text></pattern></defs><rect width="100" height="100" fill="url(%23kotoba)"/></svg>') repeat;
    opacity: 0.5;
    pointer-events: none;
}

.footer-content {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
    position: relative;
    z-index: 1;
}

.footer-brand h4 {
    color: #e74c3c; /* Red theme */
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.footer-brand p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    line-height: 1.4;
}

.footer-social h5 {
    color: white;
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    line-height: 1.5;
    font-weight: 600;
    background: linear-gradient(135deg, #e74c3c, #c0392b); /* Red gradient */
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.footer-links h6 {
    color: #c0392b; /* Red theme */
    font-size: 1.1rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.footer-links a:hover {
    color: #e74c3c; /* Red theme */
    transform: translateX(-5px);
}

/* Enhanced Visual Effects */
.answer-option::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, transparent 0%, rgba(255, 255, 255, 0.05) 100%);
    border-radius: var(--border-radius-md);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.answer-option:hover::before {
    opacity: 1;
}

/* Animations */
.answer-option.selected {
    animation: selectPulse 0.3s ease;
}

.answer-option.correct {
    animation: correctPulse 0.5s ease;
}

.answer-option.incorrect {
    animation: incorrectShake 0.5s ease;
}

@keyframes selectPulse {
    0% { transform: scale(1) translateY(0); }
    50% { transform: scale(1.02) translateY(-2px); }
    100% { transform: scale(1) translateY(-2px); }
}

@keyframes correctPulse {
    0% { transform: scale(1) translateY(0); }
    25% { transform: scale(1.05) translateY(-3px); }
    50% { transform: scale(1.02) translateY(-2px); }
    100% { transform: scale(1) translateY(-2px); }
}

@keyframes incorrectShake {
    0%, 100% { transform: translateX(0) translateY(-2px); }
    25% { transform: translateX(-3px) translateY(-2px); }
    75% { transform: translateX(3px) translateY(-2px); }
}

@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Reading Options */
.reading-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-md);
}

.reading-option {
    background-color: rgba(255, 255, 255, 0.1);
    border: 2px solid transparent;
    border-radius: var(--border-radius-md);
    padding: var(--spacing-lg);
    cursor: pointer;
    transition: var(--transition-normal);
    text-align: center;
}

.reading-option:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.reading-option.active {
    border-color: var(--white);
    background-color: rgba(255, 255, 255, 0.2);
}

.reading-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
    font-size: 1.2rem;
}

.reading-icon i {
    color: #e74c3c;
    font-size: 1.5rem;
}

.reading-icon .japanese-text {
    font-family: var(--font-japanese);
    font-size: 1.5rem;
    font-weight: 600;
    color: #e74c3c;
}

.reading-option h4 {
    margin-bottom: var(--spacing-sm);
    font-size: 1.1rem;
}

.reading-option p {
    font-size: 0.9rem;
    opacity: 0.8;
    margin: 0;
}

/* Hide reading display when disabled */
.reading-display.hidden {
    display: none !important;
}

.vocab-info.no-reading {
    gap: 0;
}

.vocab-info.no-reading .reading-display {
    display: none;
}

/* Feedback Styles */
.quiz-feedback {
    position: fixed;
    top: 50%; /* Posisi vertikal di tengah */
    left: 50%; /* Posisi horizontal di tengah */
    transform: translate(-50%, -50%); /* Center perfect */
    padding: 20px 30px; /* Padding lebih besar untuk tampilan tengah */
    border-radius: 15px; /* Radius lebih besar untuk tampilan lebih modern */
    color: white;
    font-weight: 600;
    z-index: 10000;
    max-width: 400px; /* Lebar maksimal lebih besar */
    min-width: 300px; /* Lebar minimal untuk konsistensi */
    word-wrap: break-word;
    animation: feedbackCenterAnimation 0.5s ease forwards;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.25); /* Shadow lebih prominent untuk center */
    backdrop-filter: blur(15px); /* Blur effect lebih kuat */
    border: 2px solid rgba(255, 255, 255, 0.15); /* Border halus */
    font-size: 1.1rem; /* Font size lebih besar untuk center display */
    line-height: 1.5; /* Line height yang nyaman */
    text-align: center; /* Center text alignment */
}

/* Background colors untuk different feedback types */
.quiz-feedback.success {
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 15px 35px rgba(39, 174, 96, 0.3);
}

.quiz-feedback.error {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 15px 35px rgba(231, 76, 60, 0.3);
}

.quiz-feedback.warning {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 15px 35px rgba(243, 156, 18, 0.3);
}

.quiz-feedback.info {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 15px 35px rgba(52, 152, 219, 0.3);
}

/* Overlay background untuk feedback center */
.quiz-feedback::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.1); /* Semi-transparent overlay */
    z-index: -1;
    backdrop-filter: blur(2px); /* Slight blur untuk background */
}

/* Favorites Modal Styles */
.favorites-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

.favorites-modal-content {
    background: #fff;
    border-radius: 12px;
    width: 90%;
    max-width: 700px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

.favorites-modal-header {
    padding: 20px 25px;
    border-bottom: 2px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    border-radius: 12px 12px 0 0;
}

.favorites-modal-header h3 {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 600;
}

.favorites-modal-header h3 i {
    color: #ff6b8a;
    margin-right: 8px;
}

.close-modal {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.close-modal:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.favorites-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 25px;
}

.favorites-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.favorite-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    transition: all 0.2s ease;
}

.favorite-item:hover {
    background: #e74c3c10;
    border-color: #e74c3c40;
    transform: translateY(-1px);
}

.favorite-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.favorite-japanese {
    display: flex;
    align-items: center;
    gap: 12px;
}

.favorite-kanji {
    font-size: 1.4rem;
    font-weight: 600;
    color: #2c3e50;
    font-family: 'Noto Sans JP', sans-serif;
}

.favorite-kana {
    font-size: 1rem;
    color: #e74c3c;
    background: #e74c3c15;
    padding: 2px 8px;
    border-radius: 6px;
    font-family: 'Noto Sans JP', sans-serif;
}

.favorite-meanings {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.favorite-arti {
    font-size: 1rem;
    color: #495057;
    font-weight: 500;
}

.favorite-kategori {
    font-size: 0.8rem;
    color: #6c757d;
    font-style: italic;
}

.favorite-actions {
    display: flex;
    gap: 8px;
}

.btn-remove-favorite {
    background: #dc3545;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.btn-remove-favorite:hover {
    background: #c82333;
    transform: scale(1.05);
}

.favorites-modal-footer {
    padding: 20px 25px;
    border-top: 2px solid #f0f0f0;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    background: #f8f9fa;
    border-radius: 0 0 12px 12px;
}

.favorites-modal-footer .btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.favorites-modal-footer .btn-secondary {
    background: #6c757d;
    color: white;
}

.favorites-modal-footer .btn-secondary:hover {
    background: #5a6268;
}

.favorites-modal-footer .btn-danger {
    background: #dc3545;
    color: white;
}

.favorites-modal-footer .btn-danger:hover {
    background: #c82333;
}

.favorites-modal-footer .btn-primary {
    background: #e74c3c;
    color: white;
}

.favorites-modal-footer .btn-primary:hover {
    background: #c0392b;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { 
        opacity: 0;
        transform: translateY(50px);
    }
    to { 
        opacity: 1;
        transform: translateY(0);
    }
}

/* Animation untuk center display */
@keyframes feedbackCenterAnimation {
    0% { 
        opacity: 0; 
        transform: translate(-50%, -50%) scale(0.7); 
    }
    100% { 
        opacity: 1; 
        transform: translate(-50%, -50%) scale(1); 
    }
}

/* Responsive Design */
@media screen and (max-width: 768px) {

    .favorites-modal-content {
        width: 95%;
        max-height: 85vh;
    }
    
    .favorites-modal-header,
    .favorites-modal-body,
    .favorites-modal-footer {
        padding: 15px 20px;
    }
    
    .favorite-item {
        padding: 12px 15px;
    }
    
    .favorite-japanese {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
    
    .favorites-modal-footer {
        flex-direction: column;
    }
    
    .favorites-modal-footer .btn {
        width: 100%;
        justify-content: center;
    }

    .option-kanji {
        font-size: 1.1rem;
    }
    
    .option-reading {
        font-size: 0.75rem;
        padding: 1px 6px;
    }

    .reading-options {
        grid-template-columns: 1fr;
        gap: var(--spacing-sm);
    }
    
    .reading-option {
        padding: var(--spacing-md);
    }
    
    .reading-icon {
        gap: var(--spacing-xs);
        margin-bottom: var(--spacing-sm);
    }
    
    .reading-icon i {
        font-size: 1.3rem;
    }
    
    .reading-icon .japanese-text {
        font-size: 1.3rem;
    }

    .set-options {
        grid-template-columns: repeat(3, 1fr); /* 3 kolom di mobile */
        gap: 0.75rem;
        max-height: 400px;
    }
    
    .set-option {
        min-height: 70px;
        padding: var(--spacing-sm);
    }
    
    .set-number {
        width: 28px;
        height: 28px;
        font-size: 0.9rem;
    }

    .category-options {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-sm);
    }

    .jlpt-level-options {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }
    
    .direction-options {
        grid-template-columns: 1fr;
    }
    
    .mode-options {
        grid-template-columns: 1fr;
    }
    
    .quiz-header .container {
        flex-direction: column;
        gap: var(--spacing-md);
        text-align: center;
    }
    
    .question-header {
        flex-direction: column;
        text-align: center;
        gap: var(--spacing-sm);
    }
    
    .answer-options {
        grid-template-columns: 1fr 1fr;
        gap: 15px;
        max-width: 500px;
        padding: 0 15px;
    }
    
    .answer-option {
        padding: 14px 18px;
        min-height: 90px;
    }

    .option-letter {
        width: 20px;
        height: 20px;
        font-size: 0.65rem;
    }
    
    .option-text {
        font-size: 1.3rem;
        padding: 0 25px 0 10px;
    }

    .typing-input-group {
        flex-direction: row;
        gap: 0.5rem;
    }
    
    .setup-actions {
        flex-direction: column;
        gap: var(--spacing-md);
    }
    
    .primary-actions {
        flex-direction: column;
        width: 100%;
        gap: var(--spacing-sm);
    }
    
    .btn-start-quiz,
    .btn-learn {
        width: 100%;
        max-width: 300px;
        text-align: center;
        justify-content: center;
    }

    .vocabulary-display span {
        font-size: 2.5rem; /* Kurangi untuk mobile */
    }

    .meaning-display span {
        font-size: 1.5rem; /* Kurangi untuk mobile */
    }

    .reading-display {
        font-size: 0.9rem;
        padding: 5px 12px;
    }

    .part-of-speech {
        font-size: 0.7rem !important;
        padding: 3px 8px;
        top: 5px;
        right: 5px;
        max-width: 180px;
    }

    .category-display {
        font-size: 0.7rem !important;
        padding: 3px 8px;
        top: 5px;
        right: 5px;
        max-width: 180px;
    }

    .question-card {
        padding: 1.5rem;
        max-width: 100%;
    }

    .question-text h2 {
        font-size: 1.2rem;
    }

    .answer-option {
        min-height: 80px;
        padding: 14px 18px;
    }

    .option-text {
        font-size: 1rem;
        padding: 0 25px 0 8px;
    }
}

@media screen and (max-width: 576px) {
    .favorites-modal-content {
        width: 98%;
        max-height: 90vh;
    }
    
    .favorite-kanji {
        font-size: 1.2rem;
    }
    
    .favorite-kana {
        font-size: 0.9rem;
    }

    .option-kanji {
        font-size: 1rem;
    }
    
    .option-reading {
        font-size: 0.7rem;
        padding: 1px 5px;
    }

    .reading-options {
        gap: var(--spacing-xs);
    }
    
    .reading-option {
        padding: var(--spacing-sm);
    }
    
    .reading-option h4 {
        font-size: 1rem;
    }
    
    .reading-option p {
        font-size: 0.85rem;
    }

    .set-options {
        grid-template-columns: repeat(2, 1fr); /* 2 kolom di layar kecil */
        gap: 0.5rem;
    }
    
    .set-option {
        min-height: 60px;
    }
    
    .category-options {
        grid-template-columns: 1fr;
        gap: var(--spacing-sm);
    }

    .answer-options {
        display: flex !important;
        flex-direction: column !important;
        gap: 12px;
        max-width: 100%;
        padding: 0 15px;
        grid-template-columns: none !important; /* Override grid */
    }
    
    .answer-option {
        width: 100% !important;
        min-height: 65px;
        padding: 12px 16px 12px 40px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: flex-start !important;
        text-align: left !important;
        grid-column: unset !important; /* Remove grid positioning */
        grid-row: unset !important; /* Remove grid positioning */
    }
    
    .option-letter {
        position: absolute !important;
        top: 50% !important;
        left: 12px !important;
        transform: translateY(-50%) !important;
        width: 20px !important;
        height: 20px !important;
        font-size: 0.65rem !important;
    }
    
    .option-text {
        font-size: 1.3rem !important;
        text-align: left !important;
        padding: 0 !important;
        margin-left: 10px !important;
        width: auto !important;
        justify-content: flex-start !important;
        display: block !important;
    }

    /* Pastikan option text container juga mengikuti layout vertikal */
    .option-text-container {
        flex-direction: column !important;
        align-items: flex-start !important;
        justify-content: center !important;
        text-align: left !important;
        width: 100% !important;
    }

    .option-kanji {
        font-size: 1.1rem !important;
        text-align: left !important;
    }
    
    .option-reading {
        font-size: 0.7rem !important;
        padding: 1px 5px !important;
        text-align: left !important;
        margin-top: 2px !important;
    }

    .typing-input-group {
        flex-direction: column !important;
        gap: 1rem;
    }
    
    .submit-typing-btn {
        min-width: auto;
        width: 100%;
    }
    
    .results-stats {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }
    
    .footer-links {
        text-align: center;
    }
    
    .footer-bottom {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .vocabulary-display span {
        font-size: 2.2rem;
    }

    .meaning-display span {
        font-size: 1.4rem;
    }

    .reading-display {
        font-size: 0.75rem;
        padding: 4px 10px;
    }

    .part-of-speech {
        font-size: 0.65rem !important;
        padding: 2px 6px;
        top: 4px;
        right: 4px;
        max-width: 160px;
    }

    .category-display {
        font-size: 0.65rem !important;
        padding: 2px 6px;
        top: 4px;
        right: 4px;
        max-width: 160px;
    }

    .question-text h2 {
        font-size: 1.1rem;
    }

    .answer-option {
        min-height: 65px;
        padding: 10px 14px;
    }

    .option-text {
        font-size: 1rem;
        padding: 0 22px 0 6px;
    }
}

@media screen and (max-width: 480px) {
    .vocabulary-display {
        padding: 1.8rem 1rem 1.5rem 1rem;
    }

    .meaning-display {
        padding: 1.8rem 1rem 1.5rem 1rem;
    }

    .answer-option {
        min-height: 60px;
        padding: 8px 12px;
    }

    .option-text {
        font-size: 0.95rem;
        padding: 0 20px 0 6px;
    }

    .typing-input-group {
        max-width: 350px;
    }

    .part-of-speech {
        font-size: 0.6rem !important;
        padding: 2px 5px;
        top: 3px;
        right: 3px;
        max-width: 140px;
        opacity: 0.7;
    }

    .category-display {
        font-size: 0.6rem !important;
        padding: 2px 5px;
        top: 3px;
        right: 3px;
        max-width: 140px;
        opacity: 0.7;
    }
}

/* ✅ Pastikan mode yang tidak aktif tersembunyi dengan !important */
.answer-options:not(.active) {
    display: none !important;
}

.typing-container:not(.active) {
    display: none !important;
}

/* Mode yang aktif */
.answer-options.active {
    display: grid !important;
}

.typing-container.active {
    display: flex !important;
}

/* ✅ Tambahan untuk memastikan typing mode tersembunyi saat multiple choice aktif */
#multipleChoiceAnswers.active ~ #typingAnswer {
    display: none !important;
}

#typingAnswer.active ~ #multipleChoiceAnswers {
    display: none !important;
}