:root {
    --primary-color: #4361ee;
    --secondary-color: #3a0ca3;
    --accent-color: #f72585;
    --success-color: #4cc9f0;
    --danger-color: #f72585;
    --light-bg: #f8f9fa;
    --dark-bg: #212529;
    --card-bg: #ffffff;
    --text-color: #333333;
    --border-radius: 12px;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    
    /* Answer button colors */
    --option-a-color: #4361ee;
    --option-a-bg: rgba(67, 97, 238, 0.15);
    --option-b-color: #ff9500;
    --option-b-bg: rgba(255, 149, 0, 0.15);
    --option-c-color: #1dd1a1;
    --option-c-bg: rgba(29, 209, 161, 0.15);
    --option-d-color: #a29bfe;
    --option-d-bg: rgba(162, 155, 254, 0.15);
}

.dark-theme {
    --light-bg: #121212;
    --dark-bg: #1e1e1e;
    --card-bg: #2d2d2d;
    --text-color: #f0f0f0;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--light-bg);
    color: var(--text-color);
    line-height: 1.6;
    transition: background-color 0.3s, color 0.3s;
}

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

/* Navigation */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    background-color: var(--card-bg);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
}

.nav-stats {
    display: flex;
    gap: 20px;
    align-items: center;
}

.stat {
    background-color: var(--light-bg);
    padding: 5px 15px;
    border-radius: 20px;
    font-weight: 600;
}

.btn-back {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-back:hover {
    background-color: var(--secondary-color);
    transform: translateY(-1px);
}

.btn-back i {
    font-size: 0.85rem;
}

.nav-menu {
    display: flex;
    gap: 10px;
}

.nav-menu button {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background-color 0.2s;
    color: var(--text-color);
}

.nav-menu button:hover {
    background-color: var(--light-bg);
}

/* Hamburger Menu */
.hamburger-menu {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 44px;
    height: 44px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 1001;
}

.hamburger-menu span {
    width: 28px;
    height: 3px;
    background-color: var(--text-color);
    border-radius: 3px;
    transition: all 0.3s ease;
    transform-origin: center;
}

.hamburger-menu.active span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.hamburger-menu.active span:nth-child(2) {
    opacity: 0;
}

.hamburger-menu.active span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* Dashboard */
.dashboard-header {
    text-align: center;
    margin: 40px 0;
}

.dashboard-header h1 {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.subtitle {
    font-size: 1.2rem;
    color: #666;
}

.modes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.mode-card {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: var(--shadow);
    transition: transform 0.3s, box-shadow 0.3s;
}

.mode-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.15);
}

.mode-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.mode-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.mode-header h3 {
    margin: 0;
    color: var(--primary-color);
    font-size: 1.2rem;
}

.mode-content p {
    color: #666;
    margin-bottom: 15px;
}

.btn-start {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: 600;
    margin-top: 15px;
    transition: background-color 0.3s;
    width: 100%;
}

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

/* Stats Section */
.stats-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 40px;
}

.stat-card {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 25px;
    box-shadow: var(--shadow);
}

.stat-card h3 {
    margin-bottom: 20px;
    color: var(--primary-color);
}

.progress-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: conic-gradient(var(--primary-color) 0%, var(--light-bg) 0%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 20px auto;
    position: relative;
}

.progress-circle::before {
    content: '';
    position: absolute;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background-color: var(--card-bg);
}

.progress-circle span {
    position: relative;
    z-index: 1;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
}

#weak-areas {
    list-style: none;
    padding: 0;
}

#weak-areas li {
    padding: 10px;
    margin: 5px 0;
    background-color: var(--light-bg);
    border-radius: 8px;
}

.achievements-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.achievement-badge {
    background-color: var(--light-bg);
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
}

.no-achievements {
    color: #666;
    font-style: italic;
}

/* Article Progress Styles */
.article-progress {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 15px;
}

.article-level-progress {
    display: flex;
    align-items: center;
    gap: 12px;
}

.level-label {
    font-weight: 700;
    font-size: 0.9rem;
    min-width: 35px;
    color: var(--primary-color);
}

.progress-bar {
    flex: 1;
    height: 12px;
    background-color: var(--light-bg);
    border-radius: 6px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--success-color));
    border-radius: 6px;
    transition: width 0.5s ease;
}

.level-count {
    font-size: 0.85rem;
    color: #666;
    min-width: 60px;
    text-align: right;
}

.total-articles {
    text-align: center;
    font-weight: 600;
    color: var(--text-color);
    margin-top: 10px;
    padding-top: 15px;
    border-top: 1px solid var(--light-bg);
}

.total-articles span {
    color: var(--primary-color);
    font-size: 1.1rem;
}

/* Views */
.view {
    display: none;
}

.view.active {
    display: block;
}

/* Quiz View */
.quiz-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.quiz-info {
    display: flex;
    gap: 20px;
    align-items: center;
}

.quiz-mode-label {
    background-color: var(--primary-color);
    color: white !important;
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: 600;
}

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

.question-card {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 30px;
    box-shadow: var(--shadow);
}

