:root {
    --bg-dark: #121212;
    --bg-card: #1e1e1e;
    --accent: #ff4b4b;
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --success: #58cc02;
    --error: #ff4b4b;
    --nav-bg: #1e1e1e;
    --transition: all 0.3s ease;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    height: 100vh;
}

.hidden {
    display: none !important;
}

/* PIN Overlay */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-dark);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.pin-container {
    text-align: center;
    width: 80%;
}

.pin-container h1 {
    margin-bottom: 10px;
    font-size: 24px;
}

.pin-inputs {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin: 30px 0;
}

.pin-digit {
    width: 50px;
    height: 60px;
    background: var(--bg-card);
    border: 2px solid #333;
    border-radius: 12px;
    text-align: center;
    font-size: 28px;
    color: white;
}

.pin-digit:focus {
    border-color: var(--accent);
    outline: none;
}

.error-msg {
    color: var(--error);
    margin-top: 10px;
    font-size: 14px;
}

/* Header & Nav */
header {
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-dark);
}

.logo {
    font-weight: 600;
    font-size: 22px;
    letter-spacing: 1px;
}

.bottom-nav {
    position: fixed;
    bottom: 0;
    width: 100%;
    height: 70px;
    background: var(--nav-bg);
    display: flex;
    justify-content: space-around;
    padding-bottom: 20px;
    border-top: 1px solid #333;
}

.nav-item {
    background: none;
    border: none;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 10px;
}

.nav-item.active {
    color: var(--accent);
}

.nav-item .icon {
    font-size: 20px;
    margin-bottom: 4px;
}

.nav-item .label {
    font-size: 12px;
}

/* Content Area */
main {
    padding: 20px;
    padding-bottom: 100px;
}

/* Kana Grid */
.kana-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    margin-top: 20px;
}

.kana-card {
    background: var(--bg-card);
    aspect-ratio: 1/1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border-radius: 12px;
    border: 2px solid #333;
    transition: var(--transition);
    position: relative;
}

.kana-card .jp {
    font-size: 24px;
    font-weight: 500;
}

.kana-card .rm {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Quiz Styles */
.quiz-container {
    text-align: center;
}

.progress-bar-container {
    width: 100%;
    height: 12px;
    background: #333;
    border-radius: 6px;
    margin-bottom: 40px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: var(--success);
    width: 0%;
    transition: width 0.3s ease;
}

.question-card {
    font-size: 80px;
    margin-bottom: 40px;
}

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

.option-btn {
    background: var(--bg-card);
    border: 2px solid #333;
    border-radius: 16px;
    padding: 20px;
    color: white;
    font-size: 20px;
    cursor: pointer;
    transition: var(--transition);
}

.option-btn:active {
    transform: scale(0.95);
}

/* Feedback Overlay */
.feedback-overlay {
    position: fixed;
    bottom: 0;
    width: 100%;
    padding: 40px 20px;
    border-top-left-radius: 30px;
    border-top-right-radius: 30px;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.18, 0.89, 0.32, 1.28);
    z-index: 500;
}

.feedback-overlay.show {
    transform: translateY(0);
}

.feedback-overlay.correct {
    background: #d7ffb8;
    color: #58cc02;
}

.feedback-overlay.incorrect {
    background: #ffdfe0;
    color: #ff4b4b;
}

.btn-primary {
    width: 100%;
    padding: 15px;
    border-radius: 16px;
    border: none;
    font-weight: 600;
    font-size: 16px;
    background: var(--accent);
    color: white;
    margin-top: 20px;
}

/* Module Cards */
.module-card {
    background: var(--bg-card);
    border: 2px solid #333;
    border-radius: 20px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 15px;
    cursor: pointer;
    transition: var(--transition);
}

.module-card:hover {
    border-color: var(--accent);
}

.module-icon {
    font-size: 30px;
    background: #2a2a2a;
    width: 60px;
    height: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 15px;
}

.module-info h3 {
    font-size: 18px;
    margin-bottom: 4px;
}

.module-info p {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Tabs */
.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.tab-btn {
    flex: 1;
    background: #2a2a2a;
    border: none;
    padding: 10px;
    border-radius: 10px;
    color: white;
    cursor: pointer;
}

.tab-btn.active {
    background: var(--accent);
}

/* Filter Tabs */
.filter-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    overflow-x: auto;
    padding-bottom: 5px;
}

