/* ==========================================================================
   CSS DESIGN SYSTEM FOR LOGISTIK KURS-WEBAPP & KACHELN
   Schlichtes, modernes Design mit Light/Dark-Mode & exakter roter Akzentfarbe
   ========================================================================== */

:root {
    /* Akzentfarbe: Primäres Rot exakt/modern konfiguriert */
    --primary-red: #D32F2F;
    --primary-red-hover: #B71C1C;
    --primary-red-light: rgba(211, 47, 47, 0.1);
    --primary-red-border: rgba(211, 47, 47, 0.3);

    /* Light Mode Tokens (Default) */
    --bg-color: #F8FAFC;
    --surface-color: #FFFFFF;
    --surface-hover: #F1F5F9;
    --text-color: #0F172A;
    --text-muted: #64748B;
    --border-color: #E2E8F0;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.1);

    /* Status Colors */
    --success-bg: #DCFCE7;
    --success-text: #166534;
    --success-border: #86EFAC;
    --info-bg: #E0F2FE;
    --info-text: #0369A1;
    --info-border: #7DD3FC;
    --warning-bg: #FEF3C7;
    --warning-text: #92400E;
    --warning-border: #FDE68A;

    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-medium: 0.35s ease;
}

body.dark-mode, html.dark-mode body {
    /* Dark Mode Tokens */
    --bg-color: #0B0F19;
    --surface-color: #151C2C;
    --surface-hover: #1E293B;
    --text-color: #F8FAFC;
    --text-muted: #94A3B8;
    --border-color: #2D3748;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.4);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.5);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.6);

    --primary-red-light: rgba(211, 47, 47, 0.18);
    --primary-red-border: rgba(211, 47, 47, 0.5);

    --success-bg: rgba(22, 101, 52, 0.25);
    --success-text: #4ADE80;
    --success-border: #166534;
    --info-bg: rgba(3, 105, 161, 0.25);
    --info-text: #38BDF8;
    --info-border: #0369A1;
    --warning-bg: rgba(146, 64, 14, 0.25);
    --warning-text: #FBBF24;
    --warning-border: #92400E;
}

/* Base Styles & Typography */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    transition: background-color var(--transition-medium), color var(--transition-medium);
}

h1, h2, h3, h4, h5 {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 700;
    color: var(--text-color);
}

a {
    text-decoration: none;
    color: inherit;
}

