/* =========================================================================
   main.css
   Zentrale Styles für die Webseite: Navigation, Footer, Hero, Sektionen,
   Buttons, Animationen (Glassmorphism, responsiv via Grid/Flexbox).

   Rechtliche Seiten (Impressum/Datenschutz/Anleitung) kombinieren diese
   Datei mit legal.css. Das Overlay (overlay.html) nutzt overlay.css.
   ========================================================================= */

/* ---- Design-Tokens ------------------------------------------------------- */
:root {
    --accent: #ff416c;
    --accent-2: #ff4b2b;
    --accent-blue: #5b7cff;
    --text: #f3f3f5;
    --text-muted: #b9bcc7;
    --glass-bg: rgba(255, 255, 255, 0.07);
    --glass-bg-strong: rgba(255, 255, 255, 0.12);
    --glass-border: rgba(255, 255, 255, 0.16);
    --max-width: 1100px;
    --radius: 20px;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
    --gradient: linear-gradient(135deg, var(--accent), var(--accent-2));
    --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* ---- Reset --------------------------------------------------------------- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    font-family: var(--font);
    color: var(--text);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;

    /* Animierter Verlauf-Hintergrund */
    background:
        radial-gradient(circle at 15% 20%, rgba(255, 65, 108, 0.30), transparent 45%),
        radial-gradient(circle at 85% 10%, rgba(91, 124, 255, 0.28), transparent 42%),
        radial-gradient(circle at 50% 100%, rgba(255, 75, 43, 0.22), transparent 50%),
        linear-gradient(135deg, #1b1d2a, #0d0f17);
    background-attachment: fixed;
}

/* Sanft bewegter Hintergrund (zwei animierte Schichten) */
body::before,
body::after {
    content: "";
    position: fixed;
    inset: -30%;
    z-index: -1;
    pointer-events: none;
    background: radial-gradient(circle at 30% 30%, rgba(255, 65, 108, 0.18), transparent 40%);
    animation: drift 18s ease-in-out infinite alternate;
}

body::after {
    background: radial-gradient(circle at 70% 70%, rgba(91, 124, 255, 0.16), transparent 40%);
    animation-duration: 24s;
    animation-direction: alternate-reverse;
}

@keyframes drift {
    0%   { transform: translate(0, 0) scale(1); }
    100% { transform: translate(4%, -4%) scale(1.1); }
}

/* ---- Gemeinsame Layout-Helfer ------------------------------------------- */
.container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 22px;
}

.section {
    padding: 72px 0;
}

.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

/* ---- Navigation ---------------------------------------------------------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
    border-bottom: 1px solid transparent;
}

.site-header.scrolled {
    background: rgba(13, 15, 23, 0.65);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom-color: var(--glass-border);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 68px;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 22px;
}

.nav__brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text);
    text-decoration: none;
    letter-spacing: 0.4px;
}

.nav__brand img {
    width: 34px;
    height: 34px;
    border-radius: 9px;
}

.nav__links {
    display: flex;
    align-items: center;
    gap: 6px;
    list-style: none;
}

.nav__links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.95rem;
    padding: 8px 14px;
    border-radius: 12px;
    transition: color 0.2s ease, background 0.2s ease;
}

.nav__links a:hover {
    color: var(--text);
    background: var(--glass-bg);
}

.nav__links a.active {
    color: #fff;
    background: var(--gradient);
    box-shadow: 0 0 16px rgba(255, 65, 108, 0.45);
}

/* Hamburger (mobil) */
.nav__toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: 0;
    cursor: pointer;
    padding: 8px;
}

.nav__toggle span {
    width: 24px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* ---- Buttons ------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 22px;
    border-radius: 14px;
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid transparent;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn--primary {
    background: var(--gradient);
    color: #fff;
    box-shadow: 0 6px 20px rgba(255, 65, 108, 0.35);
}

.btn--primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(255, 65, 108, 0.5);
}

