/* * 68DEINS! Corporate Design System v9.1 (Polished Dark Mode & Fixes) */

/* --- VARIABLEN --- */
:root {
    /* Brand Colors */
    --c-magenta: #E20074; 
    --c-magenta-hover: #b0005a;
    --c-orange: #F39200; 
    --c-cyan: #009FE3; 
    --c-blue: #003063;
    
    /* Dimensions */
    --nav-w-desktop: 260px;
    --nav-w-collapsed: 80px;
    --content-max-w: 1200px;
    
    /* Spacing & Radius */
    --radius-l: 24px;
    --radius-m: 16px;
    --radius-s: 12px;
    --gap: 24px;
    
    /* Light Mode */
    --c-bg: #F2F4F7;
    --c-card: #FFFFFF;
    --c-text: #111827;
    --c-muted: #6B7280;
    --c-border: #E5E7EB;
    --c-hover: #F9FAFB;
    --c-nav-bg: rgba(255, 255, 255, 0.85); /* Glass */
    --c-cal-grid: #E5E7EB;
    --c-cal-bg: #FFFFFF;
    
    /* Shadows - Soft & Modern */
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.04);
    --shadow-float: 0 12px 40px -8px rgba(0,0,0,0.12), 0 4px 12px -4px rgba(0,0,0,0.08);
    --shadow-nav: 0 8px 32px rgba(0,0,0,0.08);
    
    /* Transitions */
    --ease-elastic: cubic-bezier(0.175, 0.885, 0.32, 1.275);
    --ease-smooth: cubic-bezier(0.16, 1, 0.3, 1);
}

/* Dark Mode Overrides */
body.dark-mode {
    --c-bg: #0B0D11;
    --c-card: #15191F;
    --c-text: #EDF2F7;
    --c-muted: #94A3B8;
    --c-border: #272B36;
    --c-hover: #1E232B;
    --c-nav-bg: rgba(21, 25, 31, 0.85);
    --c-cal-grid: #272B36;
    --c-cal-bg: #15191F;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.2);
    --shadow-float: 0 12px 40px -8px rgba(0,0,0,0.4);
    --shadow-nav: 0 8px 32px rgba(0,0,0,0.4);
}

/* --- BASE --- */
body {
    background-color: var(--c-bg);
    color: var(--c-text);
    font-family: 'Kievit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    margin: 0; padding: 0;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* --- LAYOUT STRUCTURE --- */
.app-container {
    display: flex;
    min-height: 100vh;
    padding: var(--gap);
    box-sizing: border-box;
    gap: var(--gap);
}

/* --- FLOATING NAVIGATION (DESKTOP) --- */
.sidebar {
    position: fixed;
    left: var(--gap);
    top: var(--gap);
    bottom: var(--gap);
    width: var(--nav-w-desktop); /* Standard expanded on large screens */
    background: var(--c-nav-bg);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border-radius: var(--radius-l);
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: var(--shadow-nav);
    z-index: 100;
    display: flex;
    flex-direction: column;
    padding: 30px 20px;
    box-sizing: border-box;
    transition: width 0.4s var(--ease-smooth);
}

/* Logo */
.brand-section {
    margin-bottom: 40px;
    padding: 0 10px;
}
.brand-logo {
    font-size: 2rem;
    font-weight: 900;
    letter-spacing: -1px;
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--c-text);
}
.brand-logo span:first-child { color: var(--c-magenta); }

/* Nav Links */
.nav-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    border-radius: var(--radius-m);
    color: var(--c-muted);
    text-decoration: none;
    font-weight: 600;
    font-size: 1.05rem;
    transition: all 0.2s var(--ease-smooth);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.nav-item:hover {
    background: var(--c-hover);
    color: var(--c-text);
    transform: translateX(4px);
}

/* Active State - Light Mode */
.nav-item.active {
    background: var(--c-text); 
    color: var(--c-bg); 
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transform: translateX(4px);
}

/* Active State - Dark Mode FIX */
body.dark-mode .nav-item.active {
    background: rgba(226, 0, 116, 0.15); /* Transparenter Magenta Hintergrund */
    color: var(--c-magenta); /* Magenta Text */
    border: 1px solid rgba(226, 0, 116, 0.3);
    box-shadow: 0 4px 15px rgba(226, 0, 116, 0.1);
}

.nav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
}
.nav-label {
    margin-left: 16px;
    white-space: nowrap;
}

/* --- MAIN CONTENT AREA --- */
.main-content {
    margin-left: calc(var(--nav-w-desktop) + var(--gap)); /* Space for fixed nav */
    flex: 1;
    width: 100%;
    max-width: var(--content-max-w);
    transition: margin 0.4s var(--ease-smooth);
}

