/* =========================================
   1. VARIABLEN & BASIS
   ========================================= */
:root {
    --primary: #5FAC22;
    --primary-light: #e8f5e9; /* Helles Grün für Hintergründe/Hover */
    --primary-hover: #4a8a1b;
    --dark: #1E2132;
    --text: #2c3e50; /* Dunkles Grau für bessere Lesbarkeit */
    --bg-light: #F5F7F5;
    --white: #ffffff;
    
    /* Fonts */
    --font-heading: 'Cairo', sans-serif;
    --font-body: 'Roboto', sans-serif;

    /* Kompetenzfarben (St. Galler Modell) */
    --color-verstehen: #d68c7e;
    --color-verantworten: #8b5d66;
    --color-zusammenarbeiten: #7a8dbb;
    --color-anwenden: #6caeb5;
    --color-gestalten: #97c4b5;
    --color-evaluieren: #e7d159;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }

body {
    font-family: var(--font-body);
    color: var(--text);
    background-color: var(--bg-light);
    display: flex;
    flex-direction: column;
}

/* =========================================
   2. SITE LAYOUT (Header, Footer, Main)
   ========================================= */
.site-header {
    background: var(--white);
    padding: 15px 40px;
    border-bottom: 4px solid var(--primary);
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}
.logo { font-family: var(--font-heading); font-weight: 700; font-size: 1.5rem; color: var(--primary); }

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 20px;
    width: 100%;
}

.page-title {
    font-family: var(--font-heading);
    color: var(--dark);
    font-size: 2.2rem;
    margin-bottom: 40px;
    text-align: center;
}

.site-footer {
    background: var(--dark);
    color: #ccc;
    padding: 20px;
    text-align: center;
    font-size: 0.9rem;
}

/* =========================================
   3. INTERACTIVE LOOP & HOTSPOTS
   ========================================= */
.interactive-container {
    position: relative;
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
}

.loop-image { width: 100%; height: auto; display: block; }

.hotspot {
    position: absolute;
    width: 10%;
    height: 14%;
    border-radius: 50%;
    cursor: pointer;
    z-index: 100;
    transform: translate(-50%, -50%);
    background-color: rgba(255, 255, 255, 0.01);
    transition: all 0.3s ease;
}

.hotspot:hover {
    background-color: rgba(95, 172, 34, 0.3);
    box-shadow: 0 0 20px rgba(95, 172, 34, 0.6);
    transform: translate(-50%, -50%) scale(1.15);
}

.instruction { margin-top: 20px; color: #999; font-style: italic; }

/* =========================================
   4. MODAL SYSTEM
   ========================================= */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(30, 33, 50, 0.85); backdrop-filter: blur(5px);
    display: none; justify-content: center; align-items: center; z-index: 2000;
}
.modal-overlay.active { display: flex; }

.modal-card {
    background: var(--white);
    width: 92%; max-width: 1000px; height: 80vh;
    border-radius: 16px;
    box-shadow: 0 30px 60px rgba(0,0,0,0.5);
    display: flex; flex-direction: column;
    overflow: hidden; position: relative;
}

.modal-header-strip { height: 8px; background: var(--primary); position: sticky; top: 0; z-index: 10; }