.app-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* Top Navigation Bar */
.top-nav-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.back-btn {
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

/* Header */
.main-header {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.badge {
    display: inline-block;
    background: var(--primary-red-light);
    color: var(--primary-red);
    font-weight: 600;
    font-size: 0.85rem;
    padding: 0.35rem 0.8rem;
    border-radius: 20px;
    margin-bottom: 0.75rem;
    border: 1px solid var(--primary-red-border);
}

.header-title h1 {
    font-size: 2.25rem;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.subtitle {
    color: var(--text-muted);
    font-size: 1.05rem;
}

.theme-toggle-btn {
    background: var(--surface-hover);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    font-weight: 600;
    padding: 0.65rem 1.25rem;
    border-radius: 10px;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
}

.theme-toggle-btn:hover {
    border-color: var(--primary-red);
    color: var(--primary-red);
    transform: translateY(-1px);
}

body.light-mode .dark-icon { display: inline; }
body.light-mode .light-icon { display: none; }
body.dark-mode .dark-icon { display: none; }
body.dark-mode .light-icon { display: inline; }

/* Tabs Navigation */
.tabs-nav {
    display: flex;
    gap: 0.75rem;
    border-top: 1px solid var(--border-color);
    padding-top: 1.5rem;
    flex-wrap: wrap;
}

.tab-btn {
    flex: 1;
    min-width: 190px;
    background: var(--surface-hover);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    padding: 1rem 1.25rem;
    border-radius: 12px;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
}

.tab-btn:hover {
    color: var(--text-color);
    border-color: var(--text-muted);
}

.tab-btn.active {
    background: var(--primary-red);
    color: #FFFFFF;
    border-color: var(--primary-red);
    box-shadow: 0 4px 14px rgba(211, 47, 47, 0.35);
}

/* Tab Panes */
.tab-pane {
    display: none;
    animation: fadeIn 0.3s ease-out;
}

.tab-pane.active {
    display: block;
}

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

.section-header {
    margin-bottom: 2rem;
}

.section-header h2 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

.section-header p {
    color: var(--text-muted);
    font-size: 1.05rem;
}

/* ==========================================================================
   DASHBOARD ÜBERSICHT (INDEX.HTML) STYLING
   ========================================================================== */
.tiles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.75rem;
    margin-top: 2rem;
}

.tile-card {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 1.5rem;
    transition: all var(--transition-medium);
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.tile-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-red);
}

.tile-card.disabled {
    opacity: 0.65;
    cursor: not-allowed;
}
.tile-card.disabled:hover {
    transform: none;
    box-shadow: var(--shadow-sm);
    border-color: var(--border-color);
}

.tile-badge {
    display: inline-block;
    background: var(--surface-hover);
    color: var(--text-color);
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0.35rem 0.8rem;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    align-self: flex-start;
}

.tile-card.active-tile .tile-badge {
    background: var(--primary-red-light);
    color: var(--primary-red);
    border-color: var(--primary-red-border);
}

.tile-content h3 {
    font-size: 1.4rem;
    margin: 0.75rem 0 0.5rem;
}

.tile-content p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.tile-features {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.tile-feature-tag {
    background: var(--surface-hover);
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.25rem 0.65rem;
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.tile-card.active-tile .tile-feature-tag {
    color: var(--text-color);
}

.tile-footer {
    border-top: 1px solid var(--border-color);
    padding-top: 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tile-status {
    font-size: 0.85rem;
    font-weight: 600;
}

.status-ready { color: #10B981; }
.status-pending { color: var(--text-muted); }

/* ==========================================================================
   PDF VIEWER CONTAINER
   ========================================================================== */
.pdf-viewer-container {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    height: 850px;
    width: 100%;
}

.pdf-iframe {
    width: 100%;
    height: 100%;
    border: none;
    background: #F1F5F9;
}

/* ==========================================================================
   BEREICH 1: ÜBERSICHT STYLING & FORMELN (REIN HTML5/CSS)
   ========================================================================== */
.overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(560px, 1fr));
    gap: 1.75rem;
}

@media (max-width: 768px) {
    .overview-grid {
        grid-template-columns: 1fr;
    }
}

.content-card {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.card-header-tag {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--primary-red);
}

.content-card h3 {
    font-size: 1.4rem;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.75rem;
}

.subheading {
    font-size: 1.15rem;
    color: var(--text-color);
    margin-top: 0.5rem;
}

/* Reine HTML5 Formel-Boxen und Brüche */
.formula-box {
    background: var(--surface-hover);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--primary-red);
    padding: 1.25rem 1.5rem;
    border-radius: 10px;
    margin: 1rem 0;
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.6rem;
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.formula-fraction {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    vertical-align: middle;
    margin: 0 0.35rem;
    font-weight: 600;
}

.formula-fraction .num {
    border-bottom: 2px solid var(--text-color);
    padding: 0 0.4rem 0.15rem;
    text-align: center;
    width: 100%;
}

.formula-fraction .den {
    padding: 0.15rem 0.4rem 0;
    text-align: center;
    width: 100%;
}

.formula-fraction.inline {
    font-size: 0.9em;
    margin: 0 0.2rem;
}

.formula-fraction.inline .num {
    border-bottom: 1.5px solid var(--text-color);
    padding-bottom: 0.1rem;
}

.definition-box {
    background: var(--surface-hover);
    border-left: 4px solid var(--primary-red);
    padding: 1.25rem;
    border-radius: 0 10px 10px 0;
}

.definition-box h4 {
    font-size: 1rem;
    margin-bottom: 0.4rem;
    color: var(--primary-red);
}

.definition-box.green-accent {
    border-left-color: #10B981;
}
.definition-box.green-accent h4 {
    color: #10B981;
}

.six-r-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.75rem;
    padding-left: 1.5rem;
}

.six-r-list li {
    background: var(--surface-hover);
    padding: 0.6rem 1rem;
    border-radius: 8px;
    font-weight: 500;
    list-style: none;
    position: relative;
    border: 1px solid var(--border-color);
}

.six-r-list li::before {
    content: "✓";
    color: var(--primary-red);
    font-weight: 800;
    margin-right: 0.5rem;
}

.structured-list, .erkenntnis-list {
    padding-left: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.structured-list ul {
    padding-left: 1.5rem;
    margin-top: 0.35rem;
}

.highlight-callout {
    background: var(--primary-red-light);
    border: 1px solid var(--primary-red-border);
    color: var(--text-color);
    padding: 1rem 1.25rem;
    border-radius: 10px;
    font-weight: 500;
}

.red-border {
    border-left: 4px solid var(--primary-red);
}

.comment-pill {
    align-self: flex-start;
    background: var(--info-bg);
    color: var(--info-text);
    border: 1px solid var(--info-border);
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.3rem 0.8rem;
    border-radius: 6px;
}

.three-columns-mini {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

@media (max-width: 600px) {
    .three-columns-mini {
        grid-template-columns: 1fr;
    }
}

.mini-col {
    background: var(--surface-hover);
    padding: 1rem;
    border-radius: 10px;
    border: 1px solid var(--border-color);
}

.mini-col h5 {
    color: var(--primary-red);
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.mini-col ul {
    padding-left: 1.2rem;
    font-size: 0.95rem;
}

.timeline-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.timeline-list li {
    background: var(--surface-hover);
    padding: 0.85rem 1rem;
    border-radius: 8px;
    border-left: 3px solid var(--primary-red);
}

.goals-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

.goal-box {
    background: var(--surface-hover);
    border: 1px solid var(--border-color);
    padding: 1rem;
    border-radius: 10px;
}

.goal-box h5 {
    font-size: 0.95rem;
    color: var(--primary-red);
    margin-bottom: 0.35rem;
}

.goal-box p {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Data Tables */
.table-responsive {
    overflow-x: auto;
    border: 1px solid var(--border-color);
    border-radius: 10px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.data-table th, .data-table td {
    padding: 0.85rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    background: var(--surface-hover);
    font-weight: 700;
    color: var(--text-color);
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table td ul {
    padding-left: 1.2rem;
}

/* Stages */
.stages-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.stage-step {
    display: flex;
    gap: 1rem;
    background: var(--surface-hover);
    border: 1px solid var(--border-color);
    padding: 1.25rem;
    border-radius: 12px;
}

.stage-num {
    width: 36px;
    height: 36px;
    background: var(--primary-red);
    color: white;
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stage-body h5 {
    font-size: 1.05rem;
    margin-bottom: 0.4rem;
}

.stage-body ul {
    padding-left: 1.25rem;
    color: var(--text-muted);
}

/* Comparison Box */
.comparison-box {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 600px) {
    .comparison-box {
        grid-template-columns: 1fr;
    }
}

.comparison-box div {
    background: var(--surface-hover);
    border: 1px solid var(--border-color);
    padding: 1.25rem;
    border-radius: 10px;
}

.tag {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.tag-scm {
    background: #DBEAFE;
    color: #1D4ED8;
}

.tag-log {
    background: #FEF3C7;
    color: #B45309;
}

/* Flow Diagram */
.flow-diagram {
    background: var(--surface-hover);
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    border-radius: 12px;
    text-align: center;
}

.flow-arrow {
    font-weight: 700;
    color: var(--primary-red);
    margin: 0.5rem 0;
    font-size: 0.95rem;
}

.flow-steps {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    margin: 1rem 0;
}

.flow-steps span {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
}

.flow-steps span.flow-highlight {
    background: var(--primary-red);
    color: white;
    border-color: var(--primary-red);
}

.party-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.party-list li {
    background: var(--surface-hover);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border-left: 3px solid var(--border-color);
}

.party-list li strong {
    color: var(--primary-red);
}

.grid-4-cols {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 0.75rem;
}

.pack-type {
    background: var(--surface-hover);
    border: 1px solid var(--border-color);
    padding: 1rem;
    border-radius: 10px;
    text-align: center;
}

.pack-type span {
    display: inline-block;
    width: 24px;
    height: 24px;
    background: var(--primary-red);
    color: white;
    font-weight: 700;
    border-radius: 50%;
    margin-bottom: 0.35rem;
}

.pack-type strong {
    display: block;
    font-size: 0.9rem;
}

.pack-type p {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.flow-simple {
    font-size: 1.05rem;
    text-align: center;
    background: var(--surface-color);
    padding: 0.75rem;
    border-radius: 8px;
    margin-top: 0.5rem;
}

/* Triangle */
.triangle-container {
    background: var(--surface-hover);
    border: 1px solid var(--border-color);
    padding: 2rem;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-weight: 700;
}

.triangle-top { color: var(--primary-red); font-size: 1.1rem; }
.triangle-graphic { font-size: 4rem; color: var(--border-color); line-height: 1; margin: 0.5rem 0; }
.triangle-bottom {
    display: flex;
    justify-content: space-between;
    width: 260px;
    font-size: 1.1rem;
}
.triangle-bottom span:first-child { color: #3B82F6; }
.triangle-bottom span:last-child { color: #10B981; }

/* ==========================================================================
   BEREICH 2: KARTEIKARTEN STYLING
   ========================================================================== */
.flashcard-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    padding: 1.25rem 1.5rem;
    border-radius: 14px;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 600;
}

.filter-select {
    padding: 0.6rem 1rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--surface-hover);
    color: var(--text-color);
    font-weight: 500;
    font-size: 0.95rem;
    cursor: pointer;
}

.btn {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    padding: 0.65rem 1.25rem;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--primary-red);
    color: white;
}
.btn-primary:hover {
    background: var(--primary-red-hover);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--surface-hover);
    color: var(--text-color);
    border: 1px solid var(--border-color);
}
.btn-secondary:hover {
    border-color: var(--primary-red);
    color: var(--primary-red);
}

.btn-nav {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}
.btn-nav:hover {
    background: var(--surface-hover);
    border-color: var(--primary-red);
}

.flashcard-wrapper {
    max-width: 800px;
    margin: 0 auto;
}

.flashcard-scene {
    width: 100%;
    height: 420px;
    perspective: 1000px;
    cursor: pointer;
    margin-bottom: 1.5rem;
}

.flashcard {
    width: 100%;
    height: 100%;
    position: relative;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
}

.flashcard.is-flipped, .flashcard.flipped {
    transform: rotateY(180deg);
}

.flashcards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.75rem;
    margin-bottom: 2rem;
}

.flashcard-inner {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 320px;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
    cursor: pointer;
}

.flashcard.flipped .flashcard-inner, .flashcard.is-flipped .flashcard-inner {
    transform: rotateY(180deg);
}

.card-face, .flashcard-front, .flashcard-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border-radius: 20px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
}

.card-front, .flashcard-front {
    background: var(--surface-color);
}

.card-back, .flashcard-back {
    background: var(--surface-color);
    transform: rotateY(180deg);
    border-color: var(--primary-red);
}

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

.fc-badge {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--primary-red);
    background: var(--surface-hover);
    padding: 0.3rem 0.75rem;
    border-radius: 20px;
    border: 1px solid var(--border-color);
}

.fc-hint-icon {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.fc-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    margin: 1rem 0;
}

.fc-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.fc-question, .fc-answer {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-color);
}

.fc-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px dashed var(--border-color);
    padding-top: 0.85rem;
    margin-top: 0.85rem;
    font-size: 0.85rem;
}

.fc-mastered-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-muted);
}

.fc-mastered-check input[type="checkbox"] {
    accent-color: #166534;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.flashcard.mastered .flashcard-front, .flashcard.mastered .flashcard-back {
    border-color: #166534;
    background: rgba(22, 101, 52, 0.04);
}

.fc-category {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--primary-red);
}

.fc-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 1rem 0;
    overflow-y: auto;
}