/* Page Header */
.page-header-actions {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 40px;
}
h1 { font-size: 2.5rem; font-weight: 800; letter-spacing: -0.03em; margin: 0; line-height: 1.1; }
p { font-size: 1.1rem; color: var(--c-muted); margin: 8px 0 0 0; }

/* --- CONTENT GRID (Polls & Sidebar) --- */
.polls-wrapper {
    display: grid;
    grid-template-columns: 1fr 360px; /* Breite Sidebar rechts */
    gap: var(--gap);
    align-items: start;
}

/* --- CARDS --- */
.card {
    background: var(--c-card);
    border-radius: var(--radius-l);
    padding: 32px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--c-border);
    margin-bottom: 24px;
    position: relative;
    transition: transform 0.3s var(--ease-smooth), box-shadow 0.3s var(--ease-smooth);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-float);
    border-color: rgba(226, 0, 116, 0.2);
}

/* Pinned Special Style */
.card.pinned {
    background: linear-gradient(135deg, rgba(243, 146, 0, 0.05) 0%, var(--c-card) 100%);
    border: 1px solid rgba(243, 146, 0, 0.3);
}

/* PIN BADGE FIX: Overlapping Left Edge */
.pin-badge {
    position: absolute;
    top: 20px; 
    left: -10px; /* Raus aus der Box nach links */
    right: auto;
    background: var(--c-orange);
    color: white;
    font-size: 0.75rem;
    font-weight: 800;
    padding: 6px 12px;
    border-radius: 4px 12px 12px 4px; /* Tag-Form */
    display: flex; align-items: center; gap: 6px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    box-shadow: 2px 4px 8px rgba(0,0,0,0.15);
    z-index: 10;
}
.pin-badge::after {
    /* Kleines Dreieck für den 3D Effekt an der Kante */
    content: '';
    position: absolute;
    left: 0;
    bottom: -6px;
    width: 0;
    height: 0;
    border-top: 6px solid #c27500; /* Dunkleres Orange */
    border-left: 10px solid transparent;
}

/* --- VOTING UI --- */
.vote-option {
    background: var(--c-hover);
    border: 2px solid transparent;
    border-radius: var(--radius-m);
    padding: 16px 20px;
    margin-bottom: 12px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.2s;
}
.vote-option:hover {
    background: var(--c-card);
    border-color: var(--c-magenta);
    box-shadow: 0 4px 12px rgba(226, 0, 116, 0.1);
}

.vote-progress {
    position: absolute; left: 0; top: 0; bottom: 0;
    background: rgba(226, 0, 116, 0.08);
    z-index: 0;
    transition: width 0.8s var(--ease-elastic);
    border-right: 2px solid rgba(226, 0, 116, 0.1);
}

.vote-content {
    position: relative; z-index: 1;
    display: flex; justify-content: space-between; align-items: center;
    font-weight: 600; font-size: 1rem;
}
.vote-content span:last-child {
    font-family: monospace; font-weight: 700; color: var(--c-magenta);
}

.voters-list {
    margin-top: 20px; padding-top: 20px;
    border-top: 1px solid var(--c-border);
    display: flex; flex-wrap: wrap; gap: 8px;
}
.voter-tag {
    background: var(--c-hover);
    border: 1px solid var(--c-border);
    padding: 4px 10px; border-radius: 8px;
    font-size: 0.8rem; color: var(--c-muted);
    font-weight: 500;
}

/* --- UPCOMING EVENTS (Desktop Sidebar) --- */
.upcoming-box {
    position: sticky; top: var(--gap);
}
.upcoming-box h3 {
    font-size: 1.1rem; font-weight: 800; color: var(--c-muted);
    text-transform: uppercase; letter-spacing: 0.05em;
    margin: 0 0 20px 0;
}

.upcoming-item {
    display: flex; gap: 16px; align-items: center;
    padding: 16px;
    background: var(--c-card);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-m);
    margin-bottom: 12px;
    transition: transform 0.2s;
}
.upcoming-item:hover { transform: translateX(-4px); border-color: var(--c-cyan); }

.date-badge {
    background: rgba(0, 159, 227, 0.1);
    color: var(--c-cyan);
    min-width: 56px; height: 56px;
    border-radius: 14px;
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    line-height: 1;
}
.db-day { font-size: 1.4rem; font-weight: 800; }
.db-month { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; margin-top: 2px; }