.close-btn {
    position: absolute; top: 20px; right: 20px;
    width: 40px; height: 40px;
    background: #f0f0f0; border: none; border-radius: 50%;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    font-size: 28px; color: var(--dark); transition: 0.2s; z-index: 20;
}
.close-btn:hover { background: #e0e0e0; color: var(--primary); transform: rotate(90deg); }

.modal-inner { padding: 40px; flex: 1; overflow-y: auto; }
.modal-title { 
    color: var(--primary); 
    font-family: var(--font-heading); 
    border-bottom: 2px solid #eee; 
    padding-bottom: 15px; padding-right: 50px; margin-top: 0; 
}

/* Stabilisierung des Inhaltsbereichs beim Tab-Wechsel */
#tab-content-area {
    min-height: 500px;
    display: flex; flex-direction: column;
    animation: fadeIn 0.2s ease-in-out;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* =========================================
   5. NAVIGATION (TABS)
   ========================================= */
.tab-navigation {
    display: flex; flex-wrap: wrap; gap: 8px;
    margin: 10px 40px 30px; padding: 8px;
    background: #f0f3f0; border-radius: 14px; border: 1px solid #e2e8e2;
}

.tab-button {
    flex: 1; min-width: 140px;
    background: transparent; border: none;
    padding: 12px 10px; border-radius: 10px;
    font-family: var(--font-heading); font-weight: 700; font-size: 0.95rem;
    cursor: pointer; color: #888;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
}

.tab-button:hover { color: var(--primary); background: rgba(255, 255, 255, 0.5); }
.tab-button.active {
    background: var(--white); color: var(--primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); transform: scale(1.02);
}
.tab-button[onclick*="safeguard"].active { color: #d9534f; }

/* =========================================
   6. GRID SYSTEM & BOXES (Core Layout)
   ========================================= */

/* Haupt-Raster */
.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    align-items: stretch; /* ZWINGT beide Spalten auf exakt dieselbe Höhe */
}

/* 1. STANDARD INFO-BOX (Ultra-Subtle Design) */
.info-box {
    background: #ffffff;
    
    /* Die Linie ist jetzt fast unsichtbar (nur 3% Schwarz),
       sie dient nur noch als ganz feine Abgrenzung zum Hintergrund */
    border: 1px solid rgba(0, 0, 0, 0.03); 
    
    /* Der Schatten ist sehr weich und hell */
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    
    /* WICHTIG: Damit füllt die Box immer die ganze Höhe der Grid-Zelle */
    height: 100%; 
    display: flex;
    flex-direction: column;
    justify-content: center; /* Inhalt vertikal mittig (optional) */
    
    padding: 25px;
    border-radius: 16px; /* Etwas runder wirkt organischer */
    margin-bottom: 25px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Hover: Box hebt sich sanft ab */
.info-box:hover { 
    transform: translateY(-4px); 
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.06);
    border-color: rgba(0, 0, 0, 0.05); /* Linie wird minimal dunkler */
}

/* Elemente über volle Breite */
.info-box.full { 
    grid-column: 1 / -1; 
    height: auto; /* Volle Boxen passen sich ihrem Inhalt an */
}

.box-label {
    display: block; font-size: 0.85rem; text-transform: uppercase;
    font-weight: 800; color: var(--primary); margin-bottom: 12px;
    letter-spacing: 0.5px; opacity: 0.9;
}

/* Bild-Box - Passt sich jetzt perfekt an */
.phase-image-box {
    width: 100%;
    height: 100%; /* Nimmt die Höhe der Nachbar-Box an! */
    min-height: 250px; /* Aber niemals kleiner als das hier */
    
    border-radius: 16px; /* Gleiche Rundung wie Boxen */
    overflow: hidden;
    
    /* Gleicher Stil wie die Textboxen für Symmetrie */
    border: 1px solid rgba(0, 0, 0, 0.03);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    
    /* Kein Aspect-Ratio mehr erzwingen, damit es sich der Textbox anpasst */
    /* aspect-ratio: 16 / 9; <-- GELÖSCHT */
    position: relative;
}

.phase-image-box img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Schneidet das Bild zu, damit keine Lücken entstehen */
    display: block;
    transition: transform 0.6s ease;
}
.phase-image-box img:hover { transform: scale(1.03); }


/* 2. ALERT-BOX (Muss sich unterscheiden) */
.info-box.alert-box {
    background-color: #fffbfc; 
    /* Rötliche Linie, aber auch sehr zart */
    border: 1px solid rgba(239, 68, 68, 0.2); 
    /* Der dicke Balken bleibt als Warnsignal */
    border-left: 5px solid #ef4444; 
    border-radius: 12px; /* Eckiger als die anderen, wirkt "strenger" */
}

.info-box.alert-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    border-left-color: #ef4444; /* Fixiert den roten Balken */
}


/* =========================================
   7. TYPOGRAFIE & INHALTE
   ========================================= */
.box-content {
    line-height: 1.5; font-size: 0.95rem;
    color: #2c3e50; padding-top: 5px;
}
.box-content p { margin-bottom: 0.8rem; }