.fc-content h3 {
    font-size: 1.8rem;
    line-height: 1.4;
}

#fc-back-text {
    font-size: 1.15rem;
    color: var(--text-color);
    line-height: 1.7;
    text-align: left;
    width: 100%;
}

#fc-back-text ul, #fc-back-text ol {
    padding-left: 1.5rem;
    margin-top: 0.5rem;
}

.fc-hint {
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
    border-top: 1px dashed var(--border-color);
    padding-top: 1rem;
}

.flashcard-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    padding: 1rem 1.5rem;
    border-radius: 14px;
    box-shadow: var(--shadow-sm);
}

.fc-counter {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--primary-red);
}

/* ==========================================================================
   BEREICH 3: AUFGABEN STYLING
   ========================================================================== */
.tasks-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.task-card {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    padding: 2rem;
    box-shadow: var(--shadow-sm);
}

.task-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 1.25rem;
}

.task-badge {
    background: var(--surface-hover);
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 700;
    padding: 0.35rem 0.85rem;
    border-radius: 20px;
    border: 1px solid var(--border-color);
}

.task-question {
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.75;
    margin-bottom: 2.5rem; /* Viel Abstand, damit Fragen und Antworten nicht aneinander kleben */
    color: var(--text-color);
    background: var(--surface-hover);
    padding: 1.5rem 1.75rem;
    border-radius: 14px;
    border-left: 6px solid var(--primary-red);
    box-shadow: var(--shadow-sm);
}