/* FIX: Upcoming Button Width */
.upcoming-box .btn-ghost {
    width: 100%;
    justify-content: center;
    box-sizing: border-box; /* Verhindert das Rausragen */
}

/* --- CALENDAR --- */
.calendar-grid {
    display: grid; grid-template-columns: repeat(7, 1fr);
    gap: 2px; background: var(--c-border);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-l); overflow: hidden;
}
.cal-head {
    background: var(--c-hover); padding: 15px; text-align: center;
    font-weight: 700; color: var(--c-muted); text-transform: uppercase; font-size: 0.85rem;
}
.cal-cell {
    background: var(--c-cal-bg); min-height: 140px; padding: 8px 0;
    cursor: pointer; position: relative; transition: background 0.2s;
}
.cal-cell:hover { background: var(--c-hover); }
.cal-cell.selected { background: rgba(0, 159, 227, 0.05); }

.cal-day-num {
    margin: 6px 12px 10px; display: block;
    font-weight: 700; color: var(--c-muted);
}
.cal-today { 
    color: var(--c-magenta); font-size: 1.2rem; position: relative;
}
.cal-today::after {
    content: ''; position: absolute; bottom: -4px; left: 0; width: 100%; height: 2px; background: currentColor; border-radius: 2px;
}

/* Event Bars (Connected) */
.event-bar {
    height: 26px; margin-bottom: 4px;
    background: var(--c-cyan); color: white;
    font-size: 0.75rem; font-weight: 600;
    display: flex; align-items: center; padding: 0 10px;
    cursor: pointer; overflow: hidden; white-space: nowrap;
    position: relative; z-index: 10;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.1s;
}
.event-bar:hover { transform: scale(1.02); z-index: 11; }
.is-start { margin-left: 8px; border-top-left-radius: 6px; border-bottom-left-radius: 6px; }
.is-end { margin-right: 8px; border-top-right-radius: 6px; border-bottom-right-radius: 6px; }
.is-single { margin: 0 8px 4px 8px; border-radius: 6px; }

/* --- BUTTONS & INPUTS --- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 14px 28px; border-radius: 100px; /* Pill Shape */
    font-weight: 700; font-size: 1rem; border: none; cursor: pointer;
    transition: all 0.3s var(--ease-elastic);
    box-sizing: border-box; /* Wichtig für Breite */
}
.btn:active { transform: scale(0.95); }

