/* ============================================
   Zitiertechnik – style.css
   ============================================ */

:root {
    --primary: #2c3e50;
    --accent: #e67e22;
    --accent-light: #fdebd0;
    --success: #27ae60;
    --success-light: #d5f5e3;
    --danger: #e74c3c;
    --danger-light: #fadbd8;
    --bg: #f4f6f8;
    --card-bg: #ffffff;
    --header-text: #82c91e;
    --chat-bot: #eef2f7;
    --chat-bot-border: #dde3ea;
    --highlight-bg: #fff8e1;
    --highlight-border: #ffc107;
    --font: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

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

body {
    font-family: var(--font);
    background-color: var(--bg);
    color: var(--primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* === HEADER === */
header {
    padding: 24px 20px 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

h1 {
    margin: 0;
    font-size: 2rem;
    font-weight: 800;
    text-align: center;
    color: var(--header-text);
}

.nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: #bdc3c7;
    font-weight: 600;
    font-size: 1rem;
    transition: color 0.3s;
}

.nav-btn:hover {
    color: var(--header-text);
}

.back-link { left: 20px; }
.home-link { right: 20px; font-size: 1.4rem; }

/* === SCREENS === */
.screen {
    display: none;
}

.screen.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

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

/* === START SCREEN === */
.start-card {
    text-align: center;
    padding: 30px 20px;
}

.start-icon {
    font-size: 3.5rem;
    color: var(--accent);
    margin-bottom: 16px;
}

.start-card h2 {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 8px;
}

.start-subtitle {
    color: #7f8c8d;
    font-size: 1.05rem;
    margin-bottom: 30px;
}

.start-options {
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-width: 500px;
    margin: 0 auto;
}

.option-card {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--card-bg);
    border: 2px solid #e8ecf0;
    border-radius: 14px;
    padding: 18px 20px;
    cursor: pointer;
    transition: all 0.25s;
    text-align: left;
    font-family: var(--font);
    width: 100%;
}

.option-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}

.option-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}

