/* =====================================================
   German Learning System - Custom Styles
   A warm, educational design with German-inspired colors
   ===================================================== */

:root {
    /* German Flag Inspired Colors */
    --primary-black: #1a1a2e;
    --primary-red: #e63946;
    --primary-gold: #f4a261;
    --primary-yellow: #ffd93d;
    
    /* Extended Palette */
    --bg-dark: #16213e;
    --bg-gradient-start: #0f3460;
    --bg-gradient-end: #1a1a2e;
    --text-light: #edf2f7;
    --text-muted: #a0aec0;
    --accent-blue: #4a90d9;
    --accent-green: #38a169;
    --accent-orange: #ed8936;
    --card-bg: rgba(255, 255, 255, 0.05);
    --card-border: rgba(255, 255, 255, 0.1);
    
    /* Spacing */
    --navbar-height: 70px;
    --section-padding: 80px;
}

/* =====================================================
   Base Styles
   ===================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', sans-serif;
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    color: var(--text-light);
    min-height: 100vh;
    line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Playfair Display', serif;
    font-weight: 600;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

/* =====================================================
   Navbar
   ===================================================== */
.navbar {
    background: rgba(22, 33, 62, 0.95);
    backdrop-filter: blur(10px);
    padding: 15px 0;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid var(--card-border);
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
}

.brand-icon {
    font-size: 1.8rem;
}

.brand-text {
    font-family: 'Playfair Display', serif;
}

.brand-highlight {
    color: var(--primary-gold);
}

.nav-link {
    color: var(--text-light) !important;
    font-weight: 500;
    padding: 10px 15px !important;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--primary-gold) !important;
}

.dropdown-menu {
    background: var(--bg-dark);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.dropdown-item {
    color: var(--text-light);
    border-radius: 8px;
    padding: 10px 15px;
}

.dropdown-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--primary-gold);
}

/* =====================================================
   Main Content
   ===================================================== */
.main-content {
    padding-top: var(--navbar-height);
    min-height: calc(100vh - 200px);
}

/* =====================================================
   Hero Section
   ===================================================== */
.hero-section {
    padding: 120px 0 80px;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 50%, rgba(230, 57, 70, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 50%, rgba(244, 162, 97, 0.15) 0%, transparent 50%);
    pointer-events: none;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, var(--text-light) 0%, var(--primary-gold) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.3rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
    max-width: 600px;
}

.hero-flag {
    display: flex;
    gap: 0;
    margin-bottom: 2rem;
}

.flag-stripe {
    height: 8px;
    width: 80px;
    border-radius: 4px;
}

.flag-stripe.black { background: #1a1a2e; }
.flag-stripe.red { background: #e63946; }
.flag-stripe.gold { background: #f4a261; }

/* =====================================================
   Level Cards
   ===================================================== */
.level-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    padding: 40px 0;
}

.level-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 30px;
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
}

.level-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
}