.btn--ghost {
    background: var(--glass-bg);
    border-color: var(--glass-border);
    color: var(--text);
}

.btn--ghost:hover {
    background: var(--glass-bg-strong);
    transform: translateY(-2px);
}

/* ---- Hero ---------------------------------------------------------------- */
.hero {
    padding: 96px 0 64px;
    text-align: center;
}

.hero__eyebrow {
    display: inline-block;
    font-size: 0.8rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--accent);
    padding: 6px 14px;
    border: 1px solid var(--glass-border);
    border-radius: 50px;
    background: var(--glass-bg);
    margin-bottom: 22px;
}

.hero__title {
    font-size: clamp(2.2rem, 6vw, 4rem);
    line-height: 1.1;
    font-weight: 800;
    margin-bottom: 18px;
}

.hero__title .grad {
    background: var(--gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero__subtitle {
    max-width: 620px;
    margin: 0 auto 30px;
    color: var(--text-muted);
    font-size: 1.05rem;
}

.hero__actions {
    display: flex;
    gap: 14px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Live-Demo-Karte im Hero */
.hero__demo {
    margin: 56px auto 0;
    max-width: 360px;
    padding: 22px;
}

/* ---- Feature-Grid -------------------------------------------------------- */
.grid {
    display: grid;
    gap: 22px;
}

.grid--3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid--2 {
    grid-template-columns: repeat(2, 1fr);
}

.section__title {
    font-size: clamp(1.6rem, 4vw, 2.4rem);
    text-align: center;
    margin-bottom: 10px;
}

.section__lead {
    text-align: center;
    color: var(--text-muted);
    max-width: 620px;
    margin: 0 auto 44px;
}

.card {
    padding: 28px;
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-6px);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.45);
}

.card__icon {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: var(--gradient);
    font-size: 1.5rem;
    margin-bottom: 16px;
    box-shadow: 0 6px 18px rgba(255, 65, 108, 0.35);
}

.card h3 {
    font-size: 1.2rem;
    margin-bottom: 8px;
}

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

/* ---- Login / Auth -------------------------------------------------------- */
.auth-gate {
    margin: 26px 0 8px;
    text-align: center;
}

.btn--roblox {
    background: linear-gradient(135deg, #00a2ff, #0066ff);
    color: #fff;
    box-shadow: 0 6px 20px rgba(0, 120, 255, 0.35);
    width: 100%;
    justify-content: center;
}

.btn--roblox:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(0, 120, 255, 0.5);
}

.btn--roblox__icon {
    font-size: 1.05rem;
}

.auth-note {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 14px;
}

.auth-panel {
    margin: 26px 0 8px;
}

.connected-pill {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 50px;
    background: rgba(0, 200, 120, 0.15);
    border: 1px solid rgba(0, 200, 120, 0.4);
    color: #7ff0b0;
    font-size: 0.9rem;
    margin-bottom: 14px;
}

.auth-info {
    color: var(--text-muted);
    margin-bottom: 18px;
}

.auth-info code {
    color: var(--text);
    background: rgba(255, 255, 255, 0.08);
    padding: 2px 8px;
    border-radius: 6px;
}

.auth-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.trust-list {
    list-style: none;
    padding: 0;
    margin: 14px 0 0;
    display: grid;
    gap: 12px;
}

.trust-list li {
    color: var(--text-muted);
    line-height: 1.5;
}

.trust-list strong {
    color: var(--text);
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-muted);
    font-size: 0.8rem;
    margin: 22px 0;
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--glass-border);
}

.auth-form {
    display: grid;
    gap: 12px;
}

