@import url('https://fonts.googleapis.com/css2?family=gg+sans:wght@400;500;600;700&display=swap');
/* Discord-a bənzər font üçün gg sans əvəzinə modern font (gg sans public deyil deyə oxşar istifadə edirik) */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@500;600;700&family=Plus+Jakarta+Sans:wght@400;500;600&display=swap');

:root {
  /* Discord Dark Theme Rəngləri */
  --bg-rail: #1E1F22;      /* Sol server paneli */
  --bg-sidebar: #2B2D31;   /* Kanallar paneli */
  --bg-chat: #313338;      /* Əsas çat və mesajlar */
  --bg-hover: #3F4147;     /* Üzərinə gələndə */
  --bg-input: #383A40;     /* Mesaj yazma qutusu */
  
  --line: #1F2023;
  --txt: #DBDEE1;          /* Normal mətn */
  --txt-dim: #B5BAC1;      /* Başlıqlar */
  --txt-mute: #949BA4;     /* Sönük mətn */
  
  --accent: #5865F2;       /* Discord Blurple */
  --accent-hover: #4752C4;
  --accent-2: #FEE75C;     /* Qızılı/VIP */
  --green: #23A559;
  --danger: #DA373C;
  
  --radius: 8px;
  --shadow: 0 8px 16px rgba(0,0,0,0.24);
  --display: 'Outfit', system-ui, sans-serif;
  --body: 'Plus Jakarta Sans', system-ui, sans-serif;
}

* { box-sizing: border-box; outline: none; }
html, body { height: 100%; margin: 0; padding: 0; }
body {
  font-family: var(--body); color: var(--txt); background: var(--bg-chat);
  -webkit-font-smoothing: antialiased; overflow: hidden;
  display: flex; flex-direction: row; font-size: 15px;
}
button, input, select, textarea { font-family: inherit; color: inherit; border: none; background: none; }
button { cursor: pointer; border-radius: 4px; transition: 0.2s ease; }
a { color: var(--accent); text-decoration: none; }

/* Skrol */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #1A1B1E; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #111214; }