.question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.category-badge {
    background-color: var(--primary-color);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

.difficulty {
    background-color: var(--accent-color);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

.question-text {
    margin: 30px 0;
}

.question-text p {
    font-size: 1.5rem;
    line-height: 1.8;
    margin-bottom: 10px;
    font-weight: 700;
}

.translation {
    font-style: italic;
    color: #666;
    font-size: 1.1rem;
}

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

.option-btn {
    background-color: var(--light-bg);
    border: 2px solid #ddd;
    border-radius: var(--border-radius);
    padding: 15px;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s;
    display: flex;
    gap: 15px;
    align-items: center;
    color: var(--text-color);
}

/* Colored option buttons */
.option-btn[data-letter="A"] {
    background-color: var(--option-a-bg);
    border-color: var(--option-a-color);
}

.option-btn[data-letter="B"] {
    background-color: var(--option-b-bg);
    border-color: var(--option-b-color);
}

.option-btn[data-letter="C"] {
    background-color: var(--option-c-bg);
    border-color: var(--option-c-color);
}

.option-btn[data-letter="D"] {
    background-color: var(--option-d-bg);
    border-color: var(--option-d-color);
}

.option-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.option-btn.selected {
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.3);
}

.option-btn.correct {
    border-color: var(--success-color);
    background-color: rgba(76, 201, 240, 0.2);
    box-shadow: 0 0 0 3px rgba(76, 201, 240, 0.3);
}

.option-btn.incorrect {
    border-color: var(--danger-color);
    background-color: rgba(247, 37, 133, 0.2);
    box-shadow: 0 0 0 3px rgba(247, 37, 133, 0.3);
}

.option-letter {
    color: white;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    flex-shrink: 0;
}

/* Colored option letters */
.option-btn[data-letter="A"] .option-letter {
    background-color: var(--option-a-color);
}

.option-btn[data-letter="B"] .option-letter {
    background-color: var(--option-b-color);
}

.option-btn[data-letter="C"] .option-letter {
    background-color: var(--option-c-color);
}

.option-btn[data-letter="D"] .option-letter {
    background-color: var(--option-d-color);
}

.option-text {
    flex: 1;
    font-size: 1.1rem;
}

.quiz-controls {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
}

/* Buttons */
.btn-primary {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.3s;
    font-size: 1rem;
}

.btn-primary:hover:not(:disabled) {
    background-color: var(--secondary-color);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-secondary {
    background-color: var(--light-bg);
    color: var(--text-color);
    border: 2px solid #ddd;
    padding: 10px 20px;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
    font-size: 1rem;
}

.btn-secondary:hover {
    border-color: var(--primary-color);
}

/* Feedback */
#feedback-area {
    margin-top: 30px;
}

.feedback {
    padding: 20px;
    border-radius: var(--border-radius);
    animation: slideIn 0.3s ease;
}

.feedback.correct {
    background-color: rgba(76, 201, 240, 0.1);
    border-left: 4px solid var(--success-color);
}

.feedback.incorrect {
    background-color: rgba(247, 37, 133, 0.1);
    border-left: 4px solid var(--danger-color);
}

.feedback h3 {
    margin-bottom: 15px;
}

.feedback p {
    margin: 10px 0;
}

.explanation {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #ddd;
    font-style: italic;
}

.example {
    margin-top: 10px;
    padding: 10px;
    background-color: var(--light-bg);
    border-radius: 8px;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal-content {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 30px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-content h3 {
    margin-bottom: 20px;
    color: var(--primary-color);
}

.modal-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.tab-btn {
    flex: 1;
    padding: 10px;
    background-color: var(--light-bg);
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.3s;
    color: var(--text-color);
}

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

.tab-content {
    margin-top: 20px;
}

textarea {
    width: 100%;
    min-height: 200px;
    font-family: monospace;
    padding: 15px;
    border-radius: var(--border-radius);
    border: 2px solid #ddd;
    background-color: var(--light-bg);
    color: var(--text-color);
    margin: 15px 0;
    resize: vertical;
}

.btn-close {
    margin-top: 20px;
    width: 100%;
}

.warning {
    color: var(--danger-color);
    font-weight: 600;
    margin-top: 10px;
}

/* Footer */
.footer {
    text-align: center;
    padding: 30px;
    margin-top: 50px;
    color: #666;
}

.footer .small {
    font-size: 0.9rem;
    margin-top: 10px;
}

/* Toast Notifications */
#toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 400px;
}

.toast {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 16px 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    animation: slideInRight 0.3s ease-out;
    position: relative;
    overflow: hidden;
    min-width: 300px;
    border-left: 4px solid;
}

.toast.success {
    border-left-color: #4cc9f0;
}

.toast.error {
    border-left-color: #f72585;
}

.toast.warning {
    border-left-color: #feca57;
}

.toast.info {
    border-left-color: #4361ee;
}

.toast.achievement {
    border-left-color: #ffd700;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1) 0%, var(--card-bg) 100%);
}

.toast-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
    line-height: 1;
}

.toast.success .toast-icon {
    color: #4cc9f0;
}

.toast.error .toast-icon {
    color: #f72585;
}

.toast.warning .toast-icon {
    color: #feca57;
}

.toast.info .toast-icon {
    color: #4361ee;
}

.toast.achievement .toast-icon {
    color: #ffd700;
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text-color);
}

.toast-message {
    font-size: 0.9rem;
    color: var(--text-color);
    opacity: 0.8;
    line-height: 1.4;
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-color);
    opacity: 0.5;
    cursor: pointer;
    padding: 0;
    font-size: 1.2rem;
    line-height: 1;
    transition: opacity 0.2s;
    flex-shrink: 0;
}

.toast-close:hover {
    opacity: 1;
}

