:root {
  --bg: #1a1a2e;
  --bg-secondary: #16213e;
  --bg-tertiary: #0f3460;
  --accent: #e94560;
  --accent-hover: #ff6b81;
  --text: #e8e8e8;
  --text-secondary: #a0a0b0;
  --border: #2a2a4a;
  --window-bg: #1e1e36;
  --window-title: #252545;
  --taskbar-bg: rgba(20, 20, 40, 0.95);
  --shadow: rgba(0, 0, 0, 0.4);
  --success: #2ecc71;
  --warning: #f39c12;
  --danger: #e74c3c;
}

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

body {
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
  height: 100vh;
  user-select: none;
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

input, textarea, button { font-family: inherit; }

/* Login */
#login-overlay {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--bg) 0%, var(--bg-secondary) 50%, var(--bg-tertiary) 100%);
  z-index: 9999;
}

.login-container {
  background: var(--window-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px;
  width: 380px;
  box-shadow: 0 20px 60px var(--shadow);
}

.login-logo { text-align: center; margin-bottom: 30px; }
.login-logo h1 { font-size: 28px; margin-top: 10px; color: var(--text); }
.login-logo p { color: var(--text-secondary); font-size: 14px; }

.login-tabs { display: flex; gap: 0; margin-bottom: 20px; border-radius: 8px; overflow: hidden; border: 1px solid var(--border); }
.login-tab { flex: 1; padding: 10px; background: transparent; color: var(--text-secondary); border: none; cursor: pointer; font-size: 14px; transition: all 0.2s; }
.login-tab.active { background: var(--accent); color: white; }
.login-tab:hover:not(.active) { background: var(--border); }

.login-container input {
  width: 100%; padding: 12px 16px; margin-bottom: 12px;
  background: var(--bg); border: 1px solid var(--border); border-radius: 8px;
  color: var(--text); font-size: 14px; outline: none; transition: border 0.2s;
}
.login-container input:focus { border-color: var(--accent); }

.login-btn {
  width: 100%; padding: 12px; background: var(--accent); color: white;
  border: none; border-radius: 8px; font-size: 16px; cursor: pointer;
  font-weight: 600; transition: background 0.2s; margin-top: 4px;
}
.login-btn:hover { background: var(--accent-hover); }

.login-error { color: var(--danger); font-size: 13px; margin-top: 10px; text-align: center; min-height: 20px; }

/* Chat */
.chat-layout { display: flex; height: 100%; }
.chat-sidebar { width: 220px; border-right: 1px solid var(--border); display: flex; flex-direction: column; }
.chat-sidebar-header { padding: 10px 12px; font-size: 12px; font-weight: 600; text-transform: uppercase; color: var(--text-secondary); border-bottom: 1px solid var(--border); }
#chat-conv-list { flex: 1; overflow-y: auto; }
.chat-conv-item { padding: 10px 12px; cursor: pointer; border-bottom: 1px solid var(--border); transition: background 0.15s; }
.chat-conv-item:hover { background: var(--bg); }
.chat-conv-item.active { background: var(--bg-tertiary); }
.chat-conv-name { font-size: 13px; font-weight: 600; }
.chat-conv-preview { font-size: 11px; color: var(--text-secondary); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-main { flex: 1; display: flex; flex-direction: column; }
#chat-messages { flex: 1; overflow-y: auto; padding: 12px; }
.chat-empty { display: flex; align-items: center; justify-content: center; height: 100%; color: var(--text-secondary); font-size: 13px; text-align: center; padding: 20px; }
.chat-msg { margin-bottom: 10px; display: flex; flex-direction: column; }
.chat-msg.user { align-items: flex-start; }
.chat-msg.admin { align-items: flex-end; }
.chat-bubble { max-width: 80%; padding: 8px 14px; border-radius: 14px; font-size: 13px; line-height: 1.4; word-break: break-word; display: flex; align-items: center; gap: 4px; }
.chat-msg.user .chat-bubble { background: var(--bg-tertiary); color: var(--text); border-bottom-left-radius: 4px; }
.chat-msg.admin .chat-bubble { background: var(--accent); color: white; border-bottom-right-radius: 4px; }
.chat-time { font-size: 10px; color: var(--text-secondary); margin-top: 3px; padding: 0 4px; }
.chat-input-bar { display: flex; padding: 10px; border-top: 1px solid var(--border); background: var(--window-bg); gap: 8px; }
.chat-input-bar input { flex: 1; padding: 10px 14px; background: var(--bg); border: 1px solid var(--border); border-radius: 20px; color: var(--text); outline: none; font-size: 13px; }
.chat-input-bar input:focus { border-color: var(--accent); }
.chat-input-bar button { width: 38px; height: 38px; border-radius: 50%; background: var(--accent); color: white; border: none; cursor: pointer; font-size: 14px; display: flex; align-items: center; justify-content: center; transition: background 0.2s; }
.chat-input-bar button:hover { background: var(--accent-hover); }
.chat-msg-actions { display: none; margin-left: 8px; flex-shrink: 0; }
.chat-bubble:hover .chat-msg-actions { display: inline-flex; gap: 2px; }
.chat-btn-icon { background: none; border: none; color: var(--text-secondary); cursor: pointer; font-size: 11px; padding: 2px; opacity: 0.7; }
.chat-btn-icon:hover { opacity: 1; color: var(--text); }

/* Media Player */
.mp-wrap {
  position: relative; width: 100%; height: 100%; display: flex; flex-direction: column; overflow: hidden;
}
.mp-video-wrap { background: #000; }
.mp-audio-wrap { background: linear-gradient(135deg, var(--bg) 0%, var(--bg-secondary) 100%); align-items: center; justify-content: center; gap: 0; }
.mp-el { width: 100%; flex: 1; object-fit: contain; min-height: 0; }
.mp-overlay {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.4); transition: opacity 0.3s; cursor: pointer;
}
.mp-overlay:hover { background: rgba(0,0,0,0.3); }
.mp-btn-big {
  width: 64px; height: 64px; border-radius: 50%; background: var(--accent); color: white;
  border: none; font-size: 24px; cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: transform 0.2s; padding-left: 4px;
}
.mp-btn-big:hover { transform: scale(1.1); }
.mp-controls {
  display: flex; align-items: center; gap: 8px; padding: 8px 12px;
  background: rgba(0,0,0,0.9); flex-shrink: 0; position: relative; z-index: 2;
}
.mp-btn {
  background: none; border: none; color: white; cursor: pointer; font-size: 14px;
  width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; border-radius: 4px;
}
.mp-btn:hover { background: rgba(255,255,255,0.1); }
.mp-time { font-size: 12px; color: #ccc; min-width: 36px; font-variant-numeric: tabular-nums; }
.mp-bar-wrap { flex: 1; height: 24px; display: flex; align-items: center; cursor: pointer; min-width: 60px; }
.mp-vol-wrap { flex: 0 0 80px; }
.mp-bar-track { width: 100%; height: 8px; background: rgba(255,255,255,0.15); border-radius: 4px; position: relative; border: 1px solid rgba(255,255,255,0.1); }
.mp-bar-fill, .mp-fill { height: 100%; background: var(--accent); border-radius: 3px; width: 0%; transition: width 0.15s linear; }
.mp-bar-wrap:hover .mp-bar-track { height: 10px; }
.mp-vol-fill { height: 100%; background: var(--accent); border-radius: 3px; transition: width 0.1s linear; }
.mp-seek-bar .mp-bar-track { background: rgba(255,255,255,0.25); }

.mp-art {
  width: 100px; height: 100px; border-radius: 50%; background: var(--bg-tertiary);
  display: flex; align-items: center; justify-content: center; font-size: 40px;
  color: var(--accent); margin-top: 20px; box-shadow: 0 0 30px rgba(233,69,96,0.2);
}
.mp-info { margin-top: 16px; text-align: center; }
.mp-song-title { color: white; font-size: 16px; font-weight: 600; max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mp-visualizer {
  display: flex; align-items: flex-end; gap: 3px; height: 40px; margin: 16px 0 8px;
}
.mp-viz-bar {
  width: 6px; background: var(--accent); border-radius: 3px 3px 0 0; height: 8px;
  animation: mpViz 0.8s ease-in-out infinite alternate;
}
.mp-viz-bar:nth-child(odd) { animation-delay: -0.4s; }
.mp-viz-bar:nth-child(3n) { animation-delay: -0.2s; }
.mp-viz-bar:nth-child(5n+2) { animation-delay: -0.6s; }
@keyframes mpViz {
  0% { height: 6px; opacity: 0.4; }
  100% { height: 36px; opacity: 1; }
}