/* Choice Options */
.options-list {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    margin-bottom: 2rem;
}

.option-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--surface-hover);
    border: 2px solid var(--border-color);
    padding: 1rem 1.25rem;
    border-radius: 12px;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-weight: 500;
}

.option-item:hover {
    border-color: var(--primary-red);
    background: var(--primary-red-light);
}

.option-item.selected {
    border-color: var(--primary-red);
    background: var(--primary-red-light);
    font-weight: 600;
}

.option-checkbox, .option-radio {
    width: 20px;
    height: 20px;
    accent-color: var(--primary-red);
    cursor: pointer;
}

/* Drag & Drop Assignment */
.dd-container {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

@media (max-width: 768px) {
    .dd-container {
        grid-template-columns: 1fr;
    }
}

.dd-pool {
    background: var(--surface-hover);
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-height: 200px;
}

.dd-pool h5, .dd-targets h5 {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.dd-item {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: grab;
    user-select: none;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.dd-item:active {
    cursor: grabbing;
}

.dd-targets {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.dd-target-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--surface-hover);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.75rem 1rem;
}

.dd-target-label {
    flex: 1;
    font-size: 0.95rem;
}

.dd-dropzone {
    width: 180px;
    min-height: 48px;
    background: var(--surface-color);
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.35rem;
    transition: all var(--transition-fast);
}

.dd-dropzone.drag-over {
    border-color: var(--primary-red);
    background: var(--primary-red-light);
}

/* Sorting Task */
.sort-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-bottom: 1.5rem;
}

.sort-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--surface-hover);
    border: 1px solid var(--border-color);
    padding: 0.85rem 1.25rem;
    border-radius: 10px;
    cursor: grab;
    font-weight: 500;
}

