/* ==========================================================================
   Modern CSS Theme & High-End Presentation Slide Design (Dark & Light Mode)
   ========================================================================== */

:root {
    --bg-color: #090d16;
    --header-bg: linear-gradient(135deg, #030712 0%, #0f172a 100%);
    --card-bg: #1e293b;
    --card-border: #334155;
    --text-main: #cbd5e1;
    --text-title: #f8fafc;
    
    --primary: #38bdf8;
    --accent: #0ea5e9;
    
    --strong-bg: #1e3a8a;
    --strong-text: #bfdbfe;
    --card-shadow: 0 12px 30px -5px rgba(0, 0, 0, 0.6), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
    
    --font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Light Theme Variables */
body.light-theme {
    --bg-color: #f8fafc;
    --header-bg: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    --card-bg: #ffffff;
    --card-border: #e2e8f0;
    --text-main: #334155;
    --text-title: #0f172a;
    
    --primary: #0284c7;
    --accent: #0284c7;
    
    --strong-bg: #e0f2fe;
    --strong-text: #0369a1;
    --card-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
}

/* ==========================================================================
   Global Reset & Smooth Scrolling
   ========================================================================== */

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-main);
    margin: 0;
    padding: 0;
    line-height: 1.7;
    transition: background-color 0.3s ease, color 0.3s ease;
    overflow-x: hidden;
}

/* ==========================================================================
   Header Section (Streamlined & Mobile Optimized)
   ========================================================================== */

header {
    background: var(--header-bg);
    color: white;
    padding: 2rem 1.2rem 1.6rem 1.2rem;
    text-align: center;
    position: relative;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.header-content {
    max-width: 850px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.header-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 10px;
    margin-bottom: 0.8rem;
}

.badge {
    display: inline-block;
    background: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 600;
    border: 1px solid rgba(56, 189, 248, 0.3);
    letter-spacing: 0.3px;
}

.theme-toggle-btn {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.25);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    user-select: none;
    min-height: 36px;
}

.theme-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
}

header h1 {
    margin: 0 0 8px 0;
    font-size: 2.1rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #ffffff 0%, #38bdf8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header-actions {
    margin: 0.4rem 0 1rem 0;
}

/* Slide Quick Jump Navigation Bar */
.slide-nav {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 0.4rem;
    width: 100%;
}

.nav-pill {
    background: rgba(30, 41, 59, 0.8);
    color: #cbd5e1;
    text-decoration: none;
    padding: 6px 14px;
    border-radius: 25px;
    font-size: 0.85rem;
    font-weight: 600;
    border: 1px solid var(--card-border);
    transition: all 0.25s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 40px;
}

.nav-pill:hover {
    background: rgba(56, 189, 248, 0.15);
    color: #f8fafc;
    border-color: rgba(56, 189, 248, 0.4);
}

.nav-num {
    background: rgba(56, 189, 248, 0.2);
    color: #38bdf8;
    padding: 2px 7px;
    border-radius: 12px;
    font-size: 0.78rem;
    font-weight: 800;
}

/* ==========================================================================
   Main Content & Slide Cards
   ========================================================================== */

main {
    max-width: 920px;
    margin: 2rem auto;
    padding: 0 1.2rem;
}

.card {
    background-color: var(--card-bg);
    border-radius: 18px;
    padding: 1.8rem;
    margin-bottom: 2.2rem;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--card-border);
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, background-color 0.3s ease, border-color 0.3s ease;
}

.slide-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.slide-badge {
    background: rgba(15, 23, 42, 0.7);
    color: #94a3b8;
    font-size: 0.85rem;
    font-weight: 700;
    padding: 5px 12px;
    border-radius: 20px;
    border: 1px solid var(--card-border);
}

body.light-theme .slide-badge {
    background: #f1f5f9;
    color: #64748b;
}

.slide-num-highlight {
    color: #38bdf8;
    font-size: 1rem;
}

