/* =========================================================
   n8nTools – Weihnachts-UI + Login VARIANTE B
   Kombiniert: altes schönes Login-Design + neues Branding
   ========================================================= */

/* --------------------
   Grund-Variablen
-------------------- */
:root {
    --bg-dark: #020617;
    --bg-card: rgba(15, 23, 42, 0.96);
    --bg-card-soft: rgba(15, 23, 42, 0.9);
    --border-soft: rgba(148, 163, 184, 0.6);
    --text-main: #f9fafb;
    --text-muted: #9ca3af;
    --accent-gold: #facc15;
    --accent-green: #22c55e;
    --accent-red: #ef4444;
    --accent-blue: #60a5fa;
    --radius-lg: 20px;
}

/* Reset */
* {
    box-sizing: border-box;
}
html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: system-ui, sans-serif;
    color: var(--text-main);
}

/* --------------------
   Hintergrund (Weihnachts-Design)
-------------------- */
body {
    min-height: 100vh;
    background:
        radial-gradient(circle at 20% 100%, rgba(239, 68, 68, 0.55), transparent 55%),
        radial-gradient(circle at 50% 100%, rgba(234, 179, 8, 0.55), transparent 55%),
        radial-gradient(circle at 80% 100%, rgba(34, 197, 94, 0.55), transparent 55%),
        radial-gradient(circle at 0% 0%, rgba(220, 38, 38, 0.25), transparent 60%),
        radial-gradient(circle at 100% 0%, rgba(34, 197, 94, 0.25), transparent 60%),
        linear-gradient(180deg, #020617 0%, #02131f 40%, #020617 100%);
    background-size: 220% 220%;
    animation: bg-move 28s ease-in-out infinite;
    overflow-x: hidden;
}

@keyframes bg-move {
    0% { background-position: 0% 0%; }
    50% { background-position: 100% 100%; }
    100% { background-position: 0% 0%; }
}

/* Schnee */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        radial-gradient(2px 2px at 10% 20%, rgba(248,250,252,0.9) 50%, transparent 50%),
        radial-gradient(2px 2px at 80% 30%, rgba(248,250,252,0.8) 50%, transparent 50%),
        radial-gradient(2px 2px at 50% 80%, rgba(248,250,252,0.8) 50%, transparent 50%),
        radial-gradient(1.5px 1.5px at 20% 70%, rgba(248,250,252,0.7) 50%, transparent 50%),
        radial-gradient(1.5px 1.5px at 60% 10%, rgba(248,250,252,0.7) 50%, transparent 50%);
    background-size: 200px 200px, 260px 260px, 220px 220px, 180px 180px, 240px 240px;
    animation:
        snow-fall 18s linear infinite,
        snow-twinkle 3s ease-in-out infinite;
    z-index: -1;
}

@keyframes snow-fall { 
    0% { transform: translateY(-12px); }
    100% { transform: translateY(12px); }
}

@keyframes snow-twinkle { 
    0% { opacity: 0.3; }
    50% { opacity: 0.9; }
    100% { opacity: 0.3; }
}

/* --------------------
   Page Shell
-------------------- */
.page-shell {
    max-width: 1180px;
    margin: 0 auto;
    padding: 24px 16px 40px;
}

/* =========================================================
   LOGIN-BEREICH – VARIANTE B
========================================================= */

.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* Login-Karte – alter Look */
.login-card {
    width: 100%;
    max-width: 480px;
    padding: 30px 26px;
    border-radius: 32px;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.18);
    box-shadow:
        0 10px 40px rgba(0,0,0,0.7),
        0 0 35px rgba(0,255,100,0.25);
    animation: loginGlow 6s ease-in-out infinite;
}

@keyframes loginGlow {
    0% { box-shadow:0 10px 40px rgba(0,0,0,0.7), 0 0 20px rgba(0,255,100,0.2); }
    50% { box-shadow:0 14px 46px rgba(0,0,0,0.8), 0 0 40px rgba(0,255,100,0.45); }
    100% { box-shadow:0 10px 40px rgba(0,0,0,0.7), 0 0 20px rgba(0,255,100,0.2); }
}

/* Branding oben */
.brand-title {
    text-align: center;
    font-size: 2.1rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    color: #fef9c3;
    text-shadow:
        0 0 12px rgba(255,255,200,0.85),
        0 0 30px rgba(34,197,94,0.65);
}

.brand-title span {
    color: #22c55e;
}

.brand-subtitle {
    text-align: center;
    margin-top: -6px;
    font-size: 1rem;
    color: #d1d5db;
}

/* Login-Schrift */
.login-title {
    margin-top: 14px;
    text-align: center;
    font-size: 1.7rem;
    font-weight: 700;
}

.login-text {
    text-align: center;
    font-size: 0.95rem;
    margin-bottom: 16px;
    color: #cbd5e1;
}

/* Input-Felder */
.field-group {
    margin-bottom: 12px;
}

