:root {
    /* --- NEUE FARBPALETTE (Basierend auf dem Logo) --- */
    
    /* Die Farbe der Kristalle und der Schrift-Highlights */
    --primary: #00e5ff;      /* Leuchtendes Cyan/Eisblau */
    --primary-dark: #00b0c7; /* Dunkleres Cyan für Hover-Effekte */
    
    /* Die Farbe des Stein-Rahmens und der Runen */
    --accent: #607d8b;       /* Kühles Stein-Grau/Blau */
    --accent-glow: #cfd8dc;  /* Helles Silber für Highlights */
    
    /* Hintergrund: Nicht mehr reines Schwarz, sondern sehr tiefes Nachtblau */
    --bg-dark: #05070a;      
    --bg-light: #0f1419;     
    
    --text: #e0f7fa;         /* Ein sehr helles, kühles Weiß */
    
    /* Glas-Effekt mit leichtem Blaustich */
    --glass: rgba(15, 20, 25, 0.9);
    
    /* Der Glow ist jetzt Eisblau statt Gold */
    --border-glow: rgba(0, 229, 255, 0.4);
}

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

body {
    font-family: 'Lato', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text);
    overflow-x: hidden;
    min-height: 100vh;
}

/* Custom Scrollbar (Frost Look) */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg-dark); }
::-webkit-scrollbar-thumb { 
    background: #263238; 
    border-radius: 5px; 
    border: 1px solid rgba(0, 229, 255, 0.2); 
}
::-webkit-scrollbar-thumb:hover { background: var(--primary-dark); }

/* Typografie */
h1, h2, h3, .logo { font-family: 'Cinzel', serif; text-transform: uppercase; }

/* --- APP SPECIFIC UTILITIES --- */
.hidden { display: none !important; }

/* --- LOGIN SCREEN --- */
.login-screen {
    position: fixed;
    inset: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    background: var(--bg-dark);
    z-index: 2000;
}

/* Background for login */
.login-bg {
    position: absolute;
    inset: 0;
    background: url('img/bg.png') no-repeat center center/cover;
    opacity: 0.3;
    z-index: -1;
}

.login-box {
    background: var(--glass);
    backdrop-filter: blur(15px);
    padding: 40px;
    border-radius: 12px;
    width: 100%;
    max-width: 400px;
    border: 1px solid rgba(0, 229, 255, 0.2);
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.8);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.login-box h2 {
    color: var(--text);
    margin-bottom: 5px;
    font-size: 1.8rem;
    text-shadow: 0 0 10px rgba(0, 229, 255, 0.5);
}

.subtitle {
    color: var(--accent-glow);
    font-size: 0.9rem;
    margin-bottom: 25px;
    font-weight: 300;
}

.form-group { margin-bottom: 20px; text-align: left; }
.form-group label { display: block; margin-bottom: 8px; color: var(--accent-glow); font-size: 0.9rem; }
.form-group select, .form-group input {
    width: 100%;
    padding: 12px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    color: var(--text);
    font-family: inherit;
    transition: 0.3s;
}
.form-group select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 10px rgba(0, 229, 255, 0.2); }