.filter-btn {
    background: #2a2a2a;
    border: 1px solid #333;
    padding: 6px 12px;
    border-radius: 20px;
    color: var(--text-secondary);
    font-size: 13px;
    white-space: nowrap;
    cursor: pointer;
    transition: var(--transition);
}

.filter-btn.active {
    background: rgba(255, 75, 75, 0.15);
    border-color: var(--accent);
    color: var(--accent);
}

/* Progress Section Enhancements */
.section-title {
    margin: 25px 0 15px 0;
    font-size: 18px;
    border-left: 4px solid var(--accent);
    padding-left: 12px;
}

.progress-item {
    background: var(--bg-card);
    padding: 12px 15px;
    border-radius: 12px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.progress-item label {
    font-size: 14px;
    width: 60px;
}

.mini-bar-container {
    flex: 1;
    height: 8px;
    background: #333;
    border-radius: 4px;
    overflow: hidden;
}

.mini-bar-fill {
    height: 100%;
    background: var(--success);
    width: 0%;
    transition: width 0.5s ease;
}

.progress-item span {
    font-size: 12px;
    color: var(--text-secondary);
    min-width: 40px;
    text-align: right;
}

/* Weak Points Module */
.weak-points {
    border: 1.5px solid rgba(255, 75, 75, 0.4);
    background: linear-gradient(135deg, var(--bg-card), rgba(255, 75, 75, 0.08));
}

.weak-points .module-icon {
    background: rgba(255, 75, 75, 0.15);
    filter: drop-shadow(0 0 5px rgba(255, 75, 75, 0.3));
}

/* Accordion / Module Groups */
.module-group {
    background: var(--bg-card);
    border-radius: 12px;
    margin-bottom: 15px;
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.module-group-header {
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.02);
}

.module-group-header:hover {
    background: rgba(255, 255, 255, 0.05);
}

.module-group-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out;
}

.module-group.active .module-group-content {
    max-height: 1000px;
    /* arbitrary large value */
    padding-bottom: 10px;
}

.module-group .toggle-icon {
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

.module-group.active .toggle-icon {
    transform: rotate(180deg);
}

/* Grammar Section Styles */
.grammar-lesson-card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    cursor: pointer;
    border-left: 5px solid var(--accent);
    transition: transform 0.2s;
}

.grammar-lesson-card:hover {
    transform: translateX(5px);
}

.grammar-explanation {
    background: rgba(255, 255, 255, 0.05);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 30px;
    line-height: 1.8;
}

.grammar-box {
    background: #2a2a2a;
    border-left: 4px solid var(--success);
    padding: 15px;
    margin: 15px 0;
    font-family: monospace;
    font-size: 1.1em;
}

/* Sentence Builder Quiz */
.sentence-builder-area {
    min-height: 60px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 10px;
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.word-bank {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.word-chip {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: bold;
    color: #fff;
    transition: all 0.2s;
    min-width: 60px;
    min-height: 40px;
}

.word-chip:hover {
    background: var(--accent);
    border-color: var(--accent);
}

.word-chip.used {
    opacity: 0.3;
    pointer-events: none;
}

/* Card Stats */
.card-stats {
    position: absolute;
    top: 4px;
    right: 4px;
    font-size: 9px;
    background: rgba(0, 0, 0, 0.6);
    padding: 1px 4px;
    border-radius: 4px;
    color: var(--accent);
    pointer-events: none;
    font-weight: bold;
}

/* Streak & Results */
.streak-box {
    background: #2a2a2a;
    padding: 15px;
    border-radius: 15px;
    text-align: center;
    font-weight: 600;
}

/* Vocab Styles */
.vocab-item {
    justify-content: space-between;
    padding: 15px 25px;
    margin-bottom: 10px;
    cursor: default;
}

.vocab-jp {
    display: flex;
    flex-direction: column;
}

.vocab-jp .jp {
    font-size: 20px;
    font-weight: 600;
}

.vocab-jp .rm {
    font-size: 13px;
    color: var(--text-secondary);
}

.vocab-de {
    font-size: 15px;
    color: var(--text-primary);
    text-align: right;
    max-width: 50%;
}

.vocab-item:hover {
    border-color: #333;
    /* Kein Hover-Effekt wie bei Modul-Karten */
}

/* Animations */
@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    75% {
        transform: translateX(5px);
    }
}

.shake {
    animation: shake 0.3s ease-in-out 2;
}

.quiz-header {
    margin-bottom: 20px;
}

.quiz-title {
    font-size: 14px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}