/* ============================================================
   UwU Hook — layout.css
   Ekran kabukları: login sahnesi, dashboard rayı, komut çubuğu,
   özelleştirme paneli, mobil nav, modallar, toast.
   ============================================================ */

/* -------- ekran anahtarı (login ↔ dashboard) -------- */
.screen { display: none; }
.screen.active { display: block; }

/* ============ LOGIN SAHNESİ ============ */
.login-container {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  /* atmosfer: kömürde tek nokta — gradient mesh yerine sessiz spot */
  background:
    radial-gradient(560px 320px at 50% 18%, rgba(255, 255, 255, 0.045), transparent 70%),
    var(--bg);
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 34px 30px 30px;
}

.login-brand { text-align: center; margin-bottom: 26px; }
.login-brand-flower {
  display: inline-grid;
  place-items: center;
  width: 44px; height: 44px;
  border-radius: 14px;
  background: var(--mark);
  color: var(--mark-contrast);
  font-size: 17px;
  margin-bottom: 14px;
}
.login-brand h1 { font-size: 24px; font-weight: 700; letter-spacing: -0.03em; }
.login-brand p {
  margin-top: 5px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.login-step { display: none; }
.login-step.active { display: block; animation: rise .3s cubic-bezier(.22,1,.36,1) both; }

.login-label-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.login-label { font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-dim); }

.btn-demo-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 9px;
  font-size: 10.5px; font-weight: 600;
  color: var(--text-dim);
  background: var(--soft);
  border: 1px solid var(--rule);
  border-radius: 999px;
  cursor: pointer;
  transition: color .15s, border-color .15s;
}
.btn-demo-chip:hover { color: var(--text); border-color: var(--rule-strong); }

.login-input {
  width: 100%;
  padding: 11px 14px;
  font-family: var(--mono);
  font-size: 13.5px;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color .15s;
}
.login-input:focus { border-color: var(--rule-strong); }
.login-input::placeholder { color: var(--text-faint); }

.login-tg-status {
  display: flex; align-items: center; gap: 8px;
  font-size: 11.5px; color: var(--text-dim); line-height: 1.45;
}
.login-tg-status .fab { color: var(--text-dim); }
.login-tg-status a { color: var(--text); font-weight: 600; border-bottom: 1px solid var(--rule-strong); }

.login-step-header { margin-bottom: 16px; }

.code-inputs { display: flex; align-items: center; gap: 7px; margin: 6px 0 16px; }
.code-digit {
  width: 42px; height: 48px;
  text-align: center;
  font-family: var(--mono);
  font-size: 19px; font-weight: 600;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color .15s;
}
.code-digit:focus { border-color: var(--text); }
.code-sep { color: var(--text-faint); font-weight: 700; }

.login-timer-row { margin-bottom: 16px; }
.login-timer-track { height: 3px; background: var(--soft-2); border-radius: 3px; overflow: hidden; }
.login-timer-bar { height: 100%; width: 100%; background: var(--accent); border-radius: 3px; }
.login-timer-text {
  display: flex; justify-content: space-between;
  margin-top: 7px; font-size: 10.5px; color: var(--text-faint); font-family: var(--mono);
}

.login-back-btn {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 12px; padding: 6px 0;
  background: none; border: none;
  font-size: 12px; color: var(--text-dim); cursor: pointer;
}
.login-back-btn:hover { color: var(--text); }

.loader-uwu { display: flex; justify-content: center; gap: 9px; padding: 26px 0 14px; }
.loader-bounce {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--accent);
  animation: bounce 1s infinite ease-in-out;
}
.loader-bounce:nth-child(2) { animation-delay: .12s; }
.loader-bounce:nth-child(3) { animation-delay: .24s; }
@keyframes bounce { 0%, 100% { transform: translateY(0); opacity: .4; } 50% { transform: translateY(-9px); opacity: 1; } }
.loading-text { text-align: center; font-size: 12px; color: var(--text-dim); font-family: var(--mono); }

/* ============ DASHBOARD KABUĞU ============ */
#dashboardScreen.active {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr) 0px;
  gap: 0;
  min-height: 100vh;
}

/* sol ray */
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 20px 14px 16px;
  background: var(--bg-raised);
  border-right: 1px solid var(--rule);
  z-index: 40;
}

.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 2px 6px 18px; border-bottom: 1px solid var(--rule); margin-bottom: 14px; }
.uwu-face-sm {
  display: grid; place-items: center;
  width: 34px; height: 34px; flex: none;
  border-radius: 11px;
  background: var(--mark);
  color: var(--mark-contrast);
  font-size: 13px;
}
.sidebar-brand-text { display: flex; flex-direction: column; min-width: 0; }
.sidebar-title { font-family: var(--display); font-size: 15px; font-weight: 700; letter-spacing: -0.02em; }
.sidebar-sub { font-family: var(--mono); font-size: 9px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-faint); }