.auth-input {
    width: 100%;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.auth-input::placeholder { color: #8b8f9c; }

.auth-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(255, 65, 108, 0.2);
}

.auth-hint {
    color: var(--text-muted);
    font-size: 0.78rem;
    margin-top: 14px;
}

.auth-error {
    margin-top: 18px;
    padding: 12px 16px;
    border-radius: 12px;
    background: rgba(255, 65, 108, 0.12);
    border: 1px solid rgba(255, 65, 108, 0.4);
    color: #ff9bb2;
    font-size: 0.88rem;
}

/* ---- Footer -------------------------------------------------------------- */
.site-footer {
    margin-top: auto;
    padding: 40px 0 28px;
    border-top: 1px solid var(--glass-border);
    background: rgba(0, 0, 0, 0.30);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.footer__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.footer__brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
}

.footer__brand img {
    width: 30px;
    height: 30px;
    border-radius: 8px;
}

.footer__links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
    list-style: none;
}

.footer__links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
}

.footer__links a:hover {
    color: var(--text);
}

.footer__copy {
    width: 100%;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.82rem;
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid var(--glass-border);
}

/* ---- Overlay-Komponenten (Live-Demo auf der Startseite) ----------------- */
/* Gleiche Optik wie im echten Overlay, damit die Demo identisch wirkt. */
.live-badge {
    display: none;
    background: var(--gradient);
    padding: 5px 12px;
    border-radius: 50px;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.75rem;
    margin-bottom: 15px;
    text-align: center;
    letter-spacing: 0.5px;
    box-shadow: 0 0 18px rgba(255, 65, 108, 0.6);
    animation: pulse 1.6s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 18px rgba(255, 65, 108, 0.55); }
    50%      { box-shadow: 0 0 28px rgba(255, 65, 108, 0.9); }
}

.camera-preview {
    width: 100%;
    height: 170px;
    background: #111;
    border-radius: 12px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #333;
    margin-top: 10px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.camera-preview::after {
    content: "KAMERA-FEED WARTET...";
    color: #555;
    font-size: 0.8rem;
    letter-spacing: 1px;
}

.camera-preview.is-live {
    border-color: var(--accent);
    box-shadow: 0 0 20px rgba(255, 65, 108, 0.45);
}

.info {
    font-size: 0.8rem;
    margin-top: 10px;
    color: var(--text-muted);
    min-height: 1.2em;
    text-align: center;
}

/* Lade-Animation der Demo */
.loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 24px 0;
}

.loader.is-hidden { display: none; }

.spinner {
    width: 38px;
    height: 38px;
    border: 4px solid rgba(255, 255, 255, 0.18);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
}

.loader__text {
    font-size: 0.78rem;
    color: var(--text-muted);
}

@keyframes spin { to { transform: rotate(360deg); } }

.content.is-hidden { display: none; }

/* ---- Scroll-Reveal-Animation -------------------------------------------- */
.reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.is-visible {
    opacity: 1;
    transform: none;
}

/* Verzögerungen für gestaffelte Animation */
.reveal.d1 { transition-delay: 0.08s; }
.reveal.d2 { transition-delay: 0.16s; }
.reveal.d3 { transition-delay: 0.24s; }

/* ---- Responsiv ----------------------------------------------------------- */
@media (max-width: 820px) {
    .grid--3 { grid-template-columns: 1fr; }
    .grid--2 { grid-template-columns: 1fr; }

    .nav__toggle { display: flex; }

    .nav__links {
        position: absolute;
        top: 68px;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
        padding: 14px 22px 22px;
        background: rgba(13, 15, 23, 0.95);
        backdrop-filter: blur(14px);
        -webkit-backdrop-filter: blur(14px);
        border-bottom: 1px solid var(--glass-border);
        transform: translateY(-12px);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.25s ease, transform 0.25s ease;
    }

    .nav__links.open {
        transform: none;
        opacity: 1;
        pointer-events: auto;
    }

    .nav__links a {
        padding: 12px 14px;
    }
}

/* ---- Reduzierte Bewegung respektieren ------------------------------------ */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }

    .reveal {
        opacity: 1;
        transform: none;
    }
}