.slide-category {
    font-size: 0.78rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cat-amber { background: rgba(245, 158, 11, 0.15); color: #d97706; border: 1px solid rgba(245, 158, 11, 0.3); }
.cat-purple { background: rgba(168, 85, 247, 0.15); color: #9333ea; border: 1px solid rgba(168, 85, 247, 0.3); }
.cat-cyan { background: rgba(6, 182, 212, 0.15); color: #0891b2; border: 1px solid rgba(6, 182, 212, 0.3); }

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 5px;
    height: 100%;
    border-top-left-radius: 18px;
    border-bottom-left-radius: 18px;
}

#folie-1::before, #kapitel-betrug::before { background: linear-gradient(to bottom, #f59e0b, #ef4444); }
#folie-2::before, #kapitel-messenger::before { background: linear-gradient(to bottom, #a855f7, #ec4899); }
#folie-3::before, #kapitel-medien::before { background: linear-gradient(to bottom, #10b981, #06b6d4); }

.card-header {
    border-bottom: 1px solid var(--card-border);
    padding-bottom: 1rem;
    margin-bottom: 1.4rem;
}

.card-header h2 {
    margin: 0;
    color: var(--text-title);
    font-size: 1.45rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-icon {
    font-size: 1.5rem;
}

/* ==========================================================================
   Data Charts & Visual Graphs
   ========================================================================== */

.chart-box {
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid rgba(56, 189, 248, 0.25);
    border-radius: 16px;
    padding: 1.3rem;
    margin: 1.4rem 0 1.8rem 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

body.light-theme .chart-box {
    background: #f8fafc;
    border-color: #cbd5e1;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
}

.chart-header h4 {
    margin: 0 0 1rem 0;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-title);
}

.chart-footer {
    font-size: 0.8rem;
    color: #94a3b8;
    font-style: italic;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 8px;
    margin-top: 1rem;
}

body.light-theme .chart-footer {
    border-top-color: #e2e8f0;
    color: #64748b;
}

/* Chart 1: Visual Säulendiagramm (Bar Chart) */
.bar-chart {
    display: flex;
    justify-content: space-around;
    align-items: flex-end;
    height: 160px;
    padding-top: 22px;
    border-bottom: 2px solid var(--card-border);
}

.bar-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 30%;
    height: 100%;
    justify-content: flex-end;
}

.bar-fill-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.bar-fill {
    width: 75%;
    max-width: 55px;
    border-radius: 6px 6px 0 0;
    position: relative;
    transition: height 1s ease-in-out;
    display: flex;
    justify-content: center;
}

.bar-red { background: linear-gradient(180deg, #ef4444 0%, #b91c1c 100%); }
.bar-amber { background: linear-gradient(180deg, #f59e0b 0%, #b45309 100%); }
.bar-cyan { background: linear-gradient(180deg, #06b6d4 0%, #0e7490 100%); }

.bar-val {
    position: absolute;
    top: -22px;
    font-size: 0.82rem;
    font-weight: 800;
    color: var(--text-title);
    white-space: nowrap;
}

.bar-label {
    margin-top: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-main);
    text-align: center;
}

/* Chart 2: Ring Stats Grid */
.stat-rings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.ring-card {
    background: rgba(30, 41, 59, 0.7);
    border: 1px solid var(--card-border);
    border-radius: 14px;
    padding: 1rem;
    text-align: center;
}

body.light-theme .ring-card {
    background: #ffffff;
    border-color: #e2e8f0;
}

.ring-number {
    font-size: 1.9rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 4px;
}

.num-purple { color: #a855f7; }
.num-pink { color: #ec4899; }
.num-amber { color: #d97706; }

.ring-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-title);
}

.ring-desc {
    font-size: 0.78rem;
    color: #64748b;
    margin-top: 2px;
}

/* Chart 3: Visual Comparison Gauges */
.gauge-container {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.gauge-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.gauge-label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.88rem;
    color: var(--text-main);
    flex-wrap: wrap;
    gap: 4px;
}

.alert-text { color: #ef4444; font-weight: 700; }
.success-text { color: #10b981; font-weight: 700; }

.gauge-track {
    width: 100%;
    height: 9px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
}

body.light-theme .gauge-track {
    background: #e2e8f0;
}

.gauge-fill {
    height: 100%;
    border-radius: 10px;
}

.fill-alert { background: linear-gradient(90deg, #f87171, #ef4444); }
.fill-success { background: linear-gradient(90deg, #34d399, #10b981); }

/* Data Tables Styling (Touch Scrollable) */
.table-container {
    background-color: rgba(15, 23, 42, 0.75);
    border: 1px solid rgba(56, 189, 248, 0.25);
    border-radius: 14px;
    padding: 1.1rem;
    margin: 1.5rem 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

body.light-theme .table-container {
    background-color: #f8fafc;
    border-color: #cbd5e1;
}

.table-title {
    margin: 0 0 0.8rem 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-title);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.9rem;
    min-width: 480px; /* Ensures readable table on small screens */
}

.data-table th {
    background-color: rgba(30, 41, 59, 0.9);
    color: #38bdf8;
    padding: 10px 12px;
    font-weight: 700;
    border-bottom: 2px solid var(--card-border);
}

body.light-theme .data-table th {
    background-color: #e2e8f0;
    color: #0284c7;
}

.data-table td {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    color: var(--text-main);
}

body.light-theme .data-table td {
    border-bottom-color: #e2e8f0;
}

/* ==========================================================================
   Topic Presentation Boxes & Highlight Cards (Clean Vertical Stacking)
   ========================================================================== */

.topic-box {
    background-color: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--card-border);
    border-radius: 14px;
    padding: 1.2rem;
    margin-bottom: 1.2rem;
    display: flex;
    flex-direction: column;
    width: 100%;
    transition: transform 0.2s ease, border-color 0.2s ease, background-color 0.3s ease;
}

body.light-theme .topic-box {
    background-color: #f1f5f9;
    border-color: #cbd5e1;
}

.topic-box:last-child {
    margin-bottom: 0;
}

/* Highlight Box for Positiv-Beispiel (athenrix.net) */
.highlight-box {
    border: 1px solid #0ea5e9 !important;
    background: rgba(14, 165, 233, 0.1) !important;
}

body.light-theme .highlight-box {
    background: rgba(2, 132, 199, 0.08) !important;
    border-color: #0284c7 !important;
}

.topic-box h3 {
    margin: 0 0 10px 0;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-title);
    line-height: 1.4;
}

.bullet-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.bullet-list li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.96rem;
    color: var(--text-main);
    line-height: 1.6;
    word-break: break-word;
}

.bullet-list li span:last-child {
    flex: 1;
}

.bullet-icon {
    font-size: 1.05rem;
    flex-shrink: 0;
    margin-top: 2px;
}

/* Styled Pill Badges for Strong text */
strong {
    color: var(--strong-text);
    font-weight: 700;
    background-color: var(--strong-bg);
    padding: 2px 7px;
    border-radius: 6px;
    font-size: 0.95em;
    display: inline-block;
    max-width: 100%;
    word-break: break-word;
    white-space: normal;
}

/* Buttons */
.btn {
    font-family: inherit;
    font-weight: 600;
    border: none;
    padding: 8px 16px;
    border-radius: 10px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    outline: none;
    user-select: none;
    min-height: 40px;
}

.btn-theme-link {
    background: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.3);
    font-size: 0.88rem;
}

body.light-theme .btn-theme-link {
    background: rgba(2, 132, 199, 0.1);
    color: #0284c7;
    border-color: rgba(2, 132, 199, 0.3);
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem 1rem;
    color: #64748b;
    font-size: 0.88rem;
    border-top: 1px solid var(--card-border);
    margin-top: 2.5rem;
}

/* ==========================================================================
   📱 Mobile Responsive System (Smartphones & Tablets)
   ========================================================================== */

@media (max-width: 768px) {
    header {
        padding: 1.4rem 1rem 1.2rem 1rem;
    }

    header h1 {
        font-size: 1.65rem;
        margin-bottom: 6px;
    }

    .badge {
        font-size: 0.76rem;
        padding: 4px 10px;
    }

    .theme-toggle-btn {
        padding: 4px 10px;
        font-size: 0.78rem;
        min-height: 34px;
    }

    .slide-nav {
        display: flex;
        overflow-x: auto;
        justify-content: flex-start;
        width: 100%;
        padding-bottom: 6px;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .slide-nav::-webkit-scrollbar {
        display: none;
    }

    .nav-pill {
        flex-shrink: 0;
        scroll-snap-align: start;
        padding: 6px 12px;
        font-size: 0.82rem;
        min-height: 38px;
    }

    main {
        padding: 0 0.8rem;
        margin: 1.2rem auto;
    }

    .card {
        padding: 1.1rem;
        border-radius: 14px;
        margin-bottom: 1.4rem;
    }

    .card-header h2 {
        font-size: 1.18rem;
    }

    .topic-box {
        padding: 0.9rem;
        border-radius: 12px;
        margin-bottom: 1rem;
    }

    .topic-box h3 {
        font-size: 1.02rem;
    }

    .bullet-list li {
        font-size: 0.91rem;
    }

    .bar-chart {
        height: 130px;
        padding-top: 15px;
    }

    .bar-val {
        font-size: 0.75rem;
        top: -20px;
    }

    .bar-label {
        font-size: 0.72rem;
    }

    .stat-rings-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .ring-card {
        padding: 0.9rem;
    }

    .ring-number {
        font-size: 1.7rem;
    }

    .table-container {
        padding: 0.8rem;
        border-radius: 12px;
    }

    .data-table {
        font-size: 0.82rem;
    }

    .data-table th, .data-table td {
        padding: 8px 8px;
    }
}
