/* ===== AuraCall — Apple / macOS tasarım dili ===== */

:root {
  --blue: #0A84FF;
  --blue-hover: #339DFF;
  --red: #FF453A;
  --green: #30D158;
  --bg: #0d0d10;
  --panel: rgba(28, 28, 32, 0.72);
  --panel-solid: #1c1c20;
  --stroke: rgba(255, 255, 255, 0.09);
  --text: rgba(255, 255, 255, 0.92);
  --text-dim: rgba(255, 255, 255, 0.55);
  --text-faint: rgba(255, 255, 255, 0.32);
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
}

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

html, body {
  height: 100%;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
    "Segoe UI Variable Display", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  user-select: none;
}

/* Arka plan degrade — macOS Sonoma havası */
.backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(1200px 800px at 15% -10%, rgba(10, 132, 255, 0.22), transparent 60%),
    radial-gradient(1000px 700px at 110% 110%, rgba(94, 92, 230, 0.20), transparent 60%),
    radial-gradient(800px 600px at 80% 0%, rgba(255, 55, 95, 0.10), transparent 55%),
    var(--bg);
}

/* Electron pencere sürükleme bölgesi */
.drag-region {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 140px;
  height: 40px;
  z-index: 1000;
  -webkit-app-region: drag;
}
body.electron .drag-region { display: block; }

.glass {
  background: var(--panel);
  backdrop-filter: blur(28px) saturate(1.6);
  -webkit-backdrop-filter: blur(28px) saturate(1.6);
  border: 1px solid var(--stroke);
}

.hidden { display: none !important; }

/* ===== Giriş ekranı ===== */
.join-screen {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.join-card {
  width: 380px;
  padding: 44px 36px 32px;
  border-radius: 26px;
  text-align: center;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.5);
  animation: pop-in 0.45s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}

