/* ==========================================================================
   1. CORE CONFIGURATION (i2 GOLD THEME)
   ========================================================================== */
:root {
    /* Basisfarben (Dark Mode) */
    --bg: #050505;
    --card: #0a0a0a;
    --card-hover: #111111;
    --accent: #ffffff;
    --border: #1f1f1f;
    --text: #e0e0e0;
    --muted: #666666;
    
    /* SYSTEM STATUS */
    --error: #ff3b30;
    --success: #00ff88;
    
    /* i2 GOLD PALETTE */
    --i2-gold: #ffd700;
    --i2-gold-dim: rgba(255, 215, 0, 0.1);
    --i2-glow: rgba(255, 215, 0, 0.4);
    
    /* i3 VORSCHAU (Smaragd) */
    --i3-emerald: #50c878; 
    --i3-glow: rgba(80, 200, 120, 0.5);
    
    /* CHAT SPEZIFISCH (Das fehlte vorher!) */
    --chat-own-bg: rgba(0, 50, 20, 0.9);      /* Dunkelgrün Hintergrund */
    --chat-own-border: #00ff88;               /* Hellgrüner Rand */
    --chat-other-bg: rgba(30, 30, 30, 0.9);   /* Grau Hintergrund */
    --chat-other-border: #444;                /* Grauer Rand */
}

/* ==========================================================================
   2. GLOBAL RESET
   ========================================================================== */
* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Plus Jakarta Sans', sans-serif; }
body { background: var(--bg); color: var(--text); display: flex; height: 100vh; overflow: hidden; font-size: 15px; }
.hidden { display: none !important; }

/* Scrollbar Style */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #333; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--i2-gold); }

/* ==========================================================================
   3. SIDEBAR (DESKTOP)
   ========================================================================== */
.sidebar {
    width: 100px; 
    background: #000000; 
    border-right: 1px solid var(--border);
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    padding: 60px 0 20px 0; 
    z-index: 100; 
    transition: all 0.3s ease;
}

.logo-text { font-family: 'Space Grotesk', sans-serif; font-weight: 700; letter-spacing: -1px; color: var(--accent); font-size: 18px; }
.logo-gold-style {
    background: linear-gradient(to right, #ffffff 20%, var(--i2-gold) 40%, var(--i2-gold) 60%, #ffffff 80%);
    background-size: 200% auto; background-clip: text; -webkit-background-clip: text;
    color: transparent; -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.5));
    animation: gold-scan 3s linear infinite; display: inline-block;
}
@keyframes gold-scan { 0% { background-position: 100% center; } 100% { background-position: -100% center; } }

.sidebar-brand { margin-bottom: 30px; padding: 0 20px; text-align: center; width: 100%; }
.nav-divider { height: 1px; width: 50%; background: linear-gradient(90deg, rgba(255,255,255,0.05), rgba(255,255,255,0.2), rgba(255,255,255,0.05)); border: none; margin: 30px 0; }

.nav-menu { display: flex; flex-direction: column; gap: 20px; flex: 1; align-items: center; width: 100%; padding-top: 10px; }
.nav-btn { background: none; border: none; color: var(--muted); font-size: 22px; cursor: pointer; transition: 0.3s; padding: 12px; border-radius: 12px; position: relative;}
.nav-btn:hover { background: rgba(255,255,255,0.05); color: #fff; }

.nav-btn.active { 
    color: var(--i2-gold); 
    background: var(--i2-gold-dim);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.15);
    transform: scale(1.05);
}

.sidebar-footer-container { margin-top: auto; width: 100%; padding-bottom: 20px; display: flex; flex-direction: column; align-items: center; }
.sidebar-credits { width: 100%; padding: 0 5px; text-align: center; color: rgba(255, 255, 255, 0.3); font-size: 9px; line-height: 1.4; }
.credit-name { color: rgba(255, 255, 255, 0.7); font-weight: 600; margin: 2px 0; font-size: 9px; }
.nav-exit { display: none !important; }

/* ==========================================================================
   4. MAIN CONTENT & VIEWS
   ========================================================================== */
.main-container { flex: 1; overflow-y: auto; height: 100vh; position: relative; background: radial-gradient(circle at top right, #111 0%, #000 40%); }
.view { padding: 40px; max-width: 1600px; margin: 0 auto; width: 100%; animation: fadeIn 0.5s cubic-bezier(0.2, 0.8, 0.2, 1); padding-bottom: 150px; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(15px); } to { opacity: 1; transform: translateY(0); } }

.view-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 40px; flex-wrap: wrap; gap: 20px; border-bottom: 1px solid rgba(255,255,255,0.05); padding-bottom: 20px; }
h1 { font-family: 'Space Grotesk', sans-serif; font-size: 36px; letter-spacing: -1.5px; color: #fff; text-shadow: 0 0 20px rgba(255,255,255,0.1); }
.muted-text { font-size: 13px; color: var(--muted); letter-spacing: 0.5px; }

/* GRIDS */
.dashboard-grid { display: grid; grid-template-columns: 1.8fr 1fr; gap: 25px; }
.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 25px; }
.workspace-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 30px; }

