/* =========================================
   GLOBAL MAIN CSS
   ========================================= */

:root {
    --twitch-purple: #9146FF;
    --twitch-purple-dark: #6e2cb5;
    --twitch-yellow: #f1c40f; 
    --success: #00c853;
    --danger: #ff5252;
    --bg-body: #0e0e10;
    --bg-card: #18181b;
    --bg-input: #2d2d30;
    --text-main: #efeff1;
    --text-muted: #adadb8;
    --border-color: #303032;
    --hover-bg: rgba(255,255,255,0.05);
    --shadow: 0 4px 6px rgba(0,0,0,0.3);
}

[data-theme="light"] {
    --bg-body: #f7f7f8;
    --bg-card: #ffffff;
    --bg-input: #f0f0f0;
    --text-main: #0e0e10;
    --text-muted: #53535f;
    --border-color: #e5e5e5;
    --hover-bg: rgba(0,0,0,0.05);
    --twitch-yellow: #d4ac0d;
    --shadow: 0 4px 6px rgba(0,0,0,0.1); 
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* FIX FÜR MOBILE HORIZONTALES SCROLLEN */
html, body {
    overflow-x: hidden;
    width: 100%;
}

body { font-family: 'Inter', sans-serif; background-color: var(--bg-body); color: var(--text-main); line-height: 1.6; display: flex; flex-direction: column; min-height: 100vh; transition: background-color 0.3s, color 0.3s; }
a { color: inherit; text-decoration: none; transition: 0.2s; }
a:hover { color: var(--twitch-purple); }
img { max-width: 100%; height: auto; display: block; }

/* --- Layout --- */
.container {
    width: 95%; 
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px 0;
    overflow-wrap: break-word;
}

/* --- Navigation --- */
nav {
    background-color: var(--bg-card);
    border-bottom: 2px solid var(--twitch-purple);
    padding: 10px 0; 
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: nowrap; 
    gap: 20px;
}

.logo {
    display: flex;
    align-items: center;
    flex-shrink: 0; 
}

.logo img {
    height: 50px; 
    width: auto;
    object-fit: contain;
    max-width: 200px; 
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    -webkit-user-drag: none;
    pointer-events: none; 
}

.nav-links {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 15px; 
    flex-wrap: nowrap; 
}

.nav-links li {
    white-space: nowrap; 
}

.nav-links li a {
    color: var(--text-muted);
    font-weight: 600;
    padding: 8px 10px; 
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.95rem;
}

.nav-links li a:hover, .nav-links li a.active {
    color: var(--text-main);
    background-color: var(--hover-bg);
}

.btn-login {
    background-color: var(--twitch-purple);
    color: white !important;
    padding: 8px 16px !important;
    border-radius: 4px;
}

.theme-toggle {
    background: transparent;
    border: 2px solid var(--border-color);
    color: var(--twitch-yellow);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.3s;
}
.theme-toggle:hover {
    background: var(--hover-bg);
    border-color: var(--twitch-yellow);
    transform: rotate(15deg);
}

/* --- Mobile Responsiveness --- */
@media (max-width: 1100px) {
    .nav-content {
        flex-wrap: wrap; 
        justify-content: center;
    }
    
    .nav-links {
        justify-content: center;
        width: 100%;
        gap: 10px;
        margin-top: 10px;
        flex-wrap: wrap; 
    }
    
    .logo img {
        height: 40px; 
    }
}

/* --- Global Components --- */
.card { background-color: var(--bg-card); border: 1px solid var(--border-color); border-radius: 8px; padding: 20px; margin-bottom: 20px; box-shadow: var(--shadow); }
.section-title { border-left: 5px solid var(--twitch-yellow); padding-left: 15px; margin-bottom: 30px; font-size: 2rem; }
input, select, textarea { width: 100%; padding: 12px; margin-bottom: 15px; background: var(--bg-input); border: 1px solid var(--border-color); color: var(--text-main); border-radius: 4px; }
input:focus, select:focus, textarea:focus { border-color: var(--twitch-purple); outline: none; }
.btn { cursor: pointer; border: none; font-weight: bold; padding: 10px 20px; border-radius: 4px; display: inline-flex; align-items: center; gap: 8px; }
.btn-primary { background: var(--twitch-purple); color: white; }
.btn-secondary { background: #444; color: white; }
.btn-danger { background: var(--danger); color: white; }
.btn-success { background: var(--success); color: white; }
.badge { padding: 2px 6px; border-radius: 4px; font-size: 0.8rem; }
.badge-admin { background: var(--twitch-purple); color: white; }
.badge-mod { background: var(--success); color: white; }
.social-btn { display: inline-flex; align-items: center; gap: 10px; padding: 10px 20px; border-radius: 4px; font-weight: bold; color: white !important; }
.btn-twitch { background: #9146FF; }
.btn-youtube { background: #FF0000; }
.btn-discord { background: #5865F2; }
footer { background: var(--bg-card); padding: 40px 0; text-align: center; border-top: 1px solid var(--border-color); margin-top: auto; }
.social-icons a { margin: 0 10px; font-size: 1.5rem; color: var(--text-muted); transition: transform 0.2s; }
.social-icons a:hover { color: var(--twitch-purple); transform: scale(1.2); }

/* --- BANNER (LIVE / ANNOUNCEMENT / COUNTDOWN) --- */
.global-banner {
    color: white;
    padding: 4px 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    position: relative;
    z-index: 900;
    font-size: 0.85rem; 
    font-weight: 600;
}

.banner-live { background: linear-gradient(90deg, #9146FF 0%, #ff0000 100%); }
.banner-announcement { background: linear-gradient(90deg, #f1c40f 0%, #e67e22 100%); color: #000; }
.banner-countdown { background: linear-gradient(90deg, #2c3e50 0%, #4ca1af 100%); color: white; }

.live-indicator { background: #ff0000; color: white; padding: 1px 6px; border-radius: 4px; font-size: 0.75rem; font-weight: 800; animation: pulseRed 1.5s infinite; margin-right: 5px; }
.announcement-indicator { background: #000; color: #f1c40f; padding: 1px 6px; border-radius: 4px; font-size: 0.75rem; font-weight: 800; margin-right: 5px; }
.countdown-indicator { background: rgba(255,255,255,0.2); color: white; padding: 1px 6px; border-radius: 4px; font-size: 0.75rem; font-weight: 800; margin-right: 5px; }

.banner-btn {
    background: white;
    color: #000 !important;
    padding: 2px 10px;
    border-radius: 15px;
    font-weight: 800;
    font-size: 0.75rem;
    text-transform: uppercase;
    transition: transform 0.2s;
    margin-left: 10px;
    text-decoration: none;
    display: inline-block;
}
.banner-btn:hover { transform: scale(1.05); }

@keyframes slideDown { from { transform: translateY(-100%); } to { transform: translateY(0); } }
@keyframes pulseRed { 0% { opacity: 1; } 50% { opacity: 0.5; } 100% { opacity: 1; } }

/* --- GLOBAL MODAL STYLES (Ultra Fix) --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    z-index: 999999 !important; /* HÖCHSTE Priorität */
    display: none; /* Standard: Aus */
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none; /* Klicks gehen durch, wenn unsichtbar */
}

/* Wenn aktiv */
.modal-overlay.active {
    display: flex !important; /* Erzwingen */
    opacity: 1;
    pointer-events: auto; /* Jetzt Klicks blockieren */
}

.modal-content {
    background: var(--bg-card);
    padding: 30px;
    border-radius: 12px;
    border: 1px solid var(--twitch-purple);
    width: 90%;
    max-width: 500px;
    position: relative;
    box-shadow: 0 20px 50px rgba(0,0,0,0.8);
    transform: scale(0.95);
    transition: transform 0.2s ease;
    z-index: 1000000; /* Noch höher als Overlay */
    max-height: 90vh;
    overflow-y: auto;
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 2rem;
    cursor: pointer;
    color: var(--text-muted);
    line-height: 1;
    z-index: 1000001;
}
.close-modal:hover { color: var(--danger); }