.sidebar-menu { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.menu-section-label {
  padding: 10px 10px 6px;
  font-family: var(--mono);
  font-size: 9px; font-weight: 500;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--text-faint);
}
.menu-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 500;
  color: var(--text-dim);
  transition: color .15s, background .15s;
}
.menu-item i { width: 16px; text-align: center; font-size: 13px; }
.menu-item:hover { color: var(--text); background: var(--soft); }
.menu-item.active { color: var(--text); background: var(--soft-2); }
.menu-item.active i { color: var(--accent); }
.menu-pill {
  margin-left: auto;
  font-family: var(--mono); font-size: 9.5px; font-weight: 600;
  color: var(--text-faint);
  background: var(--soft);
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 2px 8px;
}
.menu-item.active .menu-pill { color: var(--text); border-color: var(--rule-strong); }

.sidebar-telemetry { padding: 12px 10px; border-top: 1px solid var(--rule); display: flex; flex-direction: column; gap: 7px; }
.telemetry-row { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-dim); }
.telemetry-val { font-family: var(--mono); font-size: 10.5px; color: var(--text); }

.sidebar-footer { display: flex; align-items: center; gap: 9px; padding: 12px 6px 2px; border-top: 1px solid var(--rule); }
.user-badge { display: flex; align-items: center; gap: 9px; flex: 1; min-width: 0; cursor: pointer; }
.user-avatar {
  width: 30px; height: 30px; flex: none;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--soft-2);
  color: var(--accent); font-size: 11px;
  border: 1px solid var(--rule);
}
.user-info { display: flex; flex-direction: column; min-width: 0; }
.user-name { font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-plan { font-family: var(--mono); font-size: 9.5px; color: var(--text-faint); }
.btn-logout {
  width: 30px; height: 30px; flex: none;
  display: grid; place-items: center;
  border-radius: var(--radius-xs);
  background: none; border: 1px solid var(--rule);
  color: var(--text-dim); font-size: 12px; cursor: pointer;
  transition: color .15s, border-color .15s;
}
.btn-logout:hover { color: var(--danger); border-color: var(--danger); }

/* ana çalışma alanı */
.main-content {
  min-width: 0;
  padding: 18px 26px 40px;
  position: relative;
}

/* üst komut çubuğu */
.top-command-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 0 16px;
}
.cmd-breadcrumb { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-faint); }
.cmd-breadcrumb .fa-terminal { color: var(--accent); }
.cmd-breadcrumb strong { font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text); font-weight: 600; }
.cmd-right { display: flex; align-items: center; gap: 8px; }
.cmd-pill-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 12px;
  font-size: 11.5px; font-weight: 500;
  color: var(--text-dim);
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 999px;
  cursor: pointer;
  transition: color .15s, border-color .15s;
}
.cmd-pill-btn:hover { color: var(--text); border-color: var(--rule-strong); }
.cmd-ping-badge {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 12px;
  font-family: var(--mono); font-size: 10.5px;
  color: var(--text-dim);
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 999px;
}
.pulse-green-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.5);
  animation: ping-dot 2s infinite;
}
@keyframes ping-dot {
  0% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.45); }
  70% { box-shadow: 0 0 0 6px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

/* sayfa konteynerleri */
.page { display: none; }
.page.active { display: block; }
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.page-header h2 { font-size: 20px; display: flex; align-items: center; gap: 9px; }

/* özelleştirme rayı (sağ) */
.customization-sidebar {
  position: fixed;
  top: 14px; right: 14px; bottom: 14px;
  width: 264px;
  background: var(--bg-raised);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  z-index: 60;
  display: flex; flex-direction: column;
  transform: translateX(calc(100% + 20px));
  transition: transform .3s cubic-bezier(.22,1,.36,1);
}
body.custom-open .customization-sidebar { transform: none; }
body.custom-open #dashboardScreen.active { grid-template-columns: 232px minmax(0, 1fr) 288px; }
body.custom-open .main-content { padding-right: 14px; }

.custom-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 16px 12px; border-bottom: 1px solid var(--rule); }
.custom-title { font-size: 13px; display: flex; align-items: center; gap: 8px; }
.btn-custom-collapse {
  width: 26px; height: 26px;
  display: grid; place-items: center;
  background: none; border: 1px solid var(--rule);
  border-radius: var(--radius-xs);
  color: var(--text-dim); font-size: 10px; cursor: pointer;
}
.btn-custom-collapse:hover { color: var(--text); border-color: var(--rule-strong); }

.custom-body { flex: 1; overflow-y: auto; padding: 14px 16px; }
.custom-section { margin-bottom: 20px; }
.custom-section-head {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 9.5px; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--text-faint);
  padding-bottom: 8px;
}
.custom-control-list { display: flex; flex-direction: column; }
.custom-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--soft);
  font-size: 12.5px;
}
.item-title { color: var(--text-dim); }
.custom-footer { padding: 12px 16px; border-top: 1px solid var(--rule); }
.btn-reset-custom {
  width: 100%;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 8px 0;
  background: none; border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  color: var(--text-dim); font-size: 12px; cursor: pointer;
  transition: color .15s, border-color .15s;
}
.btn-reset-custom:hover { color: var(--text); border-color: var(--rule-strong); }