.level-card.a1::before { background: linear-gradient(90deg, #38a169, #68d391); }
.level-card.a2::before { background: linear-gradient(90deg, #4299e1, #63b3ed); }
.level-card.b1::before { background: linear-gradient(90deg, #ed8936, #f6ad55); }

.level-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.2);
}

.level-badge {
    display: inline-block;
    font-size: 1.5rem;
    font-weight: 700;
    padding: 10px 20px;
    border-radius: 12px;
    margin-bottom: 20px;
}

.level-badge.a1 { background: rgba(56, 161, 105, 0.2); color: #68d391; }
.level-badge.a2 { background: rgba(66, 153, 225, 0.2); color: #63b3ed; }
.level-badge.b1 { background: rgba(237, 137, 54, 0.2); color: #f6ad55; }

.level-card h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: var(--text-light);
}

.level-card p {
    color: var(--text-muted);
    margin-bottom: 20px;
}

.level-stats {
    display: flex;
    gap: 20px;
    margin-bottom: 25px;
}

.stat {
    text-align: center;
}

.stat-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-gold);
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* =====================================================
   Buttons
   ===================================================== */
.btn-primary-custom {
    background: linear-gradient(135deg, var(--primary-red) 0%, var(--primary-gold) 100%);
    border: none;
    color: white;
    padding: 12px 30px;
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-primary-custom:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(230, 57, 70, 0.4);
    color: white;
}

.btn-outline-custom {
    background: transparent;
    border: 2px solid var(--primary-gold);
    color: var(--primary-gold);
    padding: 10px 25px;
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-outline-custom:hover {
    background: var(--primary-gold);
    color: var(--primary-black);
}

.btn-audio {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--card-border);
    color: var(--primary-gold);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.btn-audio:hover {
    background: var(--primary-gold);
    color: var(--primary-black);
    transform: scale(1.1);
}

.btn-audio.playing {
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* =====================================================
   Section Styles
   ===================================================== */
.section {
    padding: var(--section-padding) 0;
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-red), var(--primary-gold));
    border-radius: 2px;
}

.section-subtitle {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 40px;
}

/* =====================================================
   Topic Cards
   ===================================================== */
.topic-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 25px;
    transition: all 0.3s ease;
    height: 100%;
}

.topic-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary-gold);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.topic-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-red), var(--primary-gold));
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    margin-bottom: 20px;
}

.topic-card h4 {
    font-size: 1.2rem;
    margin-bottom: 10px;
    color: var(--text-light);
}

.topic-card p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 15px;
}

.topic-meta {
    display: flex;
    gap: 15px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* =====================================================
   Vocabulary Table
   ===================================================== */
.vocab-table {
    background: var(--card-bg);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--card-border);
}

.vocab-table table {
    width: 100%;
    margin: 0;
}

.vocab-table thead {
    background: rgba(0, 0, 0, 0.2);
}

.vocab-table th {
    padding: 15px 20px;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 1px;
    color: var(--primary-gold);
    border: none;
}

.vocab-table td {
    padding: 15px 20px;
    border-bottom: 1px solid var(--card-border);
    vertical-align: middle;
}

.vocab-table tbody tr {
    transition: all 0.3s ease;
}

.vocab-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

.vocab-table tbody tr:last-child td {
    border-bottom: none;
}

.german-word {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-light);
}

.word-article {
    color: var(--primary-gold);
    font-size: 0.9rem;
}

.example-sentence {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-style: italic;
}

/* =====================================================
   Phrase Cards
   ===================================================== */
.phrase-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 25px;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.phrase-card:hover {
    border-color: var(--primary-gold);
}

.phrase-german {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-light);
    margin-bottom: 8px;
}

.phrase-english {
    color: var(--text-muted);
    margin-bottom: 15px;
}

.phrase-usage {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    padding: 15px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.phrase-usage strong {
    color: var(--primary-gold);
}

/* =====================================================
   Dialogue Box
   ===================================================== */
.dialogue-box {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 30px;
}

.dialogue-header {
    background: rgba(0, 0, 0, 0.2);
    padding: 20px 25px;
    border-bottom: 1px solid var(--card-border);
}

.dialogue-header h4 {
    margin: 0;
    color: var(--text-light);
}

.dialogue-situation {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 5px;
}

.dialogue-content {
    padding: 25px;
}

.dialogue-line {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.dialogue-line:hover {
    background: rgba(255, 255, 255, 0.03);
}

.dialogue-line:last-child {
    margin-bottom: 0;
}

.speaker-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-red), var(--primary-gold));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    color: white;
    flex-shrink: 0;
}

.speaker-avatar.b {
    background: linear-gradient(135deg, var(--accent-blue), #63b3ed);
}

.dialogue-text {
    flex: 1;
}

.speaker-name {
    font-weight: 600;
    color: var(--primary-gold);
    font-size: 0.85rem;
    margin-bottom: 5px;
}

.line-german {
    font-size: 1.1rem;
    color: var(--text-light);
    margin-bottom: 5px;
}

.line-english {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-style: italic;
}

/* =====================================================
   Grammar Box
   ===================================================== */
.grammar-box {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 30px;
}

.grammar-title {
    font-size: 1.3rem;
    color: var(--text-light);
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--card-border);
}