.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background-color: currentColor;
    opacity: 0.3;
    animation: progressBar linear;
}

.toast.removing {
    animation: slideOutRight 0.3s ease-out forwards;
}

/* History View */
.history-header {
    margin-bottom: 25px;
}

.history-title-badge {
    display: inline-block;
    background-color: var(--primary-color);
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 20px;
}

/* History Tabs */
.history-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 25px;
}

.history-tab-btn {
    border: 2px solid;
    padding: 10px 20px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
    border-radius: 25px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.history-tab-btn[data-tab="grammar"] {
    color: #4361ee;
    border-color: #4361ee;
    background-color: rgba(67, 97, 238, 0.1);
}

.history-tab-btn[data-tab="grammar"]:hover {
    background-color: rgba(67, 97, 238, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(67, 97, 238, 0.2);
}

.history-tab-btn[data-tab="grammar"].active {
    color: white;
    background-color: #4361ee;
    box-shadow: 0 4px 12px rgba(67, 97, 238, 0.4);
}

.history-tab-btn[data-tab="articles"] {
    color: #1dd1a1;
    border-color: #1dd1a1;
    background-color: rgba(29, 209, 161, 0.1);
}

.history-tab-btn[data-tab="articles"]:hover {
    background-color: rgba(29, 209, 161, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(29, 209, 161, 0.2);
}

.history-tab-btn[data-tab="articles"].active {
    color: white;
    background-color: #1dd1a1;
    box-shadow: 0 4px 12px rgba(29, 209, 161, 0.4);
}

.history-tab-content {
    display: none;
}

.history-tab-content.active {
    display: block;
}

.filter-toggle-btn {
    width: 100%;
    background-color: var(--card-bg);
    border: 2px solid #ddd;
    border-radius: var(--border-radius);
    padding: 12px 20px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.3s;
    margin-bottom: 15px;
}

.filter-toggle-btn:hover {
    border-color: var(--primary-color);
    background-color: var(--light-bg);
}

.filter-toggle-btn i:first-child {
    margin-right: 8px;
}

.filter-toggle-btn .toggle-icon {
    transition: transform 0.3s;
    font-size: 0.9rem;
}

.filter-toggle-btn.active .toggle-icon {
    transform: rotate(180deg);
}

.history-controls {
    display: flex;
    gap: 10px;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.3s ease-out, opacity 0.3s ease-out, margin-bottom 0.3s ease-out;
    margin-bottom: 0;
}

.history-controls.expanded {
    max-height: 200px;
    opacity: 1;
    margin-bottom: 20px;
}

.filter-select {
    flex: 1;
    padding: 8px 12px;
    border-radius: var(--border-radius);
    border: 2px solid #ddd;
    background-color: var(--card-bg);
    color: var(--text-color);
    font-size: 0.95rem;
    cursor: pointer;
    transition: border-color 0.3s;
    min-width: 0;
}

.filter-select:hover {
    border-color: var(--primary-color);
}

.history-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-box {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 20px;
    text-align: center;
    box-shadow: var(--shadow);
}

.stat-value {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.stat-label {
    font-size: 0.9rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Compact Stats Layout */
.history-stats-compact {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-around;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-width: 70px;
}

.stat-item .stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-color);
    margin: 0;
}

.stat-item .stat-label {
    font-size: 0.85rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-divider {
    width: 1px;
    height: 40px;
    background-color: #ddd;
}

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

.question-item {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
}

.question-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.question-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
    gap: 15px;
}

.question-item-text {
    flex: 1;
}

.question-german {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 5px;
}

.question-english {
    font-size: 0.95rem;
    color: #666;
    font-style: italic;
}

.question-meta {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.question-item-body {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.streak-display {
    display: flex;
    gap: 8px;
    align-items: center;
}

.streak-indicator {
    font-size: 1.5rem;
    transition: transform 0.2s;
}

.streak-indicator:hover {
    transform: scale(1.2);
}

.question-stats {
    display: flex;
    gap: 20px;
    align-items: center;
}

.accuracy-badge {
    background-color: var(--light-bg);
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.95rem;
}

.accuracy-badge.high {
    background-color: rgba(76, 201, 240, 0.2);
    color: #4cc9f0;
}

.accuracy-badge.medium {
    background-color: rgba(254, 202, 87, 0.2);
    color: #feca57;
}

.accuracy-badge.low {
    background-color: rgba(247, 37, 133, 0.2);
    color: #f72585;
}

.status-badge {
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
}

.status-badge.mastered {
    background-color: rgba(255, 215, 0, 0.2);
    color: #ffd700;
}

.status-badge.learning {
    background-color: rgba(67, 97, 238, 0.2);
    color: var(--primary-color);
}

.status-badge.needs-practice {
    background-color: rgba(247, 37, 133, 0.2);
    color: #f72585;
}

.status-badge.not-attempted {
    background-color: var(--light-bg);
    color: #999;
}

.no-questions {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.no-questions i {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.3;
}

/* Preposition Guide Modal */
.preposition-guide {
    max-width: 700px;
    max-height: 85vh;
    overflow-y: auto;
}

.preposition-guide h2 {
    color: var(--primary-color);
    margin-bottom: 25px;
    text-align: center;
    font-size: 1.8rem;
}

.guide-section {
    background-color: var(--light-bg);
    border-radius: var(--border-radius);
    padding: 20px;
    margin-bottom: 20px;
    border-left: 4px solid var(--primary-color);
}

.guide-section h3 {
    margin-bottom: 12px;
    font-size: 1.2rem;
}

.guide-section p {
    margin: 10px 0;
    line-height: 1.6;
}

.guide-section strong {
    color: var(--primary-color);
}

.guide-section .example {
    background-color: var(--card-bg);
    padding: 12px;
    border-radius: 8px;
    margin-top: 10px;
    font-size: 0.95rem;
    border-left: 3px solid var(--success-color);
}

.verb-prep-list {
    list-style: none;
    padding: 0;
    margin: 10px 0;
}

.verb-prep-list li {
    padding: 8px 12px;
    margin: 5px 0;
    background-color: var(--card-bg);
    border-radius: 8px;
    border-left: 3px solid var(--accent-color);
}

.guide-buttons {
    display: flex;
    gap: 15px;
    margin-top: 25px;
    justify-content: center;
}

.guide-buttons button {
    flex: 1;
    max-width: 200px;
}

/* Settings Modal */
.settings-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin: 20px 0;
}

.settings-btn {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
    background-color: var(--light-bg);
    border: 2px solid #ddd;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.3s;
    text-align: left;
    width: 100%;
}

.settings-btn:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.settings-btn.danger:hover {
    border-color: var(--danger-color);
}

.settings-btn i {
    font-size: 1.5rem;
    color: var(--primary-color);
    width: 30px;
    text-align: center;
}

.settings-btn.danger i {
    color: var(--danger-color);
}

.settings-btn div {
    flex: 1;
}

.settings-btn strong {
    display: block;
    font-size: 1.1rem;
    margin-bottom: 4px;
    color: var(--text-color);
}

.settings-btn p {
    font-size: 0.9rem;
    color: #666;
    margin: 0;
}

/* Confirmation Modal */
.confirm-modal {
    max-width: 400px;
    text-align: center;
}

.confirm-modal h3 {
    margin-bottom: 15px;
}

.confirm-modal p {
    margin-bottom: 25px;
    font-size: 1.1rem;
    line-height: 1.6;
}

.confirm-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.confirm-buttons button {
    flex: 1;
    max-width: 150px;
}

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

/* Animations */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideOutRight {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(120%);
    }
}

@keyframes progressBar {
    from {
        width: 100%;
    }
    to {
        width: 0%;
    }
}

/* Grammar Reference Styles */
.grammar-header {
    margin-bottom: 25px;
}

.grammar-title-badge {
    display: inline-block;
    background-color: var(--primary-color);
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 20px;
}

.grammar-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 25px;
}

.grammar-tab-btn {
    border: 2px solid;
    padding: 10px 20px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
    border-radius: 25px;
}

/* Unique colors for each pill */
.grammar-tab-btn[data-topic="cases"] {
    color: #4361ee;
    border-color: #4361ee;
    background-color: rgba(67, 97, 238, 0.1);
}

.grammar-tab-btn[data-topic="cases"]:hover {
    background-color: rgba(67, 97, 238, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(67, 97, 238, 0.2);
}

.grammar-tab-btn[data-topic="cases"].active {
    color: white;
    background-color: #4361ee;
    box-shadow: 0 4px 12px rgba(67, 97, 238, 0.4);
}

.grammar-tab-btn[data-topic="prepositions"] {
    color: #ff9500;
    border-color: #ff9500;
    background-color: rgba(255, 149, 0, 0.1);
}

.grammar-tab-btn[data-topic="prepositions"]:hover {
    background-color: rgba(255, 149, 0, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(255, 149, 0, 0.2);
}

.grammar-tab-btn[data-topic="prepositions"].active {
    color: white;
    background-color: #ff9500;
    box-shadow: 0 4px 12px rgba(255, 149, 0, 0.4);
}

.grammar-tab-btn[data-topic="verb-conjugation"] {
    color: #1dd1a1;
    border-color: #1dd1a1;
    background-color: rgba(29, 209, 161, 0.1);
}

.grammar-tab-btn[data-topic="verb-conjugation"]:hover {
    background-color: rgba(29, 209, 161, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(29, 209, 161, 0.2);
}

.grammar-tab-btn[data-topic="verb-conjugation"].active {
    color: white;
    background-color: #1dd1a1;
    box-shadow: 0 4px 12px rgba(29, 209, 161, 0.4);
}

.grammar-tab-btn[data-topic="adjective-endings"] {
    color: #a29bfe;
    border-color: #a29bfe;
    background-color: rgba(162, 155, 254, 0.1);
}

.grammar-tab-btn[data-topic="adjective-endings"]:hover {
    background-color: rgba(162, 155, 254, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(162, 155, 254, 0.2);
}

.grammar-tab-btn[data-topic="adjective-endings"].active {
    color: white;
    background-color: #a29bfe;
    box-shadow: 0 4px 12px rgba(162, 155, 254, 0.4);
}

.grammar-tab-btn[data-topic="modal-verbs"] {
    color: #f72585;
    border-color: #f72585;
    background-color: rgba(247, 37, 133, 0.1);
}

.grammar-tab-btn[data-topic="modal-verbs"]:hover {
    background-color: rgba(247, 37, 133, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(247, 37, 133, 0.2);
}

.grammar-tab-btn[data-topic="modal-verbs"].active {
    color: white;
    background-color: #f72585;
    box-shadow: 0 4px 12px rgba(247, 37, 133, 0.4);
}

.grammar-tab-btn[data-topic="word-order"] {
    color: #00d2d3;
    border-color: #00d2d3;
    background-color: rgba(0, 210, 211, 0.1);
}

.grammar-tab-btn[data-topic="word-order"]:hover {
    background-color: rgba(0, 210, 211, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 210, 211, 0.2);
}

.grammar-tab-btn[data-topic="word-order"].active {
    color: white;
    background-color: #00d2d3;
    box-shadow: 0 4px 12px rgba(0, 210, 211, 0.4);
}

.grammar-tab-btn[data-topic="conjunctions"] {
    color: #feca57;
    border-color: #feca57;
    background-color: rgba(254, 202, 87, 0.1);
}

.grammar-tab-btn[data-topic="conjunctions"]:hover {
    background-color: rgba(254, 202, 87, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(254, 202, 87, 0.2);
}

.grammar-tab-btn[data-topic="conjunctions"].active {
    color: white;
    background-color: #feca57;
    box-shadow: 0 4px 12px rgba(254, 202, 87, 0.4);
}

.grammar-tab-btn[data-topic="reflexive-verbs"] {
    color: #5f27cd;
    border-color: #5f27cd;
    background-color: rgba(95, 39, 205, 0.1);
}

.grammar-tab-btn[data-topic="reflexive-verbs"]:hover {
    background-color: rgba(95, 39, 205, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(95, 39, 205, 0.2);
}

.grammar-tab-btn[data-topic="reflexive-verbs"].active {
    color: white;
    background-color: #5f27cd;
    box-shadow: 0 4px 12px rgba(95, 39, 205, 0.4);
}

.topic-description {
    text-align: center;
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 30px;
    padding: 15px;
    background-color: var(--light-bg);
    border-radius: var(--border-radius);
}

.empty-topic {
    text-align: center;
    padding: 80px 40px;
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.empty-topic h3 {
    color: var(--primary-color);
    font-size: 1.8rem;
    margin-bottom: 15px;
}

.empty-topic p {
    font-size: 1.1rem;
    line-height: 1.6;
}

.grammar-section {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: var(--shadow);
}

.section-header {
    border-left: 4px solid var(--primary-color);
    padding-left: 20px;
    margin-bottom: 25px;
}

.section-header h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: var(--text-color);
}

.section-description {
    color: #666;
    font-size: 1rem;
    margin-top: 8px;
}

.grammar-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.grammar-table thead {
    background-color: var(--primary-color);
    color: white;
}

.grammar-table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    font-size: 1rem;
}

.grammar-table td {
    padding: 15px;
    border-bottom: 1px solid #ddd;
    vertical-align: top;
}

.grammar-table tbody tr:hover {
    background-color: var(--light-bg);
}

.german-word {
    color: var(--primary-color);
    font-size: 1.1rem;
}

.example-text {
    font-style: italic;
    margin-bottom: 5px;
    color: var(--text-color);
}

.translation-text {
    font-size: 0.9rem;
    color: #666;
}

.case-badge {
    background-color: var(--accent-color);
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
}

.two-way-table th:nth-child(3),
.two-way-table th:nth-child(4) {
    background-color: var(--secondary-color);
}

/* Grammar Reference - New Elements */
.rules-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 20px;
}

.rule-item {
    background-color: var(--light-bg);
    padding: 15px;
    border-radius: 8px;
    border-left: 3px solid var(--primary-color);
}

.rule-title {
    font-size: 1.1rem;
    margin-bottom: 10px;
    color: var(--primary-color);
}

.explanation-text {
    font-size: 0.9rem;
    color: #666;
    margin-top: 5px;
    font-style: italic;
}

.section-note {
    background-color: var(--light-bg);
    padding: 15px;
    border-radius: 8px;
    border-left: 3px solid var(--accent-color);
    margin-top: 20px;
}

.conjugation-block {
    background-color: var(--light-bg);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.conjugation-block h5 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: var(--primary-color);
}

.conjugation-table {
    max-width: 400px;
}

.conjugation-table td:first-child {
    width: 120px;
}

.participles-section {
    margin-top: 20px;
}

.participle-examples {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.participle-item {
    background-color: var(--light-bg);
    padding: 12px;
    border-radius: 8px;
    border-left: 3px solid var(--success-color);
}

.participle-item > div:first-child {
    margin-bottom: 8px;
    font-size: 1.05rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    /* Grammar Reference mobile improvements */
    .grammar-header {
        margin-bottom: 20px;
    }
    
    .grammar-title-badge {
        font-size: 0.95rem;
        padding: 6px 12px;
        margin-bottom: 15px;
    }
    
    .grammar-tabs {
        gap: 8px;
        margin-bottom: 20px;
    }
    
    .grammar-tab-btn {
        padding: 10px 16px;
        font-size: 0.9rem;
    }
    
    .grammar-section {
        padding: 15px;
        margin-bottom: 20px;
    }
    
    .section-header {
        padding-left: 15px;
        margin-bottom: 20px;
    }
    
    .section-header h3 {
        font-size: 1.2rem;
    }
    
    .topic-description {
        font-size: 1rem;
        padding: 12px;
        margin-bottom: 20px;
    }
    
    .navbar {
        flex-wrap: wrap;
        padding: 15px;
        position: sticky;
        top: 0;
    }
    
    .nav-brand {
        flex: 1;
    }
    
    .hamburger-menu {
        display: flex;
        order: 2;
    }
    
    .nav-stats {
        order: 3;
        width: 100%;
        margin-top: 10px;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .nav-menu {
        order: 4;
        width: 100%;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease-out;
        flex-direction: column;
        gap: 8px;
        padding: 0;
    }
    
    .nav-menu.active {
        max-height: 400px;
        padding: 15px 0;
    }
    
    .nav-menu button {
        width: 100%;
        justify-content: flex-start;
        padding: 12px 15px;
        border-radius: var(--border-radius);
        display: flex;
        align-items: center;
        gap: 12px;
        font-size: 1rem;
    }
    
    .nav-menu button i {
        width: 24px;
        text-align: center;
    }
    
    .nav-menu button::after {
        content: attr(title);
        font-size: 1rem;
    }
    
    /* Ensure minimum touch target size */
    .nav-menu button {
        min-width: 44px;
        min-height: 44px;
        font-size: 1.3rem;
    }
    
    .modes-grid {
        grid-template-columns: 1fr;
    }
    
    .options-grid {
        grid-template-columns: 1fr;
    }
    
    /* Larger touch targets for quiz options */
    .option-btn {
        padding: 18px;
        min-height: 60px;
    }
    
    .option-letter {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }
    
    .quiz-controls {
        flex-direction: column;
        width: 100%;
    }
    
    .quiz-controls button {
        width: 100%;
        min-height: 50px;
        font-size: 1.1rem;
    }
    
    .quiz-header {
        flex-direction: column;
        gap: 15px;
    }
    
    .quiz-info {
        flex-direction: column;
        gap: 10px;
        width: 100%;
        text-align: center;
    }
    
    .stats-section {
        grid-template-columns: 1fr;
    }
    
    .dashboard-header h1 {
        font-size: 2rem;
    }
    
    .question-text p {
        font-size: 1.3rem;
    }
    
    /* Grammar tables - convert to cards on mobile */
    .grammar-table {
        display: block;
    }
    
    .grammar-table thead {
        display: none;
    }
    
    .grammar-table tbody {
        display: block;
    }
    
    .grammar-table tr {
        display: block;
        background-color: var(--card-bg);
        border: 2px solid #ddd;
        border-radius: var(--border-radius);
        padding: 15px;
        margin-bottom: 15px;
        box-shadow: var(--shadow);
    }
    
    .grammar-table td {
        display: block;
        text-align: left;
        padding: 8px 0;
        border: none;
        min-width: auto;
    }
    
    .grammar-table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--primary-color);
        display: block;
        margin-bottom: 5px;
        font-size: 0.85rem;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }
    
    .grammar-table td:not(:last-child) {
        border-bottom: 1px solid #eee;
        padding-bottom: 12px;
        margin-bottom: 12px;
    }
    
    /* History view mobile improvements */
    .history-header {
        margin-bottom: 20px;
    }
    
    .history-tabs {
        flex-direction: row;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .history-tab-btn {
        flex-shrink: 0;
        padding: 10px 20px;
        font-size: 0.95rem;
    }
    
    .history-controls {
        flex-direction: column;
        width: 100%;
    }
    
    /* Article progress mobile */
    .article-progress {
        gap: 12px;
    }
    
    .article-level-progress {
        gap: 10px;
    }
    
    .level-label {
        min-width: 30px;
        font-size: 0.85rem;
    }
    
    .level-count {
        font-size: 0.8rem;
        min-width: 55px;
    }
    
    .filter-select {
        width: 100%;
        min-height: 48px;
        font-size: 1rem;
    }
    
    .history-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .question-item-header {
        flex-direction: column;
        gap: 10px;
    }
    
    .question-meta {
        justify-content: flex-start;
    }
    
    .question-item-body {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .question-stats {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        width: 100%;
    }
    
    /* Modal improvements */
    .modal-content {
        width: 95%;
        max-height: 90vh;
        padding: 20px;
    }
    
    /* Toast positioning */
    #toast-container {
        top: 70px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .toast {
        min-width: auto;
        width: 100%;
    }
    
    /* Grammar reference mobile */
    .topic-selector {
        width: 100%;
        min-width: auto;
    }
    
    .grammar-section {
        padding: 20px;
    }
    
    /* Larger buttons for mobile */
    .btn-start,
    .btn-primary,
    .btn-secondary {
        min-height: 48px;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
    }
    
    .question-card {
        padding: 20px 15px;
    }
    
    .nav-brand {
        font-size: 1.2rem;
    }
    
    .nav-brand span {
        display: none;
    }
    
    .nav-brand::after {
        content: 'Get to B1';
    }
    
    /* Smaller stats on very small screens */
    .stat {
        padding: 4px 10px;
        font-size: 0.85rem;
    }
    
    /* Stack history stats vertically */
    .history-stats {
        grid-template-columns: 1fr;
    }
    
    .stat-value {
        font-size: 2rem;
    }
    
    /* Smaller question text on tiny screens */
    .question-text p {
        font-size: 1.2rem;
    }
    
    .translation {
        font-size: 0.95rem;
    }
    
    /* Full-screen modals on very small screens */
    .modal-content {
        width: 100%;
        max-width: 100%;
        max-height: 100vh;
        border-radius: 0;
        padding: 15px;
    }
    
    /* Adjust grammar table for tiny screens */
    .grammar-table th,
    .grammar-table td {
        min-width: 100px;
        padding: 10px;
        font-size: 0.9rem;
    }
    
    /* Smaller mode cards */
    .mode-card {
        padding: 15px;
    }
    
    .mode-icon {
        font-size: 1.5rem;
    }
    
    /* Compact streak indicators */
    .streak-indicator {
        font-size: 1.2rem;
    }
}

/* Landscape orientation optimizations */
@media (max-height: 600px) and (orientation: landscape) {
    .navbar {
        padding: 10px 20px;
    }
    
    .dashboard-header {
        margin: 20px 0;
    }
    
    .dashboard-header h1 {
        font-size: 1.8rem;
    }
    
    .question-card {
        padding: 20px;
    }
    
    .modal-content {
        max-height: 95vh;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    /* Increase all interactive element sizes for touch */
    button,
    .option-btn,
    .filter-select,
    .topic-selector {
        min-height: 44px;
    }
    
    /* Remove hover effects on touch devices */
    .option-btn:hover {
        transform: none;
    }
    
    .mode-card:hover {
        transform: none;
    }
    
    /* Add active states instead */
    .option-btn:active {
        transform: scale(0.98);
    }
    
    .mode-card:active {
        transform: scale(0.98);
    }
    
    button:active {
        transform: scale(0.95);
    }
}

/* ===== SENTENCE BUILDER STYLES ===== */

/* Sentence Builder Container */
.sentence-builder-container {
    max-width: 900px;
    margin: 0 auto;
}

.sentence-card {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 30px;
    box-shadow: var(--shadow);
}

.sentence-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

/* Sentence Prompt */
.sentence-prompt {
    margin-bottom: 30px;
    padding: 20px;
    background-color: var(--light-bg);
    border-radius: var(--border-radius);
    border-left: 4px solid var(--primary-color);
}

.prompt-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #666;
    margin-bottom: 10px;
}

.english-prompt-text {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text-color);
    line-height: 1.6;
}

.interface-label {
    font-size: 0.95rem;
    font-weight: 600;
    color: #666;
    margin-bottom: 12px;
    margin-top: 20px;
}

/* Word Bank Interface */
.wordbank-interface {
    margin: 25px 0;
}

.assembly-area {
    min-height: 80px;
    background-color: var(--light-bg);
    border: 3px dashed #ddd;
    border-radius: var(--border-radius);
    padding: 15px;
    margin-bottom: 25px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    transition: all 0.3s;
}

.assembly-area:empty::before {
    content: 'Drag words here to build your sentence';
    color: #999;
    font-style: italic;
    width: 100%;
    text-align: center;
}

.assembly-area.drag-over {
    border-color: var(--primary-color);
    background-color: rgba(67, 97, 238, 0.05);
}

.word-bank {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 15px;
    background-color: var(--light-bg);
    border-radius: var(--border-radius);
    min-height: 60px;
}

.word-item {
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 12px 20px;
    cursor: move;
    user-select: none;
    transition: all 0.2s ease;
    font-size: 1.1rem;
    font-weight: 500;
}

.word-item:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.word-item:active {
    cursor: grabbing;
}

.word-item.sortable-chosen {
    opacity: 0.5;
}

.word-item.sortable-ghost {
    opacity: 0.3;
    background-color: var(--primary-color);
    color: white;
}

/* Typing Interface */
.typing-interface {
    margin: 25px 0;
}

.typing-input {
    width: 100%;
    padding: 15px 20px;
    font-size: 1.2rem;
    border: 3px solid #ddd;
    border-radius: var(--border-radius);
    background-color: var(--light-bg);
    color: var(--text-color);
    font-family: inherit;
    transition: all 0.3s;
}

.typing-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}

.word-count-hint {
    margin-top: 10px;
    font-size: 0.9rem;
    color: #666;
    font-style: italic;
}

/* Feedback Area for Sentence Builder */
#feedback-area-sb {
    margin-top: 30px;
}

#feedback-area-sb .feedback {
    padding: 25px;
    border-radius: var(--border-radius);
    animation: slideIn 0.3s ease;
}

#feedback-area-sb .feedback.correct {
    background-color: rgba(76, 201, 240, 0.1);
    border-left: 4px solid var(--success-color);
}

#feedback-area-sb .feedback.incorrect {
    background-color: rgba(247, 37, 133, 0.1);
    border-left: 4px solid var(--danger-color);
}

#feedback-area-sb .feedback h3 {
    margin-bottom: 15px;
    font-size: 1.3rem;
}

#feedback-area-sb .feedback p {
    margin: 12px 0;
    line-height: 1.6;
}

#feedback-area-sb .feedback strong {
    color: var(--primary-color);
}

.feedback-detail {
    background-color: var(--light-bg);
    padding: 12px;
    border-radius: 8px;
    margin-top: 12px;
    white-space: pre-line;
}

.xp-earned {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--success-color);
    margin-top: 15px;
    text-align: center;
}