@keyframes pop-in {
  from { opacity: 0; transform: scale(0.94) translateY(14px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.app-icon {
  width: 76px;
  height: 76px;
  margin: 0 auto 18px;
  border-radius: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, #0A84FF, #5E5CE6);
  box-shadow: 0 10px 30px rgba(10, 132, 255, 0.35), inset 0 1px 0 rgba(255,255,255,0.25);
}
.app-icon svg { width: 36px; height: 36px; color: #fff; }

.join-card h1 {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.subtitle {
  margin-top: 6px;
  margin-bottom: 28px;
  color: var(--text-dim);
  font-size: 14px;
}

.join-card form { display: flex; flex-direction: column; gap: 12px; }

.join-card input {
  height: 46px;
  padding: 0 16px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}
.join-card input::placeholder { color: var(--text-faint); }
.join-card input:focus {
  border-color: var(--blue);
  background: rgba(255, 255, 255, 0.09);
  box-shadow: 0 0 0 4px rgba(10, 132, 255, 0.22);
}

.btn-primary {
  height: 46px;
  margin-top: 6px;
  border: none;
  border-radius: 12px;
  background: var(--blue);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}
.btn-primary:hover { background: var(--blue-hover); }
.btn-primary:active { transform: scale(0.97); }

.hint {
  margin-top: 20px;
  font-size: 12px;
  color: var(--text-faint);
}

/* ===== Uygulama düzeni ===== */
.app-screen {
  height: 100%;
  display: grid;
  grid-template-columns: 260px 1fr 320px;
  gap: 14px;
  padding: 14px;
}
body.electron .app-screen { padding-top: 44px; }

/* --- Kenar çubuğu --- */
.sidebar {
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.room-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 18px 14px;
  border-bottom: 1px solid var(--stroke);
}

.room-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 10px rgba(48, 209, 88, 0.7);
  flex-shrink: 0;
}

.room-info { display: flex; flex-direction: column; min-width: 0; }
.room-label { font-size: 10px; font-weight: 700; letter-spacing: 1px; color: var(--text-faint); }
.room-name {
  font-size: 16px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.participants-label {
  padding: 16px 18px 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: var(--text-faint);
}

.participants {
  flex: 1;
  overflow-y: auto;
  padding: 0 10px;
}

.participant {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: var(--radius-sm);
  transition: background 0.15s;
}
.participant:hover { background: rgba(255, 255, 255, 0.05); }

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 0 0 2px transparent;
  transition: box-shadow 0.12s;
}
.avatar.small { width: 30px; height: 30px; font-size: 13px; }

.participant.speaking .avatar,
.self-info.speaking .avatar {
  box-shadow: 0 0 0 2.5px var(--green);
}

.participant .p-name {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.p-badges { display: flex; gap: 6px; align-items: center; }
.p-badges svg { width: 14px; height: 14px; }
.badge-muted { color: var(--red); display: none; }
.badge-sharing { color: var(--blue); display: none; }
.participant.is-muted .badge-muted { display: block; }
.participant.is-sharing .badge-sharing { display: block; }

.self-bar {
  padding: 12px 14px;
  border-top: 1px solid var(--stroke);
  background: rgba(0, 0, 0, 0.18);
}

.self-info { display: flex; align-items: center; gap: 10px; }
.self-text { display: flex; flex-direction: column; min-width: 0; }
.self-name {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.self-status { font-size: 11px; color: var(--green); }

/* --- Sahne (orta alan) --- */
.stage {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.video-grid {
  flex: 1;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  align-content: center;
  overflow-y: auto;
  padding-bottom: 90px;
}

.video-tile {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #000;
  border: 1px solid var(--stroke);
  aspect-ratio: 16 / 9;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45);
  animation: pop-in 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.15);
}

.video-tile video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

.video-tile .tile-label {
  position: absolute;
  left: 12px;
  bottom: 12px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  background: rgba(20, 20, 24, 0.65);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.empty-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text-faint);
  padding-bottom: 90px;
}
.empty-stage svg { width: 52px; height: 52px; margin-bottom: 8px; opacity: 0.5; }
.empty-stage h2 { font-size: 19px; font-weight: 600; color: var(--text-dim); letter-spacing: -0.3px; }
.empty-stage p { font-size: 13px; }
.empty-stage.hidden { display: none; }

/* --- Kontrol çubuğu --- */
.control-bar {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 999px;
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.5);
}

.ctrl-btn {
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.10);
  color: var(--text);
  transition: background 0.15s, color 0.15s, transform 0.1s;
}
.ctrl-btn:hover { background: rgba(255, 255, 255, 0.18); }
.ctrl-btn:active { transform: scale(0.92); }
.ctrl-btn svg { width: 21px; height: 21px; }

.ctrl-btn .icon-off { display: none; }
.ctrl-btn:not(.active) { background: rgba(255, 255, 255, 0.92); color: #1c1c20; }
.ctrl-btn:not(.active) .icon-on { display: none; }
.ctrl-btn:not(.active) .icon-off { display: block; }

#micBtn:not(.active), #deafenBtn:not(.active) {
  background: var(--red);
  color: #fff;
}

#shareBtn.sharing {
  background: var(--blue);
  color: #fff;
}

.ctrl-btn.danger {
  background: var(--red);
  color: #fff;
}
.ctrl-btn.danger:hover { background: #ff5f55; }

.ctrl-divider {
  width: 1px;
  height: 28px;
  background: var(--stroke);
}

/* --- Sohbet paneli --- */
.chat {
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-header {
  padding: 18px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.3px;
  border-bottom: 1px solid var(--stroke);
}

.messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.msg { display: flex; flex-direction: column; max-width: 88%; }
.msg .msg-meta {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 3px;
  padding: 0 4px;
}
.msg .msg-name { font-size: 12px; font-weight: 600; color: var(--text-dim); }
.msg .msg-time { font-size: 10px; color: var(--text-faint); }

.msg .bubble {
  padding: 9px 14px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.45;
  word-wrap: break-word;
  user-select: text;
  background: rgba(255, 255, 255, 0.09);
  border-bottom-left-radius: 6px;
}

.msg.mine { align-self: flex-end; align-items: flex-end; }
.msg.mine .bubble {
  background: var(--blue);
  color: #fff;
  border-bottom-left-radius: 18px;
  border-bottom-right-radius: 6px;
}

.msg.system {
  align-self: center;
  font-size: 11.5px;
  color: var(--text-faint);
  padding: 2px 0;
}

.chat-input-row {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--stroke);
}

#chatInput {
  flex: 1;
  height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
#chatInput::placeholder { color: var(--text-faint); }
#chatInput:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.2);
}

.send-btn {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, transform 0.1s;
}
.send-btn:hover { background: var(--blue-hover); }
.send-btn:active { transform: scale(0.9); }
.send-btn svg { width: 17px; height: 17px; }

/* Kaydırma çubukları */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.14);
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.24); }

/* Dar ekranlar: sohbeti gizle, mobil web için */
@media (max-width: 980px) {
  .app-screen { grid-template-columns: 220px 1fr; }
  .chat { display: none; }
}
@media (max-width: 640px) {
  .app-screen { grid-template-columns: 1fr; }
  .sidebar { display: none; }
}