.grammar-rule {
    background: rgba(230, 57, 70, 0.1);
    border-left: 4px solid var(--primary-red);
    padding: 15px 20px;
    border-radius: 0 10px 10px 0;
    margin-bottom: 20px;
}

.grammar-example {
    background: rgba(244, 162, 97, 0.1);
    border-radius: 10px;
    padding: 15px 20px;
    margin-bottom: 15px;
}

.grammar-example .german {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-light);
}

.grammar-example .english {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.grammar-tip {
    background: rgba(56, 161, 105, 0.1);
    border-radius: 10px;
    padding: 15px 20px;
    display: flex;
    gap: 15px;
    align-items: flex-start;
}

.grammar-tip i {
    color: var(--accent-green);
    font-size: 1.2rem;
}

/* =====================================================
   Quiz Styles
   ===================================================== */
.quiz-container {
    max-width: 800px;
    margin: 0 auto;
}

.quiz-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 40px;
    margin-bottom: 30px;
}

.quiz-progress {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    height: 8px;
    margin-bottom: 30px;
    overflow: hidden;
}

.quiz-progress-bar {
    background: linear-gradient(90deg, var(--primary-red), var(--primary-gold));
    height: 100%;
    border-radius: 10px;
    transition: width 0.5s ease;
}

.quiz-question {
    font-size: 1.3rem;
    color: var(--text-light);
    margin-bottom: 30px;
    text-align: center;
}

.quiz-options {
    display: grid;
    gap: 15px;
}

.quiz-option {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid var(--card-border);
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 15px;
}

.quiz-option:hover {
    border-color: var(--primary-gold);
    background: rgba(255, 255, 255, 0.08);
}

.quiz-option.selected {
    border-color: var(--accent-blue);
    background: rgba(66, 153, 225, 0.1);
}

.quiz-option.correct {
    border-color: var(--accent-green);
    background: rgba(56, 161, 105, 0.2);
}

.quiz-option.incorrect {
    border-color: var(--primary-red);
    background: rgba(230, 57, 70, 0.2);
}

.option-letter {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
}

.quiz-input {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid var(--card-border);
    border-radius: 12px;
    padding: 15px 20px;
    color: var(--text-light);
    font-size: 1.1rem;
    width: 100%;
    transition: all 0.3s ease;
}

.quiz-input:focus {
    outline: none;
    border-color: var(--primary-gold);
    background: rgba(255, 255, 255, 0.08);
}

.quiz-feedback {
    text-align: center;
    padding: 20px;
    border-radius: 12px;
    margin-top: 20px;
}

.quiz-feedback.correct {
    background: rgba(56, 161, 105, 0.2);
    color: var(--accent-green);
}

.quiz-feedback.incorrect {
    background: rgba(230, 57, 70, 0.2);
    color: var(--primary-red);
}

.quiz-score {
    text-align: center;
    padding: 40px;
}

.score-circle {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-red), var(--primary-gold));
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0 auto 30px;
}

.score-number {
    font-size: 3rem;
    font-weight: 700;
    color: white;
}

.score-label {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
}

/* =====================================================
   Footer
   ===================================================== */
.site-footer {
    background: var(--primary-black);
    position: relative;
    margin-top: 80px;
}

.footer-wave {
    color: var(--primary-black);
    margin-bottom: -5px;
}

.footer-wave svg {
    display: block;
    width: 100%;
}

.footer-content {
    padding: 60px 0 30px;
}

.footer-brand {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    margin-bottom: 15px;
}