/* Listen-Styling */
.box-content ul {
    list-style: none; padding-left: 5px;
    margin-top: 0.2rem; margin-bottom: 1rem;
}
.box-content li {
    position: relative; padding-left: 25px;
    margin-bottom: 0.3rem; line-height: 1.4;
}
.box-content li::before {
    content: ""; position: absolute; left: 0; top: 8px;
    width: 8px; height: 8px;
    background-color: var(--primary); border-radius: 2px;
}

/* Links */
.box-content ul li a {
    text-decoration: none; color: var(--primary);
    font-weight: 600; padding: 2px 5px;
    border-radius: 4px; transition: all 0.2s ease;
    display: inline-block;
}
.box-content ul li a:hover {
    background-color: var(--primary-light);
    color: var(--dark); transform: translateX(3px);
}
.box-content ul li a::after { content: " ↗"; font-size: 0.8rem; opacity: 0.6; }
.box-content ul li a[href$=".pdf"]::before { content: "📄 "; }

/* Prompt Cards */
.prompt-card {
    background-color: #fff9e6; border-left: 4px solid #f1c40f;
    padding: 15px; border-radius: 6px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.85rem; color: #444; line-height: 1.5;
    margin-top: 10px; box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

/* Checklisten (Div-Struktur aus JS) */
.box-content > div > div { margin-bottom: 6px !important; line-height: 1.4; }
.box-content span[style*="border: 2px solid"] { margin-top: 3px !important; }

/* Video Container */
.video-container {
    background: var(--dark); aspect-ratio: 16/9;
    display: flex; align-items: center; justify-content: center;
    color: #fff; border-radius: 8px; margin-top: 10px;
    border: 2px solid var(--primary);
}

/* =========================================
   8. KOMPETENZ-KARTEN
   ========================================= */
.comp-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px; margin-top: 15px;
}

.comp-card {
    background: #ffffff; border: 2px solid #eef2ee;
    border-radius: 14px; padding: 20px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    display: flex; flex-direction: column;
    transition: transform 0.2s ease;
    border-top-width: 10px; /* Farbiger Balken oben */
}
.comp-card:hover { transform: translateY(-3px); box-shadow: 0 6px 15px rgba(0,0,0,0.1); }

.comp-badge {
    display: inline-block; align-self: flex-start;
    padding: 5px 12px; border-radius: 8px;
    font-size: 0.75rem; font-weight: 800;
    text-transform: uppercase; margin-bottom: 12px;
    color: #ffffff; letter-spacing: 0.5px;
}

/* Farb-Zuweisung */
.comp-card.verstehen { border-top-color: var(--color-verstehen); }
.verstehen .comp-badge { background-color: var(--color-verstehen); }

.comp-card.verantworten { border-top-color: var(--color-verantworten); }
.verantworten .comp-badge { background-color: var(--color-verantworten); }

.comp-card.zusammenarbeiten { border-top-color: var(--color-zusammenarbeiten); }
.zusammenarbeiten .comp-badge { background-color: var(--color-zusammenarbeiten); }

.comp-card.anwenden { border-top-color: var(--color-anwenden); }
.anwenden .comp-badge { background-color: var(--color-anwenden); }

.comp-card.gestalten { border-top-color: var(--color-gestalten); }
.gestalten .comp-badge { background-color: var(--color-gestalten); }

.comp-card.evaluieren { border-top-color: var(--color-evaluieren); }
.evaluieren .comp-badge { background-color: var(--color-evaluieren); }

/* =========================================
   9. RESPONSIVE DESIGN (Mobile)
   ========================================= */
@media (max-width: 768px) {
    .info-grid { grid-template-columns: 1fr; } /* Stack everything */
    .info-box.full { grid-column: span 1; }
    
    .hotspot { width: 14%; height: 14%; }
    
    #tab-content-area { min-height: 300px; }
    .modal-card { height: 90vh; width: 95%; }
    
    .tab-navigation {
        display: grid;
        grid-template-columns: 1fr 1fr; /* 2x2 Tabs */
        margin: 10px 20px 20px;
    }
    .tab-button { min-width: auto; font-size: 0.85rem; }
    
    /* Bild auf dem Handy nicht so hoch */
    .phase-image-box { aspect-ratio: auto; height: 200px; }
}