/* Code Box */
.code-box {
    background: rgba(0, 0, 0, 0.6);
    border: 1px dashed var(--primary);
    color: var(--primary);
    padding: 15px;
    font-family: 'Courier New', monospace;
    font-size: 1.2rem;
    text-align: center;
    border-radius: 5px;
    cursor: pointer;
    transition: 0.3s;
    margin: 10px 0;
    user-select: all;
}
.code-box:hover { background: rgba(0, 229, 255, 0.1); box-shadow: 0 0 15px rgba(0, 229, 255, 0.2); }
.code-box.copied { border-color: #00e676; color: #00e676; }

.help-text { font-size: 0.85rem; color: #888; margin-top: 5px; }
.verification-success { color: #00e676 !important; }
.verification-pending { color: #ffb74d !important; }

/* Buttons */
.btn-primary { 
    background: var(--primary); color: #000;
    padding: 15px 35px; border-radius: 5px; text-decoration: none; font-weight: 900; 
    box-shadow: 0 4px 15px rgba(0, 229, 255, 0.4); 
    transition: transform 0.2s, background 0.2s; position: relative; overflow: hidden;
    border: none; cursor: pointer; width: 100%; display: block;
    font-family: 'Lato', sans-serif;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; box-shadow: none; }
.btn-primary:hover:not(:disabled) { background: var(--primary-dark); transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0, 229, 255, 0.6); color: white; }

/* --- MAIN APP LAYOUT --- */
.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: var(--glass);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}

.logo-area { display: flex; align-items: center; gap: 15px; }
.logo-area img { width: 40px; border-radius: 8px; box-shadow: 0 0 10px rgba(0, 229, 255, 0.3); }
.logo-area h1 { font-size: 1.5rem; margin: 0; color: var(--text); text-shadow: 0 0 10px rgba(0, 229, 255, 0.3); }

.status-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(0, 0, 0, 0.3);
    padding: 8px 15px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.9rem;
}

.status-dot {
    width: 10px; height: 10px; border-radius: 50%;
    background: #ff5252;
    box-shadow: 0 0 10px #ff5252;
    transition: 0.3s;
}
.status-dot.connected { background: #00e676; box-shadow: 0 0 10px #00e676; }
.ping { color: var(--accent-glow); font-family: monospace; font-size: 0.8rem; opacity: 0.7; }

.app-grid {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 20px;
    flex: 1;
}
@media (max-width: 800px) { .app-grid { grid-template-columns: 1fr; } }

/* Panels */
.glass-panel {
    background: var(--glass);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 25px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
    position: relative;
    overflow: hidden;
}

.glass-panel::before {
    content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    opacity: 0.5;
}

.panel-title {
    font-family: 'Cinzel', serif;
    color: var(--primary);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 15px;
    margin-bottom: 20px;
    font-size: 1.2rem;
    letter-spacing: 1px;
}

/* Users List */
.users-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 200px;
}

.empty-state {
    text-align: center;
    color: var(--accent);
    padding: 40px;
    font-style: italic;
}

.user-item {
    background: rgba(255, 255, 255, 0.03);
    padding: 15px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    border: 1px solid transparent;
    transition: 0.3s;
}
.user-item:hover { background: rgba(255, 255, 255, 0.05); }
.user-item.speaking {
    border-color: var(--primary);
    background: rgba(0, 229, 255, 0.05);
    box-shadow: 0 0 15px rgba(0, 229, 255, 0.1);
}
.user-item.self { border-left: 3px solid var(--accent); }

.user-info { flex: 1; }
.user-name { font-weight: bold; color: var(--text); font-size: 1rem; }
.user-name .tag { font-size: 0.8em; color: var(--primary); opacity: 0.8; margin-left: 5px; }

.user-volume { width: 80px; }

/* Controls */
.control-group { margin-bottom: 25px; }
.control-group label { display: block; margin-bottom: 10px; color: var(--accent-glow); font-size: 0.9rem; }

.slider-row {
    display: flex;
    align-items: center;
    gap: 15px;
}
.slider-row span {
    font-family: monospace;
    color: var(--primary);
    min-width: 45px;
    text-align: right;
}

input[type="range"] {
    flex: 1;
    -webkit-appearance: none;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    outline: none;
}
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px; height: 16px;
    background: var(--primary);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px var(--primary);
    transition: 0.2s;
}
input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.2); }

/* Meter */
.meter {
    height: 6px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 3px;
    margin-top: 15px;
    position: relative;
    overflow: hidden;
}
.meter-fill {
    position: absolute; left: 0; top: 0;
    height: 100%;
    background: var(--primary);
    width: 0%;
    transition: width 0.05s;
    box-shadow: 0 0 10px var(--primary);
}
.meter-threshold {
    position: absolute; top: 0; bottom: 0; width: 2px; background: #ff5252;
    z-index: 2;
}

/* Toggle Buttons */
.button-row { display: flex; gap: 10px; margin-top: 10px; }
.btn-toggle {
    flex: 1;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text);
    border-radius: 6px;
    cursor: pointer;
    transition: 0.3s;
    font-weight: bold;
    font-family: 'Lato', sans-serif;
}
.btn-toggle:hover { background: rgba(255, 255, 255, 0.1); border-color: var(--accent); }
.btn-toggle.active {
    background: rgba(255, 82, 82, 0.15);
    border-color: #ff5252;
    color: #ff5252;
    box-shadow: 0 0 15px rgba(255, 82, 82, 0.2);
}

/* Footer */
.app-footer {
    text-align: center;
    padding: 20px;
    color: var(--accent);
    font-size: 0.85rem;
    margin-top: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}
.app-footer p { margin: 0; }
