/* ================================================
   Startseiten-spezifische Styles (index.php)
   ================================================ */

/* ------------------------------------------------
   1. Scroll-Animations-Basisklassen
   ------------------------------------------------ */
.animate-on-scroll {
    opacity: 0;
    transform: translate(0, 40px);
    transition: opacity 0.65s ease, transform 0.65s ease;
}

/* Richtungs-Modifier — VOR .is-visible, damit .is-visible Priorität hat */
.animate-on-scroll.animate-from-left  { transform: translate(-50px, 0); }
.animate-on-scroll.animate-from-right { transform: translate(50px, 0); }

.animate-on-scroll.is-visible {
    opacity: 1;
    transform: translate(0, 0);
}

/* Gestaffelte Verzögerungen für Karten in einer Reihe */
.animate-on-scroll:nth-child(2) { transition-delay: 0.1s; }
.animate-on-scroll:nth-child(3) { transition-delay: 0.2s; }
.animate-on-scroll:nth-child(4) { transition-delay: 0.3s; }

@media (prefers-reduced-motion: reduce) {
    .animate-on-scroll {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

/* ------------------------------------------------
   2. Hero-Einblend-Animation beim Seitenaufruf
   ------------------------------------------------ */
@keyframes heroFadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

.hero h1          { animation: heroFadeIn 0.8s ease 0.1s both; }
.hero .lead       { animation: heroFadeIn 0.8s ease 0.3s both; }
.hero .intro-text { animation: heroFadeIn 0.8s ease 0.5s both; }

/* ------------------------------------------------
   3. Floating-Animation der Hintergrundsymbole
   ------------------------------------------------ */
@keyframes floatSymbol {
    0%, 100% { transform: translateY(0) rotate(var(--rot)); }
    50%       { transform: translateY(-12px) rotate(var(--rot)); }
}

.hero-bg-1 { --rot: -12deg; animation: floatSymbol 6s ease-in-out infinite; }
.hero-bg-2 { --rot:  18deg; animation: floatSymbol 8s ease-in-out infinite 1s; }
.hero-bg-3 { --rot:  10deg; animation: floatSymbol 7s ease-in-out infinite 2s; }
.hero-bg-4 { --rot:  -8deg; animation: floatSymbol 9s ease-in-out infinite 0.5s; }

@media (prefers-reduced-motion: reduce) {
    .hero-bg-1,
    .hero-bg-2,
    .hero-bg-3,
    .hero-bg-4 { animation: none; }
}

/* ------------------------------------------------
   4. Farbige Icon-Bereiche pro Fachbereich
   ------------------------------------------------ */

/* Mathematik: Kornblumenblau → Marineblau */
.math-card .card-icon {
    background: linear-gradient(135deg, #4a90d9 0%, #1e3c72 100%);
    color: white;
}

/* Chemie: Cyan-Blau → Tiefes Marineblau */
.chemistry-card .card-icon {
    background: linear-gradient(135deg, #0099cc 0%, #154360 100%);
    color: white;
}

/* Wiederholungen: Indigoblau → Marineblau */
.lottery-card .card-icon {
    background: linear-gradient(135deg, #5c6bc0 0%, #1e3c72 100%);
    color: white;
}

/* ------------------------------------------------
   5. Farbiger Top-Border beim Hover
   ------------------------------------------------ */
.topic-card { border-top: 3px solid transparent; }

.math-card:hover      { border-top-color: #2a5298; }
.chemistry-card:hover { border-top-color: #0099cc; }
.lottery-card:hover   { border-top-color: #5c6bc0; }

/* ------------------------------------------------
   6. Abschnitts-Headings
   ------------------------------------------------ */
.section-group-heading {
    color: var(--primary-blue);
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: 0.25rem;
}

.section-group-hr {
    border-color: var(--lighter-blue);
    margin-top: 0.25rem;
    margin-bottom: 0;
    transform-origin: left center;
    transform: scaleX(0);
    transition: transform 0.5s ease 0.3s;
}

.animate-on-scroll.is-visible .section-group-hr {
    transform: scaleX(1);
}

/* ------------------------------------------------
   7. Karten-Text-Größe
   ------------------------------------------------ */
.topic-card .card-text {
    font-size: 0.9rem;
}

/* ------------------------------------------------
   8. Klassen-Badge im Icon-Bereich
   ------------------------------------------------ */
.card-icon { position: relative; }

.card-badge {
    position: absolute;
    top: 0.5rem;
    right: 0.65rem;
    font-size: 0.65rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.25);
    color: white;
    padding: 0.15rem 0.5rem;
    border-radius: 20px;
    letter-spacing: 0.04em;
}

/* ------------------------------------------------
   8. Icon-Dreh-Animation beim Einblenden
   ------------------------------------------------ */
@keyframes iconSpin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

.animate-on-scroll.is-visible .card-icon i {
    animation: iconSpin 0.65s ease-out 0.2s both;
}

@media (prefers-reduced-motion: reduce) {
    .animate-on-scroll.is-visible .card-icon i {
        animation: none;
    }
}

/* ------------------------------------------------
   9. Pfeil-Animation im Card-Link
   ------------------------------------------------ */
.card-link-arrow {
    display: inline-block;
    transition: transform 0.25s ease;
}

.card-link:hover .card-link-arrow {
    transform: translateX(5px);
}