.btn-primary {
    background: linear-gradient(135deg, var(--c-magenta) 0%, #C00060 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(226, 0, 116, 0.4);
}
.btn-primary:hover {
    box-shadow: 0 8px 25px rgba(226, 0, 116, 0.5);
    transform: translateY(-2px);
}

.btn-ghost {
    background: transparent; color: var(--c-muted);
    border: 2px solid var(--c-border);
}
.btn-ghost:hover {
    border-color: var(--c-text); color: var(--c-text);
}

.input {
    width: 100%; padding: 16px 20px;
    background: var(--c-hover);
    border: 2px solid transparent;
    border-radius: var(--radius-m);
    font-size: 1rem; color: var(--c-text);
    margin-bottom: 16px; box-sizing: border-box;
    transition: all 0.2s;
}
.input:focus {
    outline: none; background: var(--c-card);
    border-color: var(--c-magenta);
    box-shadow: 0 0 0 4px rgba(226, 0, 116, 0.15);
}

/* --- MOBILE HEADER & FAB --- */
.mobile-header { display: none; } /* Hidden on Desktop */
.btn-fab-mobile { display: none; }

/* --- MOBILE RESPONSIVE OVERRIDES (Radikaler Umbau) --- */
@media (max-width: 900px) {
    /* Variables Reset for Mobile */
    :root {
        --gap: 16px;
        --radius-l: 20px;
        --nav-h-mobile: 70px;
    }

    /* Container Reset */
    .app-container {
        padding: 0; display: block; /* No Flex on Body */
        padding-bottom: calc(var(--nav-h-mobile) + 20px); /* Space for Bottom Nav */
    }

    /* 1. Header (Visible on Mobile) */
    .mobile-header {
        display: flex; align-items: center; justify-content: center;
        height: 60px;
        background: var(--c-nav-bg);
        backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
        position: sticky; top: 0; z-index: 90;
        border-bottom: 1px solid var(--c-border);
    }
    .mobile-header .brand-logo { font-size: 1.4rem; }

    /* 2. Sidebar -> Bottom Navigation Pill */
    .sidebar {
        top: auto; bottom: 30px; left: 50%; right: auto;
        transform: translateX(-50%);
        width: 90%; max-width: 400px; height: var(--nav-h-mobile);
        flex-direction: row; align-items: center; justify-content: space-evenly;
        padding: 0 20px;
        box-shadow: 0 10px 40px rgba(0,0,0,0.25);
        border: 1px solid rgba(255,255,255,0.15);
        border-radius: 100px; /* Pill Shape */
        background: rgba(17, 24, 39, 0.85); /* Darker glass for contrast */
    }
    /* Dark Mode Adjust for Bar */
    body:not(.dark-mode) .sidebar {
        background: rgba(255, 255, 255, 0.95);
        border: 1px solid rgba(0,0,0,0.05);
    }

    .brand-section { display: none; } /* Logo ist im Header */
    
    .nav-links { 
        flex-direction: row; width: 100%; padding: 0; margin: 0; gap: 0; justify-content: space-between;
    }
    
    .nav-item {
        flex-direction: column; justify-content: center;
        height: 50px; padding: 0; width: 60px;
        background: transparent !important; /* Kein BG Hover auf Mobile */
        box-shadow: none !important;
        border: none;
        color: var(--c-muted);
    }
    
    /* Active State Mobile: Icon färbt sich */
    .nav-item.active { 
        color: var(--c-magenta); transform: translateY(-2px);
    }
    /* Hide Text Labels on Mobile */
    .nav-label { 
        display: none;
    }
    
    .nav-icon svg { width: 24px; height: 24px; }

    /* 3. Main Content */
    .main-content {
        margin: 0; padding: var(--gap);
        max-width: 100%;
    }

    /* 4. Grid Layout Reset */
    .polls-wrapper {
        display: flex; flex-direction: column-reverse; /* Upcoming oben, Polls unten? Oder umgekehrt */
        gap: 30px;
    }
    /* Upcoming als Horizontal Scroll "Story" Bar */
    .upcoming-sidebar {
        width: 100%; overflow-x: auto; 
        padding-bottom: 10px;
        /* Hide Scrollbar */
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .upcoming-sidebar::-webkit-scrollbar { display: none; }

    .upcoming-box {
        position: static;
        display: flex; gap: 15px; 
        background: transparent; border: none; box-shadow: none; padding: 0;
    }
    .upcoming-box h3, .upcoming-box .btn { display: none; } /* Titel und Button weg für Cleaner Look */
    
    .upcoming-item {
        min-width: 220px;
        background: var(--c-card);
        border: 1px solid var(--c-border);
        border-radius: var(--radius-m);
        padding: 15px;
        margin: 0; /* Reset */
        box-shadow: var(--shadow-sm);
        flex-direction: row; align-items: center;
    }

    /* 5. Floating Action Button (FAB) */
    .page-header-actions .btn { display: none; } /* Hide normal New button */
    
    .btn-fab-mobile {
        display: flex !important;
        position: fixed; bottom: 100px; right: 20px;
        width: 60px; height: 60px; border-radius: 50%;
        background: var(--c-magenta); color: white;
        box-shadow: 0 8px 25px rgba(226, 0, 116, 0.5);
        z-index: 95; padding: 0;
        justify-content: center; align-items: center;
    }
    .btn-fab-mobile svg { width: 32px; height: 32px; }

    /* Auth Screen Fix */
    .auth-wrapper { padding: 20px; }
    .auth-card { padding: 30px 20px; }
}

/* --- MODAL --- */
.modal-overlay { z-index: 2000; }
.modal-content {
    width: 100%; height: auto; bottom: 0; border-radius: 24px 24px 0 0;
    position: fixed; max-width: 100%; padding: 30px 20px;
    animation: slideUpModal 0.4s var(--ease-elastic);
}
@media (min-width: 901px) {
    .modal-content {
        position: relative; width: 90%; max-width: 500px; bottom: auto; border-radius: 24px;
    }
}

/* Menu Dropdown */
.menu-drop { 
    position: absolute; top: 35px; right: 0; 
    background: var(--c-card); 
    border: 1px solid var(--c-border); 
    border-radius: 12px; width: 180px; 
    z-index: 20; padding: 6px; 
    box-shadow: 0 10px 25px rgba(0,0,0,0.15); 
    animation: fadeIn 0.1s ease-out;
}
.menu-drop div { 
    padding: 10px 12px; cursor: pointer; display: flex; gap: 10px; align-items: center; font-size: 0.9rem; border-radius: 8px; color: var(--c-text);
}
.menu-drop div:hover { background: var(--c-hover); }

@keyframes slideUpModal { from { transform: translateY(100%); } to { transform: translateY(0); } }