.footer-desc {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.footer-heading {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    color: var(--primary-gold);
    margin-bottom: 20px;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 1px;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    color: var(--text-muted);
    transition: all 0.3s ease;
}

.footer-links a:hover {
    color: var(--text-light);
    padding-left: 5px;
}

.social-links {
    display: flex;
    gap: 10px;
}

.social-link {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    transition: all 0.3s ease;
}

.social-link:hover {
    background: var(--primary-gold);
    color: var(--primary-black);
    transform: translateY(-3px);
}

.footer-divider {
    border-color: var(--card-border);
    margin: 30px 0;
}

.copyright, .footer-note {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin: 0;
}

/* =====================================================
   Breadcrumb
   ===================================================== */
.breadcrumb-custom {
    background: transparent;
    padding: 20px 0;
}

.breadcrumb-custom .breadcrumb {
    margin: 0;
    background: transparent;
}

.breadcrumb-custom .breadcrumb-item {
    color: var(--text-muted);
}

.breadcrumb-custom .breadcrumb-item a {
    color: var(--primary-gold);
}

.breadcrumb-custom .breadcrumb-item.active {
    color: var(--text-light);
}

.breadcrumb-custom .breadcrumb-item + .breadcrumb-item::before {
    color: var(--text-muted);
}

/* =====================================================
   Search & Filter
   ===================================================== */
.search-box {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 5px;
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
}

.search-box input {
    background: transparent;
    border: none;
    color: var(--text-light);
    padding: 12px 15px;
    flex: 1;
    font-size: 1rem;
}

.search-box input:focus {
    outline: none;
}

.search-box input::placeholder {
    color: var(--text-muted);
}

.search-box button {
    background: linear-gradient(135deg, var(--primary-red), var(--primary-gold));
    border: none;
    color: white;
    padding: 12px 25px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-box button:hover {
    transform: scale(1.02);
}

.filter-tabs {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 30px;
}

.filter-tab {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    color: var(--text-muted);
    padding: 10px 20px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-tab:hover, .filter-tab.active {
    background: var(--primary-gold);
    color: var(--primary-black);
    border-color: var(--primary-gold);
}

/* =====================================================
   Pagination
   ===================================================== */
.pagination-custom {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 40px;
}

.pagination-custom .page-link {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    color: var(--text-light);
    padding: 10px 18px;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.pagination-custom .page-link:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary-gold);
}

.pagination-custom .page-item.active .page-link {
    background: var(--primary-gold);
    color: var(--primary-black);
    border-color: var(--primary-gold);
}

/* =====================================================
   Loading & Animations
   ===================================================== */
.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--card-border);
    border-top-color: var(--primary-gold);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.fade-in {
    animation: fadeIn 0.5s ease forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Stagger animation for list items */
.stagger-item {
    opacity: 0;
    animation: fadeIn 0.5s ease forwards;
}

.stagger-item:nth-child(1) { animation-delay: 0.1s; }
.stagger-item:nth-child(2) { animation-delay: 0.2s; }
.stagger-item:nth-child(3) { animation-delay: 0.3s; }
.stagger-item:nth-child(4) { animation-delay: 0.4s; }
.stagger-item:nth-child(5) { animation-delay: 0.5s; }
.stagger-item:nth-child(6) { animation-delay: 0.6s; }

/* =====================================================
   Responsive Styles
   ===================================================== */
@media (max-width: 992px) {
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
}

@media (max-width: 768px) {
    :root {
        --section-padding: 50px;
    }
    
    .hero-section {
        padding: 100px 0 60px;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .level-cards {
        grid-template-columns: 1fr;
    }
    
    .vocab-table {
        overflow-x: auto;
    }
    
    .quiz-card {
        padding: 25px;
    }
}

/* =====================================================
   Utility Classes
   ===================================================== */
.text-gold { color: var(--primary-gold) !important; }
.text-red { color: var(--primary-red) !important; }
.bg-glass { 
    background: var(--card-bg); 
    backdrop-filter: blur(10px);
}

.mt-section { margin-top: var(--section-padding); }
.mb-section { margin-bottom: var(--section-padding); }