/* Mode Selection Modal */
.mode-selection-modal {
    max-width: 700px;
}

.mode-selection-modal h3 {
    text-align: center;
    font-size: 1.8rem;
    margin-bottom: 10px;
}

.mode-selection-subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 30px;
    font-size: 1.1rem;
}

.mode-selection-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

.mode-selection-card {
    background-color: var(--light-bg);
    border: 3px solid #ddd;
    border-radius: var(--border-radius);
    padding: 25px;
    text-align: center;
    transition: all 0.3s;
    cursor: pointer;
}

.mode-selection-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.mode-selection-card .mode-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.mode-selection-card h4 {
    font-size: 1.3rem;
    margin-bottom: 15px;
    color: var(--text-color);
}

.mode-features {
    list-style: none;
    padding: 0;
    margin: 20px 0;
    text-align: left;
}

.mode-features li {
    padding: 8px 0;
    color: #666;
    font-size: 0.95rem;
}

.btn-mode-select {
    width: 100%;
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: var(--border-radius);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 10px;
}

.btn-mode-select:hover {
    background-color: var(--secondary-color);
    transform: translateY(-2px);
}

/* Responsive Sentence Builder */
@media (max-width: 768px) {
    .sentence-card {
        padding: 20px;
    }
    
    .english-prompt-text {
        font-size: 1.2rem;
    }
    
    .word-bank {
        gap: 10px;
        padding: 12px;
    }
    
    .word-item {
        padding: 8px 14px;
        font-size: 1rem;
    }
    
    .typing-input {
        font-size: 1.1rem;
        padding: 12px 16px;
    }
    
    .mode-selection-grid {
        grid-template-columns: 1fr;
    }
    
    .mode-selection-card {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .sentence-prompt {
        padding: 15px;
    }
    
    .english-prompt-text {
        font-size: 1.1rem;
    }
    
    .word-item {
        padding: 8px 12px;
        font-size: 0.95rem;
    }
    
    .assembly-area {
        min-height: 70px;
        padding: 12px;
    }
    
    .typing-input {
        font-size: 1rem;
        padding: 10px 14px;
    }
    
    #feedback-area-sb .feedback {
        padding: 18px;
    }
}