.field-group label {
    display: block;
    margin-bottom: 6px;
    color: #e5e7eb;
    font-size: 0.9rem;
}

.field-group input {
    width: 100%;
    padding: 13px 14px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.2);
    background: rgba(0,0,0,0.28);
    color: white;
    font-size: 1rem;
    outline: none;
    transition: 0.2s;
}

.field-group input:focus {
    border-color: #4ade80;
    box-shadow: 0 0 12px rgba(74,222,128,0.5);
}

/* Login-Button */
.btn-login {
    width: 100%;
    padding: 14px;
    margin-top: 8px;
    font-size: 1.1rem;
    font-weight: 700;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    color: #fff;

    background: linear-gradient(90deg, #16a34a, #22c55e);
    box-shadow:
        0 8px 30px rgba(34,197,94,0.45),
        0 0 20px rgba(34,197,94,0.6);
    transition: 0.25s;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow:
        0 12px 36px rgba(34,197,94,0.55),
        0 0 24px rgba(34,197,94,0.75);
}

/* Fehlermeldung */
.error-box {
    background: rgba(150,0,0,0.5);
    border: 1px solid rgba(255,120,120,0.8);
    padding: 10px;
    border-radius: 12px;
    color: #ffe2e2;
    margin-bottom: 12px;
    text-align: center;
}

.login-meta {
    margin-top: 18px;
    text-align: center;
    color: #9ca3af;
    font-size: 0.85rem;
}

/* Designer-Branding unten rechts */
.branding-login {
    position: fixed;
    bottom: 16px;
    right: 16px;
    z-index: 9999;
}
.branding-login img {
    width: 92px;
    opacity: 0.9;
    transition: 0.2s;
}
.branding-login:hover img {
    opacity: 1;
    transform: scale(1.05);
}

/* =========================================================
   REST DES SYSTEMS (DASHBOARD, PANELS, BUTTONS, TABELLEN)
========================================================= */

/* Header */
.app-header {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.app-title {
    font-size: 1.6rem;
    font-weight: 800;
    text-transform: uppercase;
}

.header-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* Header-Buttons (Archiv, Admin, Logout) */
.btn-pill {
    padding: 6px 14px;
    background: rgba(15,23,42,0.93);
    border: 1px solid rgba(148,163,184,0.8);
    color: white;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 600;
}

.btn-pill--danger {
    background: linear-gradient(135deg, #b91c1c, #ef4444);
    border-color: #f87171;
}

/* Panels */
.panel {
    background: var(--bg-card-soft);
    padding: 18px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-soft);
    margin-top: 20px;
}

.panel-title {
    font-size: 1rem;
    margin-bottom: 10px;
    font-weight: 700;
}

/* Tabellen */
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

th, td {
    padding: 8px;
}

thead th { background: rgba(15,23,42,0.9); }
tbody tr:nth-child(odd)  { background:rgba(15,23,42,0.85); }
tbody tr:nth-child(even) { background:rgba(30,41,59,0.85); }

/* ---------- Aktions-Buttons in den Tabellen (PDF / 7-Tage / Diagramm) ---------- */

.action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.btn-details,
.btn-download {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid transparent;
    cursor: pointer;
}

/* z.B. "Diagramm" */
.btn-details {
    background: linear-gradient(135deg, #1d4ed8, #3b82f6);
    border-color: rgba(191, 219, 254, 1);
    color: #eff6ff;
    box-shadow: 0 0 10px rgba(59,130,246,0.45);
}

/* z.B. "PDF" / "7-Tage" */
.btn-download {
    background: linear-gradient(135deg, #0369a1, #0ea5e9);
    border-color: rgba(125, 211, 252, 1);
    color: #f0f9ff;
    box-shadow: 0 0 10px rgba(14,165,233,0.45);
}

.btn-details:hover,
.btn-download:hover {
    transform: translateY(-1px);
    box-shadow: 0 0 14px rgba(59,130,246,0.6);
}

/* =========================================================
   Handy Optimierung (Login & Buttons)
========================================================= */

@media (max-width: 640px) {

    .login-card {
        padding: 26px 20px;
        border-radius: 26px;
    }

    .brand-title {
        font-size: 1.8rem;
    }

    .field-group input {
        font-size: 0.95rem;
        padding: 12px;
    }

    .btn-login {
        font-size: 1rem;
        padding: 12px;
    }

    .branding-login img {
        width: 72px;
    }

    /* Header-Buttons schön über die ganze Breite verteilen */
    .header-actions {
        width: 100%;
        gap: 6px;
    }
    .header-actions .btn-pill {
        flex: 1 1 100%;
        text-align: center;
    }

    /* Aktions-Buttons bei wenig Platz ggf. untereinander */
    .action-buttons {
        flex-direction: column;
        align-items: stretch;
    }
    .btn-details,
    .btn-download {
        width: 100%;
        text-align: center;
    }
}