.custom-toggle-fab {
  position: fixed;
  right: 18px; bottom: 18px;
  z-index: 55;
  display: inline-flex; align-items: center; gap: 7px;
  padding: 10px 16px;
  background: var(--mark);
  color: var(--mark-contrast);
  border: none; border-radius: 999px;
  font-size: 12px; font-weight: 600;
  cursor: pointer;
  transition: transform .18s ease;
}
.custom-toggle-fab:hover { transform: translateY(-2px); }
body.custom-open .custom-toggle-fab { display: none; }

/* mobil nav */
.mobile-nav { display: none; }

/* ============ MODALLAR ============ */
.modal-backdrop {
  position: fixed; inset: 0;
  display: none;
  align-items: center; justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 90;
  padding: 20px;
}
.modal-backdrop.open { display: flex; }
.modal-card {
  width: 100%; max-width: 760px;
  max-height: 86vh; overflow-y: auto;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 22px;
  animation: rise .28s cubic-bezier(.22,1,.36,1) both;
}
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.modal-head h3 { font-size: 16px; display: flex; align-items: center; gap: 9px; }
.modal-close {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  background: none; border: 1px solid var(--rule);
  border-radius: var(--radius-xs);
  color: var(--text-dim); font-size: 12px; cursor: pointer;
}
.modal-close:hover { color: var(--text); border-color: var(--rule-strong); }
.modal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 18px; }
.modal-stat {
  padding: 12px 14px;
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
}
.modal-stat-label { font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-faint); margin-bottom: 5px; }
.modal-stat-val { font-size: 13px; font-weight: 500; word-break: break-word; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 6px; }

/* ============ TOAST ============ */
.toast-container {
  position: fixed;
  bottom: 20px; left: 50%;
  transform: translateX(-50%);
  z-index: 120;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  pointer-events: none;
}
.toast {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 10px 16px;
  background: var(--card-3);
  border: 1px solid var(--rule-strong);
  border-radius: 999px;
  font-size: 12.5px; font-weight: 500;
  color: var(--text);
  animation: toast-in .3s cubic-bezier(.22,1,.36,1) both;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
}
.toast.success i { color: var(--success); }
.toast.error i { color: var(--danger); }
.toast.info i { color: var(--info); }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(12px) scale(.97); }
  to   { opacity: 1; transform: none; }
}

/* ============ RESPONSIVE ============ */
@media (max-width: 1100px) {
  #dashboardScreen.active { grid-template-columns: 232px minmax(0, 1fr); }
  .customization-sidebar { width: 260px; }
}

@media (max-width: 860px) {
  #dashboardScreen.active { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: 240px;
    transform: translateX(-100%);
    transition: transform .28s cubic-bezier(.22,1,.36,1);
  }
  body.custom-open .sidebar { transform: none; }
  .main-content { padding: 14px 14px 90px; }
  .customization-sidebar { width: min(320px, 92vw); }
  body.custom-open #dashboardScreen.active { grid-template-columns: minmax(0, 1fr); }

  .mobile-nav {
    display: flex;
    position: fixed;
    left: 12px; right: 12px; bottom: 12px;
    z-index: 70;
    background: var(--card);
    border: 1px solid var(--rule);
    border-radius: var(--radius);
    padding: 7px;
    gap: 4px;
    box-shadow: 0 10px 34px rgba(0, 0, 0, 0.55);
  }
  .mobile-nav-btn {
    flex: 1;
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    padding: 8px 0 6px;
    background: none; border: none; border-radius: var(--radius-sm);
    color: var(--text-faint); font-size: 10px; font-weight: 600;
    cursor: pointer;
  }
  .mobile-nav-btn i { font-size: 14px; }
  .mobile-nav-btn.active { background: var(--soft-2); color: var(--text); }
  .custom-toggle-fab { right: 50%; transform: translateX(50%); bottom: 86px; }
  .modal-grid { grid-template-columns: 1fr; }
}

/* ============ POLISH ============ */

/* sidebar aktif öğe: sol mark çizgisi */
.menu-item.active { box-shadow: inset 2px 0 0 var(--accent); }

/* login: bot linki kendi satırı — bariz erişilebilir */
.login-tg-status {
  padding: 10px 13px;
  background: var(--soft);
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
}
.login-tg-status a { color: var(--text); border-bottom-color: var(--accent); }

/* FAB kaldırıldı — top bar butonu var */
.custom-toggle-fab { display: none !important; }

/* KPI kart hafif dokunuş */
.stat-box { transition: border-color .15s; }
.stat-box:hover { border-color: var(--rule-strong); }

/* toast pointer fix */
.toast { pointer-events: auto; }

/* ---- login giriş sahnesi: kart nefes alarak gelir ---- */
#loginScreen.active .login-card {
  animation: login-in .5s cubic-bezier(.22,1,.36,1) both;
}
@keyframes login-in {
  from { opacity: 0; transform: translateY(14px) scale(.985); }
  to   { opacity: 1; transform: none; }
}
#loginScreen.active .login-brand-flower { box-shadow: 0 0 0 6px var(--soft); }
