/* ========================================
   LERNAPP - GLOBAL STYLES (Orbitron Cyber Dark Theme)
   ALL Generated HTML Files Use This CSS
   ======================================== */

:root {
    --bg-dark: #111827;
    --bg-darker: #0f172a;
    --primary: #4ade80;
    --success: #4ade80;
    --warning: #f97316;
    --error: #ef4444;
    --text: #ffffff;
    --text-light: #4ade80;
    --border: 1px solid var(--primary);
    --shadow-sm: 0 0 10px rgba(74, 222, 128, 0.2);
    --shadow: 0 0 15px rgba(74, 222, 128, 0.3);
    --shadow-lg: 0 0 20px rgba(74, 222, 128, 0.5);
}

/* ========================================
   RESET & BASE
   ======================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    transition: all 0.3s ease;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Orbitron', 'Courier New', monospace;
    background-color: var(--bg-dark);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-weight: 700;
}

/* ========================================
   SCROLLBAR
   ======================================== */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--success);
}

/* ========================================
   TYPOGRAPHY
   ======================================== */

h1, h2, h3, h4, h5, h6 {
    color: var(--text-light);
    font-weight: 700;
    margin-bottom: 1rem;
}

h1 {
    font-size: 2rem;
    text-shadow: 0 0 10px rgba(34, 211, 238, 0.3);
}

h2 {
    font-size: 1.5rem;
    border-bottom: 1px solid var(--primary);
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
}

h3 {
    font-size: 1.2rem;
    color: var(--primary);
}

p {
    margin-bottom: 1rem;
    color: #ffffff;
    font-weight: 700;
}

small {
    color: #ffffff;
    font-size: 0.875rem;
    font-weight: 600;
}

/* ========================================
   SEMANTIC LAYOUT
   ======================================== */