.glass-card { 
    background: rgba(15, 15, 15, 0.6); backdrop-filter: blur(10px);
    border: 1px solid var(--border); padding: 35px; border-radius: 16px; 
    height: 100%; transition: 0.3s border-color; box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}
.glass-card:hover { border-color: rgba(255,255,255,0.15); }

/* ==========================================================================
   5. CHAT SYSTEM (Das fehlte in deinem Code!)
   ========================================================================== */
/* Container */
#chat-messages {
    display: flex;
    flex-direction: column; /* Wichtig damit bubbles untereinander sind */
    gap: 8px;
    padding: 10px;
}

/* SMOOTH CHAT ANIMATIONEN */
.chat-msg {
    padding: 12px 18px;
    border-radius: 16px;
    max-width: 80%;
    word-wrap: break-word;
    font-size: 14px;
    line-height: 1.5;
    position: relative;
    /* Die Magic Animation: */
    animation: slideIn 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    transform-origin: bottom center;
}

@keyframes slideIn {
    from { 
        opacity: 0; 
        transform: translateY(20px) scale(0.95); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0) scale(1); 
    }
}
@keyframes popIn { from { transform: scale(0.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* EIGENE NACHRICHTEN (Grün & Rechts) */
.chat-msg.own {
    background-color: var(--chat-own-bg);
    border: 1px solid var(--chat-own-border);
    color: #fff;
    align-self: flex-end; /* Rechtsbündig */
    border-bottom-right-radius: 2px;
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.1);
    text-align: left;
}

/* FREMDE NACHRICHTEN (Grau & Links) */
.chat-msg.other {
    background-color: var(--chat-other-bg);
    border: 1px solid var(--chat-other-border);
    color: #ddd;
    align-self: flex-start; /* Linksbündig */
    border-bottom-left-radius: 2px;
}

/* Name und Zeit */
.chat-sender-name { font-weight: 700; font-size: 10px; display: block; margin-bottom: 4px; text-transform: uppercase; }
.chat-timestamp { font-size: 9px; color: rgba(255,255,255,0.5); display: block; margin-top: 5px; text-align: right; }

/* Grüner Punkt bei Freunden */
.friend-unread-dot { 
    display: inline-block; width: 9px; height: 9px; 
    background-color: #00ff88; border-radius: 50%; 
    margin-right: 10px; box-shadow: 0 0 8px #00ff88; 
    animation: pulse-green 2s infinite; 
}
@keyframes pulse-green { 0% { transform: scale(0.9); box-shadow: 0 0 0 0 rgba(0,255,136,0.7); } 70% { transform: scale(1.1); box-shadow: 0 0 0 5px rgba(0,0,0,0); } 100% { transform: scale(0.9); box-shadow: 0 0 0 0 rgba(0,0,0,0); } }

/* ==========================================================================
   6. INTERFACE ELEMENTS (Inputs, Buttons, Lists)
   ========================================================================== */
textarea { width: 100%; background: #111; border: 1px solid #333; color: #eee; padding: 15px; border-radius: 8px; font-size: 15px; resize: none; outline: none; transition: 0.3s; margin-top: 10px; }
textarea:focus { border-color: var(--i2-gold); background: #000; box-shadow: 0 0 15px rgba(255, 215, 0, 0.1); }
#global-strategy { height: 150px; font-size: 18px; }
#ws-notes { height: 450px; background-image: linear-gradient(#1f1f1f 1px, transparent 1px); background-size: 100% 32px; background-color: transparent; border: none; line-height: 32px; padding-top: 7px; padding-left: 10px; padding-right: 10px; font-family: 'Plus Jakarta Sans', sans-serif; }
#input-desc { background: transparent !important; border: none !important; border-bottom: 1px solid #333 !important; border-radius: 0 !important; padding: 15px 0 !important; margin-top: 0 !important; box-shadow: none !important; }
#input-desc:focus { border-bottom-color: var(--i2-gold) !important; }

/* ToDo & Links */
.todo-input { display: flex; gap: 8px; margin-bottom: 20px; align-items: center; flex-wrap: nowrap; width: 100%; }
.todo-input input { flex: 1; background: #0a0a0a; border: 1px solid #222; color: white; padding: 0 12px; height: 40px; border-radius: 8px; outline: none; transition: 0.3s; min-width: 0; font-size: 13px; }
.todo-input input:focus { border-color: var(--i2-gold); background: #000; }
.btn-add { background: var(--i2-gold); color: #000; border: none; width: 40px; height: 40px; border-radius: 8px; cursor: pointer; font-weight: bold; font-size: 18px; transition: 0.3s; flex-shrink: 0; display:flex; align-items:center; justify-content:center; }
.btn-add:hover { transform: scale(1.05); box-shadow: 0 0 10px var(--i2-glow); }
.link-item, .todo-item { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; border-bottom: 1px solid #1a1a1a; background: rgba(255,255,255,0.02); margin-bottom: 4px; border-radius: 6px; transition: 0.2s; }
.link-item a { color: var(--i2-gold); text-decoration: none; font-size: 12px; font-weight: 500; }

/* File Chips */
.file-preview-list { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 15px; }
.file-preview-item { display: flex; align-items: center; gap: 8px; background: rgba(255, 215, 0, 0.05); border: 1px solid rgba(255, 215, 0, 0.2); padding: 5px 10px; border-radius: 20px; font-size: 11px; color: #ddd; }
.file-delete-btn { background: none; border: none; color: #ff3b30; cursor: pointer; font-size: 14px; margin-left: 5px; }

/* Forms & Buttons */
.form-group { position: relative; margin-bottom: 35px; }
.form-group input { width: 100%; background: none; border: none; border-bottom: 1px solid #333; padding: 15px 0; color: white; outline: none; font-size: 16px; border-radius: 0; }
.form-group label { position: absolute; left: 0; top: 15px; color: var(--muted); pointer-events: none; font-size: 14px; transition: 0.3s; }
.form-group input:focus + label, .form-group input:not(:placeholder-shown) + label, #input-desc:focus + label, #input-desc:not(:placeholder-shown) + label { top: -20px; font-size: 11px; color: var(--i2-gold); text-transform: uppercase; font-weight: 700; }
.form-group input:focus { border-bottom-color: var(--i2-gold); }

.btn-primary { background: #fff; color: black; border: none; padding: 16px 28px; border-radius: 8px; font-weight: 800; cursor: pointer; transition: 0.3s; text-transform: uppercase; font-size: 12px; letter-spacing: 1px; width: 100%; position: relative; overflow: hidden; }
.btn-primary:hover { opacity: 0.9; transform: translateY(-2px); }
.i2-btn-glow { background: linear-gradient(90deg, #b8860b, #ffd700) !important; color: black !important; box-shadow: 0 0 25px rgba(255, 215, 0, 0.25); border: 1px solid rgba(255,255,255,0.1); }
.i2-btn-glow:hover { box-shadow: 0 0 40px rgba(255, 215, 0, 0.5); }
.btn-outline { background: transparent; border: 1px solid #333; color: #fff; padding: 12px 24px; border-radius: 8px; cursor: pointer; transition: 0.3s; font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 8px; }
.btn-outline:hover { background: #fff; color: black; }
.btn-ghost { background: none; border: none; color: #666; cursor: pointer; font-size: 13px; text-decoration: underline; }
.btn-ghost:hover { color: #fff; }
.btn-icon { background: transparent; border: 1px solid #333; color: #fff; width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: 0.3s; }
.btn-icon:hover { border-color: var(--i2-gold); color: var(--i2-gold); }

/* Stats & Progress */
.stats-container { display: flex; align-items: flex-end; gap: 6px; height: 100px; margin-top: 25px; }
.stat-bar { flex: 1; background: #1a1a1a; border-radius: 4px 4px 0 0; position: relative; transition: 1s ease-out; height: 5%; }
.stat-bar.active { background: linear-gradient(to top, #b8860b, #ffd700); box-shadow: 0 0 20px rgba(255, 215, 0, 0.25); }
.stat-label { font-size: 9px; position: absolute; bottom: -20px; width: 100%; text-align: center; color: #555; font-weight: 700; }
.update-item { padding: 20px; background: rgba(255, 255, 255, 0.02); border-radius: 10px; border-left: 3px solid var(--i2-gold); margin-top: 20px; }
.power-bar-container { width: 100%; height: 6px; background: rgba(255,255,255,0.1); border-radius: 10px; margin: 15px 0; overflow: hidden; }
.power-bar { height: 100%; border-radius: 10px; display: block; }
.i2-flow { background: linear-gradient(90deg, #b8860b, #ffd700); box-shadow: 0 0 15px rgba(255, 215, 0, 0.6); }
.i3-flow { background: linear-gradient(90deg, #00ab66, #50c878, #00ff88); background-size: 200% 100%; animation: i3-loading 3s linear infinite, i3-glow 2s infinite alternate ease-in-out; }
@keyframes i3-loading { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
@keyframes i3-glow { 0% { box-shadow: 0 0 5px rgba(80, 200, 120, 0.3); } 100% { box-shadow: 0 0 20px rgba(80, 200, 120, 0.7); } }
.text-emerald-gradient { background: linear-gradient(90deg, #ffffff, #50c878); background-size: 200% auto; -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent; font-weight: 800; font-size: 10px; display: inline-block; }
#ws-progress-bar { height: 100%; width: 0%; background: linear-gradient(90deg, #b8860b, #ffd700); transition: width 0.6s; display: flex; align-items: center; justify-content: flex-end; font-size: 9px; color: black; font-weight: bold; padding-right: 8px; box-shadow: 0 0 20px rgba(255, 215, 0, 0.4); }

/* Cards */
.project-card { 
    background: var(--card); border: 1px solid var(--border); padding: 30px; border-radius: 14px; 
    cursor: pointer; transition: all 0.3s; display: flex; flex-direction: column; justify-content: space-between; 
    min-height: 200px; position: relative; overflow: hidden;
}
.project-card:hover { 
    border-color: rgba(255, 215, 0, 0.3); transform: translateY(-6px); 
    box-shadow: 0 15px 35px rgba(0,0,0,0.6); background: var(--card-hover);
}
.project-card::before {
    content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 2px;
    background: linear-gradient(90deg, transparent, var(--i2-gold), transparent);
    transform: scaleX(0); transition: 0.4s; transform-origin: left;
}
.project-card:hover::before { transform: scaleX(1); }
.project-card h3 { font-size: 22px; font-weight: 700; margin-bottom: 10px; color: #fff; }
.project-card p { font-size: 13px; line-height: 1.5; color: #888; }
.project-card-footer { margin-top: 25px; padding-top: 15px; border-top: 1px solid rgba(255,255,255,0.05); display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; font-weight: 600; }
.ws-controls { display: flex; gap: 10px; margin-top: 20px; }
.meta-input { background: #111; border: 1px solid #333; color: #fff; padding: 8px; border-radius: 6px; outline: none; }

/* ==========================================================================
   7. MODALS & LOGIN
   ========================================================================== */
.login-overlay { position: fixed; inset: 0; width: 100vw; height: 100vh; background: #000; display: grid; place-items: center; z-index: 999999; padding: 20px; }
.login-box { width: 100%; max-width: 380px; padding: 40px; background: #09090b; border: 1px solid #1f1f1f; box-shadow: 0 0 50px rgba(0,0,0,0.8); border-radius: 20px; text-align: center; }
.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.8); backdrop-filter: blur(15px); display: grid; place-items: center; z-index: 2000; padding: 20px; }
.i1-modal { background: #09090b; border: 1px solid #27272a; padding: 30px; border-radius: 20px; width: 100%; max-width: 380px !important; text-align: center; }
#tutorial-overlay .i1-modal { max-width: 550px !important; text-align: left; padding: 0; }
.lock-pulse { width: 80px; height: 80px; background: rgba(255, 215, 0, 0.05); border: 1px solid rgba(255, 215, 0, 0.2); border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 25px auto; font-size: 32px; color: var(--i2-gold); animation: pulse-gold 2s infinite; }
@keyframes pulse-gold { 0% { box-shadow: 0 0 0 0 rgba(255, 215, 0, 0.4); } 70% { box-shadow: 0 0 0 20px rgba(0,0,0,0); } 100% { box-shadow: 0 0 0 0 rgba(0,0,0,0); } }
.i1-login-divider { height: 2px; width: 60px; background: linear-gradient(90deg, transparent, var(--i2-gold), transparent); margin: 0 auto 30px auto; box-shadow: 0 0 15px rgba(255, 215, 0, 0.8); }

/* Tutorial & Badges */
#tutorial-overlay .i1-modal::before { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 3px; background: linear-gradient(90deg, #ffd700, #b8860b); z-index: 10; }
.tutorial-step { padding: 40px; }
.tutorial-step h3 { font-family: 'Space Grotesk', sans-serif; font-size: 20px; font-weight: 700; color: #fff; margin-bottom: 15px; display: flex; align-items: center; gap: 12px; }
.tutorial-step p { font-size: 14px; color: #a1a1aa; line-height: 1.6; margin-bottom: 25px; }
.tutorial-list { list-style: none; margin-bottom: 30px; padding: 0; }
.tutorial-list li { font-size: 13px; color: #d4d4d8; margin-bottom: 15px; display: flex; align-items: flex-start; gap: 15px; }
.tutorial-list i { color: var(--i2-gold); margin-top: 2px; width: 20px; text-align: center; }
.btn-next { background: #27272a; color: #fff; border: 1px solid #3f3f46; padding: 10px 24px; border-radius: 8px; cursor: pointer; font-size: 13px; font-weight: 500; transition: all 0.2s; font-family: 'Plus Jakarta Sans', sans-serif; }
.btn-next:hover { background: #3f3f46; color: white; }
.btn-finish { background: var(--i2-gold); color: black; border: none; padding: 14px 30px; border-radius: 8px; font-weight: 700; cursor: pointer; box-shadow: 0 0 20px rgba(255, 215, 0, 0.3); transition: all 0.2s; width: 100%; font-family: 'Plus Jakarta Sans', sans-serif; text-transform: uppercase; letter-spacing: 0.5px; }
.text-gold { color: #ffd700 !important; }
#nav-chat { position: relative !important; overflow: visible !important; }
#nav-chat-badge { position: absolute; top: 5px; right: 8px; width: 10px; height: 10px; background-color: #00ff88; border-radius: 50%; border: 2px solid #000000; box-shadow: 0 0 8px #00ff88; display: none; z-index: 100; pointer-events: none; }
#nav-chat-badge.visible { display: block !important; animation: pulse-green 2s infinite; }

#review-popup .i1-modal { padding: 30px !important; text-align: center !important; max-width: 400px !important; width: 90% !important; background: #09090b !important; border: 1px solid #333 !important; z-index: 100000 !important; }
#review-popup h3 { color: #ffffff !important; font-size: 20px !important; margin-bottom: 10px !important; display: block !important; }
#review-popup p { color: #a1a1aa !important; font-size: 14px !important; margin-bottom: 25px !important; line-height: 1.5 !important; }
#daily-achievement { background: #18181b !important; border: 1px solid #27272a !important; color: #fff !important; padding: 15px !important; border-radius: 8px !important; font-size: 16px !important; width: 100% !important; margin-bottom: 20px !important; }
#review-popup .btn-primary { width: 100% !important; padding: 15px !important; margin-top: 0 !important; }

/* ==========================================================================
   8. MOBILE OPTIMIZATION (6 ICONS & LAYOUT)
   ========================================================================== */
@media (max-width: 768px) {
    body { flex-direction: column; overflow-y: auto; }
    
    /* Leiste unten fixiert */
    .sidebar { 
        width: 100% !important; height: 75px !important; 
        flex-direction: row !important; position: fixed !important; 
        bottom: 0 !important; left: 0 !important; 
        border-top: 1px solid var(--i2-gold) !important; 
        background: rgba(10, 10, 10, 0.98) !important; 
        backdrop-filter: blur(15px); 
        padding: 0 !important; 
    }
    
    .sidebar-brand, .sidebar-credits, .nav-divider, .sidebar-footer-container { display: none !important; }
    
    /* NAV MENU: Jetzt flexibel für 6 Icons (Story & Recht dabei) */
    .nav-menu { 
        flex-direction: row !important; 
        justify-content: space-between !important; 
        gap: 0 !important; 
        padding: 0 10px !important; 
        width: 100% !important;
    }
    .nav-btn { 
        flex: 1 !important; 
        height: 60px !important; 
        border-radius: 0 !important; 
        padding: 0 !important;
        font-size: 20px !important; /* Schrift etwas kleiner damit 6 passen */
    }
    
    .main-container { margin-bottom: 75px !important; }
    .view { padding: 20px !important; padding-bottom: 100px !important; }
    .dashboard-grid, .workspace-grid, .project-grid { grid-template-columns: 1fr !important; }
    .glass-card { padding: 20px !important; }
    .todo-input { flex-direction: column !important; align-items: stretch !important; }
    .btn-add { width: 100% !important; }
    
    .workspace-nav > div { flex-wrap: wrap !important; align-items: center !important; }
    .workspace-nav .btn-icon { min-width: 40px !important; width: 40px !important; height: 40px !important; flex-shrink: 0 !important; order: 1; }
    .workspace-nav .btn-ghost { margin-left: auto !important; order: 2; }
    .workspace-nav > div > div { width: 100% !important; order: 3; margin-top: 15px !important; padding-top: 15px !important; border-top: 1px dashed rgba(255,255,255,0.1); }
    #ws-title { font-size: 24px !important; margin-top: 5px !important; }
    .ws-controls { flex-direction: column !important; width: 100% !important; }
    .ws-controls .meta-input { width: 100% !important; }
}
/* SMOOTH CHAT ANIMATION */
.chat-msg {
    /* Verhindert Ruckeln */
    transform-origin: bottom left;
    animation: messageSlideIn 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}

.chat-msg.own {
    transform-origin: bottom right; /* Eigene Nachrichten kommen von rechts */
}

@keyframes messageSlideIn {
    from { 
        opacity: 0; 
        transform: translateY(10px) scale(0.95); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0) scale(1); 
    }
}

/* Scrollbar im Chat schöner machen */
#chat-messages::-webkit-scrollbar {
    width: 4px;
}
#chat-messages::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 2px;
}
/* FIX FÜR DEN LOGIN-HINTERGRUND (IDEAFY i2) */
#auth-view {
    background-color: #000000 !important; /* Erzwingt tiefes Schwarz */
    background-image: none !important;    /* Entfernt störende Hintergrundbilder */
    min-height: 100vh !important;         /* Deckt immer die volle Höhe ab */
    width: 100% !important;               /* Deckt die volle Breite ab */
    position: fixed;                      /* Fixiert den Hintergrund gegen Biegen */
    top: 0;
    left: 0;
    overflow-y: auto;                     /* Erlaubt Scrollen nur nach unten */
    overflow-x: hidden;                   /* Stoppt das seitliche Wackeln/Biegen */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;                        /* Legt sich über alles andere */
}

/* Sicherstellen, dass der Body keine weißen Ränder erzeugt */
body, html {
    background-color: #000000 !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100%;
    overflow-x: hidden;
}
/* ==========================================
   FINALER LOGIN FIX (KILLT DEN WEISSEN BALKEN)
   ========================================== */

/* 1. Basis: Verhindert, dass der Browser hinter die Seite guckt */
html, body {
    background-color: #000000 !important;
    overscroll-behavior: none !important; /* Stoppt das "Biegen" auf Mac/Handy */
    width: 100vw !important;
    overflow-x: hidden !important;
}

/* 2. Der Login-Screen: Aggressive Abdeckung */
#auth-view {
    position: fixed !important;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw !important;       /* Volle Bildschirmbreite */
    height: 100vh !important;      /* Volle Bildschirmhöhe */
    
    background-color: #000000 !important;
    background-image: none !important;
    
    z-index: 999999 !important;    /* Über allem anderen */
    
    /* Flexbox Zentrierung */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    
    /* Scroll-Verhalten */
    overflow-y: auto;              /* Scrollen erlauben wenn nötig */
    overflow-x: hidden;            /* Kein seitliches Wackeln */
    -webkit-overflow-scrolling: touch; /* Flüssiges Scrollen auf Handy */
}

/* 3. Der Balken rechts (Scrollbar) MUSS schwarz sein */
#auth-view::-webkit-scrollbar {
    width: 8px;
    background-color: #000000;
}

#auth-view::-webkit-scrollbar-track {
    background-color: #000000 !important; /* Die Schiene ist schwarz */
    border-left: 1px solid #111;
}

#auth-view::-webkit-scrollbar-thumb {
    background-color: #333;
    border-radius: 10px;
    border: 2px solid #000; /* Macht den Griff hübscher */
}

/* ============================================================
   ULTIMATIVER "KILL DEN BALKEN" FIX (Ganz unten einfügen)
   ============================================================ */

/* 1. Zwingt den Browser-Hintergrund auf tiefes Schwarz */
html, body {
    background-color: #000000 !important;
    background: #000000 !important;
    min-height: 100vh !important;
    width: 100vw !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow-x: hidden !important;
}

/* 2. Scrollbar komplett schwarz machen (WICHTIG: border: none!) */
::-webkit-scrollbar,
#auth-view::-webkit-scrollbar {
    width: 12px !important;
    background-color: #000000 !important;
}

::-webkit-scrollbar-track,
#auth-view::-webkit-scrollbar-track {
    background-color: #000000 !important; /* Track ist schwarz */
    background: #000000 !important;
    border: none !important;      /* HIER IST DER FIX: Entfernt den Strich/Balken */
    box-shadow: none !important;  /* Entfernt Schatten */
    outline: none !important;
}

::-webkit-scrollbar-thumb,
#auth-view::-webkit-scrollbar-thumb {
    background-color: #222 !important;    /* Der Griff (sehr dunkel) */
    border: 3px solid #000000 !important; /* Abstand zum Rand in Schwarz */
    border-radius: 10px !important;
}

/* Die kleine Ecke unten rechts, falls beide Scrollbars da sind */
::-webkit-scrollbar-corner {
    background-color: #000000 !important;
}

/* 3. Der Login-Screen deckt ALLES ab */
#auth-view, #login-view {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    
    background-color: #000000 !important;
    background-image: none !important;
    border-right: none !important; /* Falls da ein Rand war: weg damit */
    
    z-index: 2147483647 !important; /* Höchster möglicher Z-Index */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
/* ==========================================
   ULTIMATIVER FIX: RECHTER RAND KILLER
   ========================================== */

/* 1. Hintergrund der Seite auf Schwarz zwingen */
html, body {
    background-color: #000000 !important;
    scrollbar-color: #333 #000000; /* Für Firefox Unterstützung */
}

/* 2. Die Scrollbar selbst: Schwarz */
::-webkit-scrollbar {
    width: 12px;
    background-color: #000000 !important;
}

/* 3. Die Schiene (Track): HIER WAR DAS PROBLEM */
::-webkit-scrollbar-track {
    background-color: #000000 !important; /* Track muss schwarz sein */
    border: none !important;              /* WICHTIG: Entfernt den grauen Strich links! */
    box-shadow: none !important;          /* Entfernt Schatten */
    margin: 0 !important;
}

/* 4. Der Griff (Thumb): Dunkelgrau mit schwarzem Rand */
::-webkit-scrollbar-thumb {
    background-color: #222 !important;     /* Sehr dunkles Grau */
    border: 3px solid #000000 !important;  /* Ein "Abstand" aus Schwarz */
    border-radius: 20px;
}

/* 5. Die Ecke unten rechts (falls sichtbar) */
::-webkit-scrollbar-corner {
    background-color: #000000 !important;
}

/* 6. Login View Abdeckung */
#auth-view {
    background-color: #000000 !important;
    width: 100vw !important;  /* Volle Breite erzwingen */
    height: 100vh !important;
    overflow-x: hidden !important;
}
/* ============================================================
   FINALER CLEANUP-FIX (Ersetzt alles am Ende)
   ============================================================ */

/* 1. Basis: Erzwingt Schwarz für den gesamten Browser-Viewport */
html, body {
    background-color: #000000 !important;
    background: #000000 !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    height: 100% !important;
    overflow-x: hidden !important;
    /* WICHTIG FÜR FIREFOX: */
    scrollbar-color: #333333 #000000 !important; 
    scrollbar-width: auto !important;
}

/* 2. Der Track (Die Schiene rechts): MUSS schwarz sein ohne Rand */
::-webkit-scrollbar-track,
#auth-view::-webkit-scrollbar-track {
    background-color: #000000 !important; /* Hintergrund Schwarz */
    background: #000000 !important;
    border: none !important;      /* KILLT DEN RAND/BALKEN */
    margin: 0 !important;
    box-shadow: none !important;
    outline: none !important;
}

/* 3. Der Griff (Thumb) */
::-webkit-scrollbar-thumb,
#auth-view::-webkit-scrollbar-thumb {
    background-color: #222222 !important;   /* Dunkelgrauer Griff */
    border: 3px solid #000000 !important;   /* Schwarzer Abstand statt weißer Rand */
    border-radius: 12px !important;
}

/* 4. Die Scrollbar selbst (Breite & Hintergrund) */
::-webkit-scrollbar,
#auth-view::-webkit-scrollbar {
    width: 12px !important;
    background-color: #000000 !important;
}

/* 5. Die Ecke unten rechts */
::-webkit-scrollbar-corner {
    background-color: #000000 !important;
}

/* 6. Login/Auth Screen: Volle Abdeckung */
#auth-view, #login-view {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background-color: #000000 !important;
    background-image: none !important;
    z-index: 2147483647 !important; /* Höchster Layer */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
/* ============================================================
   MOBILE FINAL COMPLETE: LOGIN + CHAT FOCUS + UPLOADS + TUTORIAL
   ============================================================ */
@media (max-width: 768px) {

    /* --- 1. LOGIN: RESPONSIV & SICHER --- */
    #auth-view, .login-overlay {
        position: fixed !important;
        inset: 0 !important;
        width: 100vw !important; height: 100vh !important;
        background-color: #000000 !important;
        z-index: 2147483647 !important;
        display: flex !important;
        flex-direction: column !important;
        overflow-y: auto !important; 
        -webkit-overflow-scrolling: touch !important;
        padding: 20px !important;
    }

    #auth-view.hidden, .login-overlay.hidden, .hidden {
        display: none !important; opacity: 0 !important; pointer-events: none !important; z-index: -1 !important;
    }

    .login-box {
        margin: auto !important;
        width: 100% !important; max-width: 400px !important;
        background: #09090b !important;
        padding: 40px 25px !important;
        padding-bottom: 50px !important; 
        border-radius: 24px !important;
        position: relative !important;
        display: block !important;
    }

    /* --- 2. CHAT SYSTEM: TOTALER FOKUS --- */
    #chat-view .dashboard-grid { 
        display: block !important; 
        height: 100% !important; 
        margin: 0 !important; 
    }

    #chat-view.mobile-chat-active #chat-list-col,
    #chat-view.mobile-chat-active #chat-main-header,
    #chat-view.mobile-chat-active .sidebar {
        display: none !important;
    }

    #chat-window-col {
        display: none !important;
        position: fixed !important; 
        top: 0 !important; left: 0 !important;
        width: 100vw !important; height: 100vh !important;
        background: #000000 !important;
        z-index: 5000 !important;
        padding: 0 !important;
        flex-direction: column !important;
    }

    #chat-view.mobile-chat-active #chat-window-col { 
        display: flex !important; 
    }

    /* --- CHAT HEADER: NAME LINKS, PFEIL RECHTS --- */
    #chat-window-col > div:first-child {
        padding: 50px 20px 15px 20px !important;
        background: rgba(10, 10, 10, 0.95) !important;
        backdrop-filter: blur(10px);
        border-bottom: 1px solid #222;
        z-index: 5010;
        display: flex !important;
        flex-direction: row !important; 
        justify-content: space-between !important; 
        align-items: center !important;
        min-height: 110px !important;
    }

    #chat-with-name {
        text-align: left !important;
        order: 1 !important;
        font-size: 18px !important;
        margin: 0 !important;
    }

    #mobile-chat-back {
        position: relative !important;
        order: 2 !important;
        display: flex !important;
        background: rgba(255,255,255,0.1) !important;
        width: 40px !important;
        height: 40px !important;
        border-radius: 50% !important;
        align-items: center;
        justify-content: center;
    }

    /* Nachrichten Bereich */
    #chat-messages {
        flex: 1 !important;
        padding: 15px !important;
        padding-top: 130px !important; 
        padding-bottom: 100px !important; 
        overflow-y: auto !important;
    }

    /* --- EINGABE: PERFEKT AM BODEN FIXIERT --- */
    #chat-window-col .ws-controls, 
    #chat-window-col .todo-input {
        position: fixed !important;
        bottom: 0px !important; 
        left: 0px !important;
        width: 100vw !important;
        background: #0a0a0a !important;
        margin: 0 !important;
        padding: 12px 15px calc(12px + env(safe-area-inset-bottom)) 15px !important; 
        display: grid !important; 
        grid-template-columns: 1fr 50px !important; 
        align-items: center !important;
        gap: 10px !important;
        border-top: 1px solid #1a1a1a !important;
        z-index: 5005 !important;
        box-sizing: border-box !important;
    }

    #chat-window-col input[type="text"], 
    #chat-window-col #chat-input {
        width: 100% !important;
        height: 45px !important;
        background: #151515 !important;
        border: 1px solid #333 !important;
        border-radius: 22px !important;
        padding: 0 15px !important;
        color: #fff !important;
        font-size: 16px !important;
        margin: 0 !important;
    }

    #chat-window-col .btn-add {
        width: 45px !important;
        height: 45px !important;
        border-radius: 50% !important;
        background: var(--i2-gold) !important;
        color: #000 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        border: none !important;
        margin: 0 !important;
    }

    /* --- 3. FREUNDE ADDEN --- */
    #chat-main-header .todo-input {
        display: flex !important;
        flex-direction: column !important;
        position: static !important;
        padding: 0 !important;
        background: transparent !important;
    }
    
    #search-friend-email {
        width: 100% !important;
        height: 50px !important;
        border-radius: 12px !important;
    }

    /* --- 4. DATEI UPLOAD ZONE --- */
    .file-upload-zone, #drop-zone {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        padding: 30px 20px !important;
        border: 2px dashed rgba(255, 215, 0, 0.3) !important;
        background: rgba(255, 215, 0, 0.05) !important;
        border-radius: 12px !important;
        margin: 15px 0 !important;
    }

    /* --- 5. TUTORIAL FIX (Wieder groß & sauber) --- */
    #tutorial-overlay {
        position: fixed !important;
        inset: 0 !important;
        z-index: 99999 !important;
        background: rgba(0,0,0,0.9) !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 20px !important;
    }

    #tutorial-overlay .i1-modal {
        width: 100% !important;
        max-width: 500px !important;
        max-height: 80vh !important;
        background: #09090b !important;
        border: 1px solid var(--i2-gold) !important;
        border-radius: 24px !important;
        overflow: hidden !important;
        display: flex !important;
        flex-direction: column !important;
        box-shadow: 0 20px 50px rgba(0,0,0,0.8) !important;
    }

    .tutorial-step {
        padding: 30px 20px !important;
        overflow-y: auto !important;
        flex: 1 !important;
        color: #fff !important;
        text-align: center !important;
    }

    /* --- 6. ALLGEMEIN --- */
    h1 { font-size: 26px !important; }
    .view-header { margin-bottom: 25px !important; }
    .sidebar { z-index: 100 !important; }
}
/* ============================================================
   EMERGENCY FIX: EINGABEFELD HÖHER SCHIEBEN (i2 ELITE)
   ============================================================ */
@media (max-width: 768px) {
    /* Schiebt das gesamte Eingabefeld ein gutes Stück nach oben */
    #chat-window-col .ws-controls, 
    #chat-window-col .todo-input {
        bottom: 35px !important; /* Von 0px auf 35px erhöht */
        left: 10px !important;
        right: 10px !important;
        width: calc(100vw - 20px) !important;
        
        /* Sorgt dafür, dass es wie eine schwebende Insel aussieht */
        border-radius: 25px !important;
        background: #0f0f0f !important;
        padding: 10px 15px !important;
        
        /* Verhindert, dass es nach unten rutscht */
        margin-bottom: env(safe-area-inset-bottom) !important;
        z-index: 10000 !important;
    }

    /* Damit die Nachrichten nicht hinter dem hohen Feld kleben */
    #chat-messages {
        padding-bottom: 140px !important;
    }
}