/* ============================================
   Buteyko Akademie – CSS
   Design-System von buteyko.fitness
   ============================================ */

/* Language Switcher */
[data-lang="en"] { display: none; }
html[lang="en"] [data-lang="de"] { display: none; }
html[lang="en"] [data-lang="en"] { display: block; }
html[lang="en"] span[data-lang="en"],
html[lang="en"] a[data-lang="en"],
html[lang="en"] p[data-lang="en"],
html[lang="en"] li[data-lang="en"],
html[lang="en"] h1[data-lang="en"],
html[lang="en"] h2[data-lang="en"],
html[lang="en"] h3[data-lang="en"],
html[lang="en"] div[data-lang="en"],
html[lang="en"] button[data-lang="en"],
html[lang="en"] label[data-lang="en"],
html[lang="en"] footer[data-lang="en"] { display: block; }
html[lang="en"] span[data-lang="en"] { display: inline; }

.lang-switch {
    display: flex;
    gap: 0.25rem;
    margin-left: 1rem;
}

.lang-switch button {
    background: transparent;
    border: 1px solid var(--gray-200);
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-500);
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.lang-switch button:hover {
    border-color: var(--orange);
    color: var(--orange);
}

.lang-switch button.active {
    background: var(--orange);
    border-color: var(--orange);
    color: white;
}

/* CSS Variables – identisch mit Hauptseite */
:root {
    --orange: #E67817;
    --orange-light: #F5A623;
    --orange-dark: #C65D0D;
    --cream: #FDFBF7;
    --white: #FFFFFF;
    --gray-50: #F9FAFB;
    --gray-100: #F3F4F6;
    --gray-200: #E5E7EB;
    --gray-400: #9CA3AF;
    --gray-600: #4B5563;
    --gray-800: #1F2937;
    --gray-900: #111827;
    
    --font-display: 'Cormorant Garamond', Georgia, serif;
    --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    
    /* Akademie-spezifisch */
    --success: #10B981;
    --success-light: #D1FAE5;
    --warning: #F59E0B;
    --warning-light: #FEF3C7;
    --error: #EF4444;
    --error-light: #FEE2E2;
    
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);
    
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-full: 9999px;
    
    --transition: all 0.3s ease;
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    color: var(--gray-800);
    background-color: var(--cream);
    min-height: 100vh;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 600;
    line-height: 1.2;
    color: var(--gray-900);
}

h1 { font-size: clamp(2rem, 5vw, 3rem); }
h2 { font-size: clamp(1.5rem, 4vw, 2.25rem); }
h3 { font-size: clamp(1.25rem, 3vw, 1.75rem); }
h4 { font-size: 1.25rem; }

p {
    margin-bottom: 1rem;
}

a {
    color: var(--orange);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--orange-dark);
}

/* Container */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.container-narrow {
    max-width: 800px;
}

/* ============================================
   Header / Navigation
   ============================================ */
.header {
    background: var(--white);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
    gap: 1rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--gray-900);
}

.logo-icon {
    width: 40px;
    height: 40px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 2rem;
    list-style: none;
}

.nav-links a {
    color: var(--gray-600);
    font-weight: 500;
    font-size: 0.95rem;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--orange);
}

/* ============================================
   Hero Section (Akademie-Übersicht)
   ============================================ */
.hero {
    background: linear-gradient(135deg, var(--cream) 0%, var(--white) 100%);
    padding: 4rem 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(230, 120, 23, 0.1) 0%, transparent 70%);
    border-radius: 50%;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--orange-light);
    color: var(--orange-dark);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.hero h1 {
    margin-bottom: 1rem;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--gray-600);
    max-width: 600px;
    margin: 0 auto 2rem;
}

/* Progress Overview */
.progress-overview {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.progress-bar-container {
    flex: 1;
    max-width: 400px;
    background: var(--gray-200);
    height: 12px;
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--orange) 0%, var(--orange-light) 100%);
    border-radius: var(--radius-full);
    transition: width 0.5s ease;
}

.progress-text {
    font-weight: 600;
    color: var(--gray-800);
    white-space: nowrap;
}

/* ============================================
   Module Cards (Übersicht)
   ============================================ */
.modules-section {
    padding: 4rem 0;
}

.modules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.module-card {
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    border: 2px solid transparent;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.module-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.module-card.locked {
    opacity: 0.7;
    pointer-events: none;
}

.module-card.locked::after {
    content: '🔒';
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.5rem;
}

.module-card.completed {
    border-color: var(--success);
}

.module-card.completed::after {
    content: '✓';
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 28px;
    height: 28px;
    background: var(--success);
    color: white;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.module-card.current {
    border-color: var(--orange);
}

.module-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--orange-light);
    color: var(--orange-dark);
    border-radius: var(--radius-full);
    font-weight: 700;
    font-size: 1.125rem;
    margin-bottom: 1rem;
}