.option-icon.uebung {
    background: linear-gradient(135deg, #e67e22, #d35400);
}

.option-text {
    flex: 1;
}

.option-text strong {
    display: block;
    font-size: 1.05rem;
    margin-bottom: 3px;
}

.option-text span {
    font-size: 0.85rem;
    color: #95a5a6;
}

.option-arrow {
    color: #bdc3c7;
    font-size: 1.2rem;
}

/* === THEORIE / CHAT SCREEN === */
.chat-container {
    max-width: 680px;
    padding-bottom: 100px;
}

.chat-messages {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-bubble {
    max-width: 92%;
    padding: 14px 18px;
    border-radius: 18px;
    line-height: 1.65;
    font-size: 0.95rem;
    animation: bubbleIn 0.35s ease;
    word-break: break-word;
}

@keyframes bubbleIn {
    from { opacity: 0; transform: translateY(16px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.chat-bubble.bot {
    background: var(--chat-bot);
    border: 1px solid var(--chat-bot-border);
    border-bottom-left-radius: 6px;
    align-self: flex-start;
}

.chat-bubble.heading {
    background: var(--primary);
    color: white;
    font-weight: 700;
    font-size: 1.1rem;
    padding: 12px 20px;
    border-radius: 12px;
    align-self: stretch;
    text-align: center;
    margin-top: 10px;
}

.chat-bubble.highlight {
    background: var(--highlight-bg);
    border: 1px solid var(--highlight-border);
    border-left: 4px solid var(--highlight-border);
    border-bottom-left-radius: 6px;
    align-self: flex-start;
}

.chat-bubble.example {
    background: #eaf6ff;
    border: 1px solid #a8d8f0;
    border-left: 4px solid #3498db;
    border-bottom-left-radius: 6px;
    align-self: flex-start;
}

.chat-bubble .example-label {
    font-weight: 700;
    color: #2980b9;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

/* Referenztext-Box in Chat */
.chat-reference {
    background: white;
    border: 2px solid #ddd;
    border-radius: 12px;
    padding: 16px 18px;
    align-self: stretch;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.88rem;
    line-height: 1.8;
    animation: bubbleIn 0.35s ease;
}

.chat-reference .ref-title {
    font-family: var(--font);
    font-weight: 700;
    font-size: 0.85rem;
    color: #7f8c8d;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.chat-reference .ref-line {
    display: block;
}

.chat-reference .ref-line-nr {
    font-weight: 700;
    color: var(--accent);
    min-width: 28px;
    display: inline-block;
}

/* Quiz in Chat */
.chat-quiz {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 14px;
    padding: 18px;
    align-self: stretch;
    animation: bubbleIn 0.35s ease;
}

.chat-quiz .quiz-question {
    font-weight: 600;
    margin-bottom: 14px;
    font-size: 0.95rem;
    padding: 10px 14px;
    background: var(--bg);
    border-radius: 10px;
}

.quiz-option {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px;
    border: 2px solid #e8ecf0;
    border-radius: 10px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.92rem;
    line-height: 1.5;
}

.quiz-option:hover {
    border-color: #3498db;
    background: #f0f7ff;
}

.quiz-option.selected-correct {
    border-color: var(--success);
    background: var(--success-light);
    cursor: default;
}

.quiz-option.selected-wrong {
    border-color: var(--danger);
    background: var(--danger-light);
    cursor: default;
}

.quiz-option.disabled {
    pointer-events: none;
    opacity: 0.6;
}

.quiz-option .option-letter {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
    margin-top: 1px;
}

.quiz-option.selected-correct .option-letter {
    background: var(--success);
    color: white;
}

.quiz-option.selected-wrong .option-letter {
    background: var(--danger);
    color: white;
}

.quiz-explanation {
    background: #fef9e7;
    border: 1px solid #f0e68c;
    border-radius: 10px;
    padding: 12px 14px;
    margin-top: 12px;
    font-size: 0.88rem;
    line-height: 1.6;
    display: none;
}

.quiz-explanation.visible {
    display: block;
    animation: bubbleIn 0.3s ease;
}

.chat-actions {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 16px 20px;
    background: linear-gradient(transparent, var(--bg) 30%);
    display: flex;
    justify-content: center;
    z-index: 10;
}

/* === ÜBUNG SCREEN === */
.ref-text-box {
    background: white;
    border: 2px solid #ddd;
    border-radius: 12px;
    padding: 16px 18px;
    margin-bottom: 16px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.85rem;
    line-height: 1.8;
    max-height: 200px;
    overflow-y: auto;
}

.ref-text-box .ref-title {
    font-family: var(--font);
    font-weight: 700;
    font-size: 0.8rem;
    color: #7f8c8d;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ref-text-box .ref-line-nr {
    font-weight: 700;
    color: var(--accent);
    min-width: 28px;
    display: inline-block;
}

.progress-info {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    font-size: 0.85rem;
    color: #7f8c8d;
    font-weight: 500;
}

.progress-bar-container {
    flex: 1;
    height: 8px;
    background: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), #f1c40f);
    border-radius: 10px;
    transition: width 0.4s ease;
}

.satz-card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.06);
    border: 1px solid #e8ecf0;
}

.satz-label {
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #95a5a6;
    font-weight: 600;
    margin-bottom: 12px;
}

.satz-text {
    font-size: 1.05rem;
    line-height: 1.7;
    padding: 16px;
    background: var(--bg);
    border-radius: 10px;
    margin-bottom: 20px;
    border-left: 4px solid var(--accent);
}

.satz-buttons {
    display: flex;
    gap: 12px;
}

.satz-feedback {
    margin-top: 16px;
    padding: 14px 16px;
    border-radius: 10px;
    font-size: 0.92rem;
    line-height: 1.6;
    animation: bubbleIn 0.3s ease;
}

.satz-feedback.correct {
    background: var(--success-light);
    border: 1px solid var(--success);
    color: #1e7e34;
}

.satz-feedback.wrong {
    background: var(--danger-light);
    border: 1px solid var(--danger);
    color: #922b21;
}

.satz-feedback .feedback-icon {
    font-size: 1.2rem;
    margin-right: 8px;
}

/* Runde Ergebnis */
.runde-ergebnis {
    text-align: center;
    padding: 40px 20px;
    animation: fadeIn 0.4s ease;
}

.runde-ergebnis .ergebnis-icon {
    font-size: 4rem;
    color: var(--accent);
    margin-bottom: 16px;
}

.runde-ergebnis h2 {
    font-size: 1.6rem;
    margin-bottom: 8px;
}

.runde-ergebnis p {
    color: #7f8c8d;
    font-size: 1.05rem;
    margin-bottom: 24px;
}

.ergebnis-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

/* === BUTTONS === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 28px;
    border: none;
    border-radius: 12px;
    font-family: var(--font);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.25s;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.12);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: linear-gradient(135deg, #e67e22, #d35400);
    color: white;
}

.btn-secondary {
    background: #ecf0f1;
    color: var(--primary);
}

.btn-richtig {
    background: linear-gradient(135deg, #27ae60, #229954);
    color: white;
    flex: 1;
    padding: 14px;
    font-size: 1rem;
}

.btn-falsch {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    flex: 1;
    padding: 14px;
    font-size: 1rem;
}

.btn-full {
    width: 100%;
    margin-top: 14px;
}

.hidden {
    display: none !important;
}

/* === RESPONSIVE === */
@media (max-width: 600px) {
    h1 { font-size: 1.4rem; }
    
    .nav-btn span { display: none; }
    .back-link { left: 15px; }
    .home-link { right: 15px; }

    .chat-bubble { max-width: 96%; font-size: 0.9rem; }
    .satz-text { font-size: 0.95rem; }
    .start-card h2 { font-size: 1.4rem; }
    
    .satz-buttons {
        flex-direction: column;
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background-color: rgba(156, 163, 175, 0.5);
    border-radius: 10px;
}