header {
    background-color: var(--bg-darker);
    border-bottom: var(--border);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

header h1 {
    text-align: center;
    margin: 0;
}

main {
    flex: 1;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 1rem;
}

section {
    margin-bottom: 2rem;
}

article {
    background-color: var(--bg-darker);
    border: var(--border);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
}

article:hover {
    box-shadow: var(--shadow-lg);
    border-color: var(--success);
}

footer {
    background-color: var(--bg-darker);
    border-top: var(--border);
    padding: 1.5rem;
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 2rem;
}

/* ========================================
   CONTAINERS & GRIDS
   ======================================== */

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

.grid {
    display: grid;
    gap: 1.5rem;
}

.grid-2 {
    grid-template-columns: 1fr;
}

@media (min-width: 768px) {
    .grid-2 {
        grid-template-columns: repeat(2, 1fr);
    }
}

.grid-3 {
    grid-template-columns: 1fr;
}

@media (min-width: 768px) {
    .grid-3 {
        grid-template-columns: repeat(3, 1fr);
    }
}

.grid-4 {
    grid-template-columns: 1fr;
}

@media (min-width: 1024px) {
    .grid-4 {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ========================================
   BUTTONS
   ======================================== */

button, input[type="button"], input[type="submit"] {
    background: linear-gradient(to right, var(--primary), var(--success));
    color: var(--bg-darker);
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-family: 'Orbitron', sans-serif;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

button:hover, input[type="button"]:hover, input[type="submit"]:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

button:active {
    transform: translateY(-1px);
}

button.secondary {
    background: var(--bg-darker);
    color: var(--primary);
    border: var(--border);
}

button.secondary:hover {
    background: var(--primary);
    color: var(--bg-darker);
}

button.success {
    background: linear-gradient(to right, var(--success), #22c55e);
}

button.error {
    background: linear-gradient(to right, var(--error), #dc2626);
}

/* ========================================
   FORM INPUTS
   ======================================== */

input[type="text"],
input[type="email"],
input[type="number"],
input[type="password"],
input[type="search"],
input[type="date"],
input[type="time"],
textarea,
select {
    width: 100%;
    background-color: var(--bg-darker);
    border: var(--border);
    color: var(--text-light);
    padding: 0.75rem;
    border-radius: 4px;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    box-shadow: 0 0 15px rgba(74, 222, 128, 0.3);
    border-color: var(--success);
}

textarea {
    resize: vertical;
    min-height: 120px;
}

label {
    display: block;
    color: #ffffff;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

/* ========================================
   RADIO & CHECKBOX (Custom)
   ======================================== */

input[type="radio"],
input[type="checkbox"] {
    accent-color: var(--primary);
    cursor: pointer;
}

/* Wrapper for radio/checkbox labels */
.form-group {
    margin-bottom: 1rem;
}

.radio-group,
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.radio-item,
.checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.radio-item:hover,
.checkbox-item:hover {
    background-color: rgba(34, 211, 238, 0.1);
}

.radio-item input,
.checkbox-item input {
    cursor: pointer;
}

/* ========================================
   PROGRESS BARS
   ======================================== */

.progress-container {
    width: 100%;
    height: 8px;
    background-color: var(--bg-darker);
    border-radius: 4px;
    overflow: hidden;
    border: var(--border);
    margin-bottom: 1rem;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(to right, var(--primary), var(--success));
    width: 0%;
    transition: width 0.3s ease;
}

/* ========================================
   TIMER & COUNTERS
   ======================================== */

.timer-display {
    font-size: 1.5rem;
    color: var(--primary);
    font-weight: bold;
    text-align: center;
    padding: 1rem;
    background-color: var(--bg-darker);
    border-radius: 4px;
    border: var(--border);
    margin-bottom: 1rem;
}

.timer-display.warning {
    color: var(--warning);
}

.timer-display.danger {
    color: var(--error);
    animation: pulse 1s infinite;
}

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

/* ========================================
   TABLES
   ======================================== */

table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

thead {
    background-color: var(--bg-darker);
    border-bottom: 2px solid var(--primary);
}

th {
    color: var(--primary);
    padding: 1rem;
    text-align: left;
    font-weight: 700;
}

td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(34, 211, 238, 0.2);
}

tr:hover {
    background-color: rgba(34, 211, 238, 0.05);
}

/* ========================================
   LISTS
   ======================================== */

ul, ol {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

li {
    margin-bottom: 0.5rem;
    color: #ffffff;
    font-weight: 700;
}

ul li::marker {
    color: var(--primary);
}

ol li::marker {
    color: var(--success);
}

/* ========================================
   CARDS (Generic)
   ======================================== */

.card {
    background-color: var(--bg-darker);
    border: var(--border);
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--success);
}

.card-header {
    color: var(--primary);
    font-weight: 700;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--primary);
    padding-bottom: 0.5rem;
}

.card-body {
    margin-bottom: 1rem;
}

.card-footer {
    border-top: 1px solid rgba(34, 211, 238, 0.2);
    padding-top: 1rem;
    display: flex;
    gap: 0.5rem;
}

/* ========================================
   FLASHCARD / VOCABULARY
   ======================================== */

.vocabulary-card {
    perspective: 1000px;
    cursor: pointer;
    min-height: 200px;
}

.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.vocabulary-card.flipped .card-inner {
    transform: rotateY(180deg);
}

.card-front,
.card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    border-radius: 8px;
    border: var(--border);
}

.card-front {
    background-color: var(--bg-darker);
    color: var(--primary);
}

.card-back {
    background-color: rgba(74, 222, 128, 0.1);
    color: var(--success);
    transform: rotateY(180deg);
}

/* ========================================
   FEEDBACK MESSAGES
   ======================================== */

.feedback {
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    border-left: 4px solid;
}

.feedback.success {
    background-color: rgba(74, 222, 128, 0.1);
    border-color: var(--success);
    color: var(--success);
}

.feedback.error {
    background-color: rgba(239, 68, 68, 0.1);
    border-color: var(--error);
    color: var(--error);
}

.feedback.warning {
    background-color: rgba(249, 115, 22, 0.1);
    border-color: var(--warning);
    color: var(--warning);
}

.feedback.info {
    background-color: rgba(34, 211, 238, 0.1);
    border-color: var(--primary);
    color: var(--primary);
}

/* ========================================
   MODALS & OVERLAYS
   ======================================== */

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background-color: var(--bg-darker);
    border: var(--border);
    border-radius: 8px;
    padding: 2rem;
    max-width: 600px;
    width: 90%;
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    border-bottom: var(--border);
    padding-bottom: 1rem;
    margin-bottom: 1rem;
}

.modal-close {
    float: right;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--primary);
}

.modal-close:hover {
    color: var(--success);
}

/* ========================================
   NAVIGATION
   ======================================== */

nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.nav-button {
    padding: 0.5rem 1rem;
    background-color: var(--bg-darker);
    border: var(--border);
    color: var(--text);
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.nav-button:hover,
.nav-button.active {
    background-color: var(--primary);
    color: var(--bg-darker);
}

/* ========================================
   UTILITY CLASSES
   ======================================== */

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

.text-right {
    text-align: right;
}

.text-left {
    text-align: left;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }

.hidden {
    display: none;
}

.visible {
    display: block;
}

.flex {
    display: flex;
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.flex-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.flex-column {
    flex-direction: column;
}

.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }

/* ========================================
   QUICK WIN UPGRADES
   ======================================== */

/* Back to Index Navigation */
.back-nav {
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 100;
}

.back-nav a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--bg-darker);
    border: var(--border);
    border-radius: 4px;
    color: var(--primary);
    text-decoration: none;
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

.back-nav a:hover {
    background: var(--primary);
    color: var(--bg-darker);
    box-shadow: var(--shadow);
}

/* Score Summary Box */
.score-summary {
    background: linear-gradient(135deg, var(--bg-darker), rgba(74, 222, 128, 0.1));
    border: 2px solid var(--primary);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    margin: 2rem 0;
    box-shadow: var(--shadow-lg);
}

.score-summary h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
    border: none;
}

.score-number {
    font-size: 4rem;
    font-weight: 900;
    color: var(--primary);
    text-shadow: 0 0 20px rgba(74, 222, 128, 0.5);
}

.score-label {
    font-size: 1.2rem;
    color: var(--text);
    margin-top: 0.5rem;
}

.score-percentage {
    font-size: 1.5rem;
    color: var(--success);
    margin-top: 1rem;
}

/* Answer States */
.answer-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    margin: 0.5rem 0;
    border: 1px solid rgba(74, 222, 128, 0.3);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.answer-option:hover {
    background: rgba(74, 222, 128, 0.1);
    border-color: var(--primary);
}

.answer-option.selected {
    background: rgba(74, 222, 128, 0.15);
    border-color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.answer-option.correct {
    background: rgba(74, 222, 128, 0.2);
    border-color: var(--success);
    animation: correctPulse 0.5s ease;
}

.answer-option.incorrect {
    background: rgba(239, 68, 68, 0.15);
    border-color: var(--error);
    animation: shake 0.5s ease;
}

@keyframes correctPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Question Container */
.question-container {
    background: var(--bg-darker);
    border: var(--border);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
}

.question-container.answered {
    border-color: var(--success);
}

.question-container.answered-wrong {
    border-color: var(--error);
}

.question-number {
    display: inline-block;
    background: var(--primary);
    color: var(--bg-darker);
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-weight: 700;
    margin-bottom: 1rem;
}

.question-text {
    font-size: 1.1rem;
    color: var(--text-light);
    margin-bottom: 1rem;
    line-height: 1.6;
}

/* Inline Feedback */
.inline-feedback {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.85rem;
    margin-left: 0.5rem;
}

.inline-feedback.correct {
    background: rgba(74, 222, 128, 0.2);
    color: var(--success);
}

.inline-feedback.incorrect {
    background: rgba(239, 68, 68, 0.15);
    color: var(--error);
}

/* Loading Button State */
button.loading {
    position: relative;
    color: transparent;
}

button.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin: -10px 0 0 -10px;
    border: 3px solid var(--bg-darker);
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Keyboard Shortcut Hints */
.shortcut-hint {
    display: inline-block;
    background: var(--bg-dark);
    border: 1px solid var(--primary);
    border-radius: 4px;
    padding: 0.1rem 0.4rem;
    font-size: 0.75rem;
    color: var(--primary);
    margin-right: 0.5rem;
    font-family: monospace;
}

/* Print Styles */
@media print {
    body {
        background: white;
        color: black;
    }
    
    .back-nav,
    button,
    footer {
        display: none !important;
    }
    
    header {
        background: none;
        border-bottom: 2px solid black;
        box-shadow: none;
    }
    
    h1, h2, h3 {
        color: black;
    }
    
    .question-container {
        background: white;
        border: 1px solid #ccc;
        page-break-inside: avoid;
    }
    
    .answer-option {
        border: 1px solid #ccc;
    }
}

/* Subject Color Coding */
.subject-deutsch { border-left: 4px solid #ef4444; }
.subject-englisch { border-left: 4px solid #3b82f6; }
.subject-mathematik { border-left: 4px solid #8b5cf6; }
.subject-biologie { border-left: 4px solid #22c55e; }
.subject-chemie { border-left: 4px solid #f97316; }
.subject-physik { border-left: 4px solid #eab308; }
.subject-franzoesisch { border-left: 4px solid #ec4899; }
.subject-latein { border-left: 4px solid #6366f1; }

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
    h1 {
        font-size: 1.5rem;
    }

    h2 {
        font-size: 1.2rem;
    }

    h3 {
        font-size: 1rem;
    }

    main {
        padding: 0.5rem;
    }

    article {
        padding: 1rem;
        margin-bottom: 1rem;
    }

    footer {
        flex-direction: column;
    }

    footer button {
        width: 100%;
    }
    
    .back-nav {
        position: relative;
        top: 0;
        left: 0;
        margin-bottom: 1rem;
    }
    
    .score-number {
        font-size: 3rem;
    }
}