/* Düymələr */
.btn-primary { background: var(--accent); color: #fff; padding: 10px 16px; font-weight: 500; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary.small { padding: 6px 12px; font-size: 14px; }
.danger { background: var(--danger); color: #fff; }
.danger:hover { background: #c92f33; }
.ghost-btn { color: var(--txt-mute); padding: 6px; border-radius: 4px; }
.ghost-btn:hover { color: var(--txt); background: var(--bg-hover); }

/* --- STRUKTUR --- */
#app { display: flex; width: 100vw; height: 100vh; position: relative; overflow: hidden; }

/* 1. Server Paneli (Rail) */
.rail { width: 72px; min-width: 72px; background: var(--bg-rail); display: flex; flex-direction: column; align-items: center; padding: 12px 0; gap: 8px; z-index: 50; overflow-y: auto; }
.rail-btn { width: 48px; height: 48px; border-radius: 24px; background: var(--bg-chat); display: grid; place-items: center; font-size: 16px; font-weight: 600; transition: 0.2s all; color: var(--txt); overflow: hidden; }
.rail-btn:hover { border-radius: 16px; background: var(--accent); color: #fff; }
.rail-btn.active { border-radius: 16px; background: var(--accent); color: #fff; position: relative; }
.rail-btn.active::before { content: ''; position: absolute; left: -4px; top: 10px; bottom: 10px; width: 8px; background: #fff; border-radius: 4px; }
.rail-btn img { width: 100%; height: 100%; object-fit: cover; }
.rail-sep { width: 32px; height: 2px; background: var(--bg-hover); border-radius: 1px; margin: 4px 0; }

/* 2. Sidebar (Kanallar) */
.sidebar { width: 240px; min-width: 240px; background: var(--bg-sidebar); display: flex; flex-direction: column; z-index: 40; transition: transform 0.3s ease; }
.sidebar-header { height: 48px; min-height: 48px; display: flex; align-items: center; justify-content: space-between; padding: 0 16px; border-bottom: 1px solid var(--line); font-weight: 600; font-family: var(--display); cursor: pointer; transition: background 0.2s; }
.sidebar-header:hover { background: var(--bg-hover); }
#serverBanner { width: 100%; height: 100px; object-fit: cover; display: block; }
.chan-list { flex: 1; overflow-y: auto; padding: 12px 8px; }
.cat-label { font-size: 12px; font-weight: 600; color: var(--txt-mute); text-transform: uppercase; margin: 16px 8px 4px; display: flex; justify-content: space-between; align-items: center; }
.cat-label button { color: var(--txt-mute); font-size: 14px; }
.cat-label button:hover { color: var(--txt); }
.chan { display: flex; align-items: center; gap: 8px; padding: 6px 8px; margin-bottom: 2px; border-radius: var(--radius); cursor: pointer; color: var(--txt-mute); font-weight: 500; }
.chan:hover { background: var(--bg-hover); color: var(--txt); }
.chan.active { background: rgba(255,255,255,0.06); color: #fff; }
.chan-edit { margin-left: auto; display: none; }
.chan:hover .chan-edit { display: flex; gap: 4px; }

/* Profil Açıq Paneli (Sol alt) */
.user-panel { height: 52px; background: #232428; display: flex; align-items: center; padding: 0 8px; gap: 8px; }
.user-panel .info { flex: 1; overflow: hidden; white-space: nowrap; }
.user-panel .info .nm { font-size: 14px; font-weight: 600; }
.user-panel .info .st { font-size: 12px; color: var(--txt-mute); }

/* 3. Əsas Məzmun (Chat) */
.main { flex: 1; display: flex; flex-direction: column; background: var(--bg-chat); position: relative; min-width: 0; }
.top-bar { height: 48px; min-height: 48px; border-bottom: 1px solid var(--line); display: flex; align-items: center; padding: 0 16px; font-weight: 600; gap: 8px; font-family: var(--display); font-size: 16px; }
.top-icons { margin-left: auto; display: flex; gap: 16px; color: var(--txt-dim); } /* İkonlar sağda */
.top-icons button { font-size: 18px; color: inherit; }
.top-icons button:hover { color: var(--txt); }

/* Mesajlar */
.chat-area { flex: 1; overflow-y: auto; padding: 16px 0; display: flex; flex-direction: column; gap: 16px; }
.msg { display: flex; gap: 16px; padding: 4px 16px; }
.msg:hover { background: #2e3035; }
.msg .body { flex: 1; min-width: 0; }
.msg .who { font-weight: 600; color: #fff; margin-right: 8px; cursor: pointer; }
.msg .who:hover { text-decoration: underline; }
.msg .time { font-size: 12px; color: var(--txt-mute); }
.msg .text { margin-top: 4px; line-height: 1.5; color: var(--txt); word-wrap: break-word; }
.msg-img { max-width: 340px; max-height: 320px; border-radius: 8px; margin-top: 8px; cursor: pointer; border: 1px solid var(--line); }

/* Composer (Mesaj Qutusu) */
.composer { padding: 0 16px 24px; }
.comp-inner { background: var(--bg-input); border-radius: 8px; display: flex; align-items: center; padding: 8px 16px; gap: 12px; }
.comp-inner input { flex: 1; background: transparent; color: var(--txt); font-size: 15px; }
.comp-inner input::placeholder { color: var(--txt-mute); }
.attach-btn { color: var(--txt-dim); font-size: 20px; width: 32px; height: 32px; border-radius: 16px; display: grid; place-items: center; background: var(--bg-hover); }
.attach-btn:hover { color: var(--txt); background: var(--txt-mute); }

/* 4. Sağ Panel (Üzvlər) */
.members-panel { width: 240px; background: var(--bg-sidebar); border-left: 1px solid var(--line); display: flex; flex-direction: column; z-index: 30; transition: transform 0.3s ease; }
.members-title { padding: 24px 16px 8px; font-size: 12px; font-weight: 700; color: var(--txt-mute); text-transform: uppercase; }
.member { display: flex; align-items: center; gap: 12px; padding: 8px 16px; cursor: pointer; border-radius: 4px; margin: 0 8px; }
.member:hover { background: var(--bg-hover); }
.member .nm { font-weight: 500; color: var(--txt-dim); display: flex; align-items: center; gap: 6px; }
.member:hover .nm { color: var(--txt); }
.member .rl { font-size: 11px; font-weight: 600; text-transform: uppercase; padding: 2px 6px; border-radius: 4px; display: inline-block; margin-top: 4px; }
.rl.owner { background: rgba(218,55,60,0.15); color: var(--danger); }
.rl.admin { background: rgba(88,101,242,0.15); color: var(--accent); }

/* --- SƏS/VİDEO (STAGE) --- */
.stage { flex: 1; display: flex; flex-direction: column; background: #000; padding: 16px; overflow: hidden; }
.vgrid { flex: 1; display: flex; flex-wrap: wrap; gap: 16px; justify-content: center; align-items: center; }
.tile { flex: 1 1 300px; max-width: 100%; aspect-ratio: 16/9; background: var(--bg-sidebar); border-radius: 12px; overflow: hidden; position: relative; display: flex; justify-content: center; align-items: center; border: 2px solid transparent; cursor: pointer; transition: 0.2s ease; }
.tile.speaking { border-color: var(--green); box-shadow: 0 0 10px rgba(35,165,89,0.5); }
.tile video { width: 100%; height: 100%; object-fit: cover; }
.tile-name { position: absolute; bottom: 8px; left: 8px; background: rgba(0,0,0,0.6); padding: 4px 8px; border-radius: 6px; font-size: 13px; font-weight: 600; }
.tile-flag { position: absolute; top: 8px; right: 8px; background: rgba(218,55,60,0.8); padding: 4px 6px; border-radius: 6px; font-size: 12px; }

/* EKranı böyütmək üçün */
.tile.fullscreen { position: fixed; inset: 20px; z-index: 100; max-height: calc(100vh - 40px); max-width: calc(100vw - 40px); box-shadow: 0 10px 50px rgba(0,0,0,0.9); margin: auto; background: var(--bg-1); }

/* Alt Media Bar */
.media-bar { height: 60px; background: #18191c; display: flex; align-items: center; justify-content: center; gap: 12px; padding: 0 16px; }
.media-btn { width: 44px; height: 44px; border-radius: 22px; background: var(--bg-hover); color: var(--txt); font-size: 18px; display: grid; place-items: center; }
.media-btn:hover { background: #4e5058; }
.media-btn.active { background: #fff; color: #000; }
.media-btn.danger { background: var(--danger); color: #fff; }
.media-btn.danger:hover { background: #c92f33; }

/* --- VIP (BOOSTER) ÇƏRÇİVƏ ANIMASİYASI --- */
.frame-wrap.booster { position: relative; z-index: 1; }
.frame-wrap.booster::before { content: ''; position: absolute; inset: -3px; z-index: -1; border-radius: 50%; background: linear-gradient(45deg, #ff6b5e, #ffb05e, #46c08b, #ff6b5e); background-size: 300% 300%; animation: gradientSpin 3s ease infinite; }
.frame-wrap.booster img, .frame-wrap.booster::after { border: 2px solid var(--bg-sidebar); }
@keyframes gradientSpin { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }

/* Avatarlar */
.av { width: 40px; height: 40px; border-radius: 20px; object-fit: cover; background: var(--accent); display: grid; place-items: center; font-weight: 600; color: #fff; flex-shrink: 0; }
.av img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.tile-av { width: 80px; height: 80px; font-size: 32px; border-radius: 50%; }

/* --- MODALS & KƏŞF ET (DISCOVER) --- */
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,0.8); z-index: 100; display: none; place-items: center; backdrop-filter: blur(4px); }
.modal-bg.show { display: grid; }
.modal { background: var(--bg-chat); width: 90%; max-width: 500px; border-radius: 12px; padding: 24px; box-shadow: var(--shadow); display: none; flex-direction: column; gap: 16px; }
.modal.show { display: flex; }
.modal h2 { margin: 0; font-family: var(--display); font-size: 20px; text-align: center; }
.modal input, .modal textarea, .modal select { width: 100%; background: #1E1F22; padding: 12px; border-radius: 8px; font-size: 15px; margin-top: 6px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 8px; }

/* Discover Kəşf Et */
.discover-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; max-height: 60vh; overflow-y: auto; padding-right: 8px; }
.disc-item { background: var(--bg-sidebar); padding: 16px; border-radius: 8px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px; transition: 0.2s; }
.disc-item:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.disc-icon { width: 64px; height: 64px; border-radius: 16px; background: var(--bg-hover); overflow: hidden; display: grid; place-items: center; font-size: 24px; }
.disc-icon img { width: 100%; height: 100%; object-fit: cover; }

/* Toast & Lightbox */
.toast { position: fixed; bottom: -60px; left: 50%; transform: translateX(-50%); background: var(--accent); color: #fff; padding: 12px 24px; border-radius: 24px; font-weight: 600; box-shadow: var(--shadow); transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); z-index: 150; }
.toast.show { bottom: 40px; }
.toast.err { background: var(--danger); }
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,0.9); z-index: 200; display: none; place-items: center; cursor: zoom-out; }
.lightbox.show { display: grid; }
.lightbox img { max-width: 90vw; max-height: 90vh; border-radius: 8px; }

/* Mobil menyu düyməsi (yalnız mobildə görünəcək) */
.mobile-menu-btn { display: none; font-size: 20px; color: var(--txt-dim); padding: 8px; cursor: pointer; }

/* =========================================
   RESPONSİV DİZAYN (Mobil Uyğunlaşma)
========================================= */
@media (max-width: 768px) {
  .mobile-menu-btn { display: block; }
  
  /* Sidebar mobil üçün sola gizlənir */
  .sidebar { position: absolute; left: 72px; top: 0; bottom: 0; transform: translateX(-100%); opacity: 0; pointer-events: none; }
  .sidebar.show { transform: translateX(0); opacity: 1; pointer-events: auto; box-shadow: 10px 0 30px rgba(0,0,0,0.5); }
  
  /* Members mobil üçün sağa gizlənir */
  .members-panel { position: absolute; right: 0; top: 0; bottom: 0; transform: translateX(100%); opacity: 0; pointer-events: none; }
  .members-panel.show { transform: translateX(0); opacity: 1; pointer-events: auto; box-shadow: -10px 0 30px rgba(0,0,0,0.5); }

  /* Məhsul / Discover görünüşü mobildə 2 sütun (2-2) olmalıdır */
  .discover-list { grid-template-columns: 1fr 1fr; gap: 12px; }
  .disc-item { padding: 12px; }
  .disc-icon { width: 48px; height: 48px; font-size: 18px; }
  
  .top-icons { gap: 12px; }
  .rail { width: 60px; min-width: 60px; }
  .rail-btn { width: 40px; height: 40px; border-radius: 20px; }
  .sidebar { left: 60px; }
}