.module-card.completed .module-number {
    background: var(--success-light);
    color: var(--success);
}

.module-card h3 {
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
}

.module-card p {
    color: var(--gray-600);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.module-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.8rem;
    color: var(--gray-400);
}

.module-meta span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* ============================================
   Module Content Page
   ============================================ */
.module-page {
    padding: 2rem 0 4rem;
}

.module-header {
    text-align: center;
    padding: 3rem 0;
    background: linear-gradient(135deg, var(--cream) 0%, var(--white) 100%);
    margin-bottom: 2rem;
}

.module-header .module-number {
    width: 60px;
    height: 60px;
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: var(--gray-500);
}

.breadcrumb a {
    color: var(--gray-500);
}

.breadcrumb a:hover {
    color: var(--orange);
}

/* Content Styling */
.content-section {
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-md);
}

.content-section h2 {
    color: var(--orange-dark);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--orange-light);
}

.content-section h3 {
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

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

.content-section li {
    margin-bottom: 0.5rem;
}

/* Info Boxes */
.info-box {
    padding: 1.25rem;
    border-radius: var(--radius-lg);
    margin: 1.5rem 0;
}

.info-box.tip {
    background: var(--success-light);
    border-left: 4px solid var(--success);
}

.info-box.warning {
    background: var(--warning-light);
    border-left: 4px solid var(--warning);
}

.info-box.important {
    background: var(--error-light);
    border-left: 4px solid var(--error);
}

.info-box-title {
    font-weight: 700;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Exercise Box */
.exercise-box {
    background: linear-gradient(135deg, var(--orange-light) 0%, rgba(245, 166, 35, 0.3) 100%);
    border-radius: var(--radius-xl);
    padding: 2rem;
    margin: 2rem 0;
}

.exercise-box h3 {
    color: var(--orange-dark);
    margin-bottom: 1rem;
}

.exercise-steps {
    counter-reset: step;
}

.exercise-step {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    align-items: flex-start;
}

.exercise-step::before {
    counter-increment: step;
    content: counter(step);
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    background: var(--orange);
    color: white;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

/* ============================================
   Timer Component
   ============================================ */
.timer-container {
    background: var(--gray-900);
    color: white;
    border-radius: var(--radius-xl);
    padding: 2rem;
    text-align: center;
    margin: 2rem 0;
}

.timer-display {
    font-family: 'SF Mono', 'Consolas', monospace;
    font-size: 4rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    margin: 1rem 0;
    background: linear-gradient(135deg, var(--orange) 0%, var(--orange-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.timer-controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.5rem;
}

.timer-btn {
    padding: 0.75rem 2rem;
    border-radius: var(--radius-full);
    border: none;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
}

.timer-btn.primary {
    background: var(--orange);
    color: white;
}

.timer-btn.primary:hover {
    background: var(--orange-dark);
}

.timer-btn.secondary {
    background: var(--gray-700);
    color: white;
}

.timer-btn.secondary:hover {
    background: var(--gray-600);
}

.timer-instruction {
    color: var(--gray-400);
    font-size: 0.9rem;
    margin-top: 1rem;
}

/* ============================================
   Quiz Section
   ============================================ */
.quiz-section {
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    margin-top: 3rem;
    border: 2px solid var(--orange-light);
}

.quiz-header {
    text-align: center;
    margin-bottom: 2rem;
}

.quiz-header h2 {
    color: var(--orange-dark);
    border: none;
}

.quiz-progress {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 1rem;
}

.quiz-progress-dot {
    width: 12px;
    height: 12px;
    border-radius: var(--radius-full);
    background: var(--gray-200);
    transition: var(--transition);
}

.quiz-progress-dot.active {
    background: var(--orange);
    transform: scale(1.2);
}

.quiz-progress-dot.completed {
    background: var(--success);
}

.quiz-progress-dot.wrong {
    background: var(--error);
}

/* Question */
.quiz-question {
    margin-bottom: 2rem;
}

.question-number {
    font-size: 0.9rem;
    color: var(--gray-500);
    margin-bottom: 0.5rem;
}

.question-text {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 1.5rem;
}

/* Answer Options */
.answer-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.answer-option {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: var(--gray-50);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: var(--transition);
}

.answer-option:hover {
    border-color: var(--orange-light);
    background: var(--white);
}

.answer-option.selected {
    border-color: var(--orange);
    background: rgba(230, 120, 23, 0.1);
}

.answer-option.correct {
    border-color: var(--success);
    background: var(--success-light);
}

.answer-option.wrong {
    border-color: var(--error);
    background: var(--error-light);
}

.answer-radio {
    width: 24px;
    height: 24px;
    border: 2px solid var(--gray-400);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: var(--transition);
}

.answer-option.selected .answer-radio {
    border-color: var(--orange);
    background: var(--orange);
}

.answer-option.selected .answer-radio::after {
    content: '';
    width: 8px;
    height: 8px;
    background: white;
    border-radius: var(--radius-full);
}

.answer-option.correct .answer-radio {
    border-color: var(--success);
    background: var(--success);
}

.answer-option.correct .answer-radio::after {
    content: '✓';
    color: white;
    font-size: 14px;
}

.answer-option.wrong .answer-radio {
    border-color: var(--error);
    background: var(--error);
}

.answer-option.wrong .answer-radio::after {
    content: '✕';
    color: white;
    font-size: 14px;
}

.answer-text {
    flex: 1;
}

/* Quiz Feedback */
.quiz-feedback {
    padding: 1.25rem;
    border-radius: var(--radius-lg);
    margin-top: 1.5rem;
    display: none;
}

.quiz-feedback.show {
    display: block;
    animation: fadeIn 0.3s ease;
}

.quiz-feedback.correct {
    background: var(--success-light);
    border: 1px solid var(--success);
}

.quiz-feedback.wrong {
    background: var(--error-light);
    border: 1px solid var(--error);
}

/* Quiz Actions */
.quiz-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--gray-200);
}

/* Quiz Result */
.quiz-result {
    text-align: center;
    padding: 2rem;
}

.quiz-result-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.quiz-result h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.quiz-score {
    font-size: 2rem;
    font-weight: 700;
    color: var(--orange);
    margin: 1rem 0;
}

/* ============================================
   Buttons
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    border-radius: var(--radius-lg);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    text-decoration: none;
}

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

.btn-primary:hover {
    background: var(--orange-dark);
    color: white;
}

.btn-secondary {
    background: var(--gray-200);
    color: var(--gray-700);
}

.btn-secondary:hover {
    background: var(--gray-300);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover {
    background: #059669;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

.btn-block {
    width: 100%;
}

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

/* ============================================
   Navigation Between Modules
   ============================================ */
.module-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid var(--gray-200);
}

.nav-prev,
.nav-next {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    background: var(--white);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-lg);
    text-decoration: none;
    transition: var(--transition);
}

.nav-prev:hover,
.nav-next:hover {
    border-color: var(--orange);
    transform: translateX(4px);
}

.nav-prev:hover {
    transform: translateX(-4px);
}

.nav-label {
    font-size: 0.8rem;
    color: var(--gray-500);
}

.nav-title {
    font-weight: 600;
    color: var(--gray-900);
}

/* ============================================
   Certificate Page
   ============================================ */
.certificate-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.certificate-form {
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: 3rem;
    max-width: 500px;
    width: 100%;
    box-shadow: var(--shadow-xl);
    text-align: center;
}

.certificate-form h1 {
    margin-bottom: 0.5rem;
}

.certificate-form p {
    color: var(--gray-600);
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
    text-align: left;
}

.form-label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--gray-700);
}