.sort-handle {
    color: var(--text-muted);
    font-size: 1.25rem;
    cursor: grab;
}

/* Task Controls & Feedback */
.task-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    border-top: 1px solid var(--border-color);
    padding-top: 1.25rem;
}

.btn-hint {
    background: #FEF3C7;
    color: #B45309;
    border: 1px solid #FDE68A;
}
.btn-hint:hover {
    background: #FDE68A;
    color: #92400E;
}

body.dark-mode .btn-hint {
    background: rgba(180, 83, 9, 0.25);
    color: #FBBF24;
    border-color: #B45309;
}

.feedback-box {
    margin-top: 1.5rem;
    padding: 1.5rem;
    border-radius: 14px;
    animation: fadeIn 0.3s ease-out;
}

.feedback-box.correct {
    background: var(--success-bg);
    border: 2px solid var(--success-border);
    color: var(--success-text);
}

.feedback-box.incorrect {
    background: var(--warning-bg);
    border: 2px solid var(--warning-border);
    color: var(--warning-text);
}

.task-feedback-box {
    margin-top: 1.5rem;
    padding: 1.5rem;
    border-radius: 14px;
    animation: fadeIn 0.3s ease-out;
}

.task-feedback-box.feedback-success, .feedback-success {
    background: var(--success-bg);
    border: 2px solid var(--success-border);
    color: var(--success-text);
}