/* Enhanced Feedback Styles */
.visual-diff {
    background-color: var(--light-bg);
    border-radius: var(--border-radius);
    padding: 20px;
    margin: 20px 0;
}

.diff-row {
    margin-bottom: 15px;
}

.diff-row:last-child {
    margin-bottom: 0;
}

.diff-label {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.diff-content {
    font-size: 1.1rem;
    line-height: 1.8;
    padding: 12px;
    background-color: var(--card-bg);
    border-radius: 8px;
}

.diff-word {
    padding: 4px 8px;
    border-radius: 4px;
    margin: 2px;
    display: inline-block;
    transition: all 0.2s;
}

.diff-word.correct {
    background-color: rgba(76, 201, 240, 0.2);
    color: #4cc9f0;
    border: 1px solid #4cc9f0;
}

.diff-word.capitalization-error {
    background-color: rgba(254, 202, 87, 0.2);
    color: #feca57;
    border: 1px solid #feca57;
}

.diff-word.error {
    background-color: rgba(247, 37, 133, 0.2);
    color: #f72585;
    border: 1px solid #f72585;
}

.diff-correct {
    color: var(--text-color);
    font-weight: 500;
}

.score-display {
    text-align: center;
    font-size: 1.3rem;
    margin: 20px 0;
    padding: 15px;
    background-color: var(--light-bg);
    border-radius: var(--border-radius);
}

.score-display strong {
    color: var(--primary-color);
}

.error-breakdown {
    background-color: var(--light-bg);
    border-radius: var(--border-radius);
    padding: 20px;
    margin: 20px 0;
}

.error-breakdown h4 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: var(--text-color);
}