.form-input {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-lg);
    font-size: 1rem;
    transition: var(--transition);
}

.form-input:focus {
    outline: none;
    border-color: var(--orange);
}

/* Certificate Preview */
.certificate-preview {
    background: var(--cream);
    border: 3px solid var(--orange);
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin: 2rem 0;
    position: relative;
}

.certificate-preview::before {
    content: '🏆';
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 2.5rem;
    background: var(--cream);
    padding: 0 1rem;
}

/* ============================================
   Footer
   ============================================ */
.footer {
    background: var(--gray-900);
    color: var(--gray-400);
    padding: 2rem 0;
    margin-top: 4rem;
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer a {
    color: var(--gray-400);
}

.footer a:hover {
    color: var(--orange-light);
}

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

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

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

.fade-in {
    animation: fadeIn 0.5s ease forwards;
}

.pulse {
    animation: pulse 2s ease-in-out infinite;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 768px) {
    .header-inner {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-links {
        gap: 1rem;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .hero {
        padding: 2rem 0;
    }
    
    .modules-grid {
        grid-template-columns: 1fr;
    }
    
    .content-section {
        padding: 1.5rem;
    }
    
    .timer-display {
        font-size: 3rem;
    }
    
    .module-navigation {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-prev,
    .nav-next {
        width: 100%;
        justify-content: center;
    }
    
    .quiz-actions {
        flex-direction: column;
        gap: 1rem;
    }
    
    .quiz-actions .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 1rem;
    }
    
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
    
    .timer-display {
        font-size: 2.5rem;
    }
    
    .timer-controls {
        flex-direction: column;
    }
    
    .timer-btn {
        width: 100%;
    }
}

/* ============================================
   Print Styles (für Zertifikat)
   ============================================ */
@media print {
    .header,
    .footer,
    .no-print {
        display: none !important;
    }
    
    body {
        background: white;
    }
    
    .certificate-preview {
        border: 5px double var(--orange);
        padding: 3rem;
    }
}