.task-feedback-box.feedback-error, .feedback-error {
    background: var(--warning-bg);
    border: 2px solid var(--warning-border);
    color: var(--warning-text);
}

.task-hint-box {
    margin-top: 1.25rem;
    padding: 1.25rem 1.5rem;
    background: #FEF3C7;
    color: #92400E;
    border: 1px solid #FDE68A;
    border-radius: 12px;
    font-size: 0.95rem;
    line-height: 1.6;
    animation: fadeIn 0.25s ease-out;
}

body.dark-mode .task-hint-box {
    background: rgba(180, 83, 9, 0.2);
    color: #FBBF24;
    border-color: #B45309;
}

.task-options-group {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    margin-bottom: 2rem;
}

.task-option-label {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--surface-hover);
    border: 2px solid var(--border-color);
    padding: 1rem 1.25rem;
    border-radius: 12px;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-weight: 500;
}

.task-option-label:hover {
    border-color: var(--primary-red);
    background: var(--primary-red-light);
}

.task-option-label.selected {
    border-color: var(--primary-red);
    background: var(--primary-red-light);
    font-weight: 600;
}

.task-option-label input[type="radio"], .task-option-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--primary-red);
    cursor: pointer;
}

.task-input-row {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.task-num-input {
    background: var(--surface-color);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    padding: 0.85rem 1.25rem;
    font-size: 1.1rem;
    color: var(--text-color);
    width: 240px;
    transition: border-color 0.2s ease;
}

.task-num-input:focus {
    outline: none;
    border-color: var(--primary-red);
}

.feedback-header {
    font-size: 1.15rem;
    font-weight: 800;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.solution-path {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid inherit;
    font-size: 0.95rem;
    color: var(--text-color);
}

.solution-path h5 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    color: inherit;
}

/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1.5rem;
    animation: fadeIn 0.2s ease-out;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    width: 100%;
    max-width: 560px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.modal-header {
    background: var(--surface-hover);
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 1.25rem;
    color: var(--primary-red);
}

.close-modal-btn {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
}

.modal-body {
    padding: 1.5rem;
    font-size: 1.05rem;
    line-height: 1.6;
}

.modal-footer {
    padding: 1rem 1.5rem;
    background: var(--surface-hover);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
}

/* Footer */
.main-footer {
    text-align: center;
    padding: 2.5rem 0;
    color: var(--text-muted);
    font-size: 0.9rem;
    border-top: 1px solid var(--border-color);
    margin-top: 3rem;
}

/* ==========================================================================
   GLOBALER WEBAPP HEADER (Schriftzug "Logistik" -> Main Page)
   ========================================================================== */
.global-portal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1rem 1.75rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
    flex-wrap: wrap;
    gap: 1rem;
}

.brand-logo-link {
    display: inline-flex;
    align-items: center;
    gap: 0.85rem;
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 800;
    font-size: 1.45rem;
    color: var(--text-color);
    text-decoration: none;
    letter-spacing: -0.02em;
    transition: transform var(--transition-fast), color var(--transition-fast);
}

.brand-logo-link:hover {
    color: var(--primary-red);
    transform: translateY(-1px);
}

.brand-logo-badge {
    background: var(--primary-red);
    color: #FFFFFF;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    box-shadow: 0 4px 12px rgba(211, 47, 47, 0.35);
}