.error-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.error-category {
    margin-bottom: 15px;
    padding: 12px;
    background-color: var(--card-bg);
    border-radius: 8px;
    border-left: 4px solid;
}

.error-category.capitalization {
    border-left-color: #feca57;
}

.error-category.punctuation {
    border-left-color: #feca57;
}

.error-category.spelling {
    border-left-color: #f72585;
}

.error-category.word-order {
    border-left-color: #ff9500;
}

.error-category.grammar {
    border-left-color: #4cc9f0;
}

.error-icon {
    margin-right: 8px;
    font-size: 1.1rem;
}

.error-category strong {
    font-size: 1rem;
    color: var(--text-color);
}

.error-details {
    list-style: none;
    padding: 0;
    margin: 10px 0 0 0;
}

.error-details li {
    padding: 8px 12px;
    margin: 5px 0;
    background-color: var(--light-bg);
    border-radius: 6px;
    font-size: 0.95rem;
    color: #666;
}

.explanation-box {
    background-color: rgba(67, 97, 238, 0.05);
    border-left: 4px solid var(--primary-color);
    border-radius: var(--border-radius);
    padding: 20px;
    margin: 20px 0;
}

.explanation-box h4 {
    font-size: 1.1rem;
    margin-bottom: 12px;
    color: var(--primary-color);
}

.explanation-box p {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-color);
    margin: 0;
}

/* Responsive Enhanced Feedback */
@media (max-width: 768px) {
    .visual-diff {
        padding: 15px;
    }
    
    .diff-content {
        font-size: 1rem;
        padding: 10px;
    }
    
    .error-breakdown {
        padding: 15px;
    }
    
    .error-category {
        padding: 10px;
    }
    
    .explanation-box {
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .diff-word {
        font-size: 0.95rem;
        padding: 3px 6px;
    }
    
    .score-display {
        font-size: 1.1rem;
        padding: 12px;
    }
    
    .error-breakdown h4 {
        font-size: 1.1rem;
    }
    
    .error-details li {
        font-size: 0.9rem;
        padding: 6px 10px;
    }
}