/* ==========================================================================
   INTERAKTIVE RECHEN-EINGABEFELDER & GUIDED STEPS
   ========================================================================== */
.calc-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 2.25rem;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.75rem;
}

.calc-intro {
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.calc-step {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1.35rem;
    background: var(--surface-hover);
    border-radius: 14px;
    border: 1px solid var(--border-color);
    transition: border-color var(--transition-fast);
}

.calc-step:hover {
    border-color: var(--primary-red-border);
}

.calc-step-title {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.calc-step-number {
    background: var(--primary-red);
    color: #FFFFFF;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 800;
}

.calc-input-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

.calc-label {
    font-weight: 600;
    color: var(--text-color);
    font-size: 1rem;
}

.calc-input {
    background: var(--surface-color);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    padding: 0.75rem 1.2rem;
    font-size: 1.15rem;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    color: var(--text-color);
    width: 240px;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.calc-input:focus {
    outline: none;
    border-color: var(--primary-red);
    box-shadow: 0 0 0 4px var(--primary-red-light);
}

.calc-unit,
.task-unit {
    font-weight: 700;
    color: var(--text-muted);
    font-size: 1.05rem;
    margin-left: 0.5rem;
    display: inline-block;
    vertical-align: middle;
}

/* ==========================================================================
   ENHANCED PDF TOOLBAR & VIEWER
   ========================================================================== */
.pdf-viewer-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: 100%;
}

.pdf-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.75rem 1.25rem;
    box-shadow: var(--shadow-sm);
}

.pdf-toolbar-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 600;
    color: var(--text-color);
}

.pdf-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.pdf-viewer-container {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    height: 85vh;
    min-height: 850px;
    width: 100%;
}

/* ==========================================================================
   BRAND LOGO STYLING
   ========================================================================== */
.brand-logo-link {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
    color: var(--text-color);
    font-weight: 700;
    font-size: 1.1rem;
    font-family: 'Outfit', sans-serif;
    transition: opacity var(--transition-fast);
}

.brand-logo-link:hover {
    opacity: 0.9;
}

.brand-logo-icon {
    font-size: 1.4rem;
    background: linear-gradient(135deg, rgba(225,29,72,0.15), rgba(225,29,72,0.3));
    border: 1px solid rgba(225,29,72,0.3);
    border-radius: 8px;
    padding: 0.2rem 0.45rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.brand-logo-tag {
    font-size: 0.75rem;
    font-weight: 700;
    background: var(--primary-red);
    color: #ffffff;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ==========================================================================
   EXAM SIMULATOR & RESULT STYLING
   ========================================================================== */
.exam-container {
    max-width: 900px;
    margin: 0 auto;
}

.exam-banner {
    background: linear-gradient(135deg, #1E293B, #0F172A);
    color: #FFFFFF;
    border-radius: 16px;
    padding: 1.5rem 2rem;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    box-shadow: var(--shadow-md);
}

.exam-timer-box {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 12px;
    padding: 0.6rem 1.2rem;
    text-align: center;
}

.exam-timer-val {
    font-family: 'Outfit', sans-serif;
    font-size: 1.6rem;
    font-weight: 800;
    color: #F8FAFC;
}

.exam-card {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.75rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.exam-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    border-bottom: 1px dashed var(--border-color);
    padding-bottom: 0.75rem;
}

.exam-card-num {
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--primary-red);
}

.exam-score-card {
    background: var(--surface-color);
    border: 2px solid var(--border-color);
    border-radius: 20px;
    padding: 2rem;
    margin-bottom: 2.5rem;
    box-shadow: var(--shadow-md);
    text-align: center;
}

.exam-grade-badge {
    display: inline-block;
    font-family: 'Outfit', sans-serif;
    font-size: 3rem;
    font-weight: 800;
    padding: 0.5rem 2rem;
    border-radius: 16px;
    margin: 1rem 0;
}

.grade-passed {
    background: #DCFCE7;
    color: #166534;
    border: 2px solid #86EFAC;
}

.grade-failed {
    background: #FEE2E2;
    color: #991B1B;
    border: 2px solid #FCA5A5;
}

