/* ═══════════════════════════════════════════════════
   SHARED — Design tokens, reset, scrollbar, nav
   v02
═══════════════════════════════════════════════════ */

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Design Tokens ── */
:root {
  --bg:       #252422;
  --surface:  #2E2C29;
  --surface2: #1C1B19;
  --surface3: #3A3835;
  --border:   rgba(245, 240, 232, 0.09);
  --accent:   #E8007D;
  --accent2:  #F0861A;
  --accent3:  #ff4da6;
  --text:     #F5F0E8;
  --muted:    #8A8680;
  --muted2:   #B5B0A8;
  --green:    #34d399;
  --red:      #f87171;
  --yellow:   #fbbf24;
  --blue:     #60a5fa;
}

/* ── Base ── */
html { color-scheme: dark; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  height: 100%;
  overflow: hidden;
}
#appRoot {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}
#moduleMount {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* ── Form element reset (cross-browser flat rendering) ── */
select, input, textarea, button {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

/* ── Modern scrollbar ── */
* {
  scrollbar-width: none;
  scrollbar-color: transparent transparent;
}
*:hover {
  scrollbar-width: thin;
  scrollbar-color: rgba(245, 240, 232, 0.18) transparent;
}
*::-webkit-scrollbar { width: 5px; height: 5px; background: transparent; }
*::-webkit-scrollbar-thumb { background: rgba(245, 240, 232, 0.18); border-radius: 10px; }
*::-webkit-scrollbar-thumb:hover { background: rgba(245, 240, 232, 0.32); }
*::-webkit-scrollbar-thumb:active { background: var(--accent); }
*::-webkit-scrollbar-track { background: transparent; }

/* ══════════════════════════════════════════════════
   AUTH OVERLAY
══════════════════════════════════════════════════ */
#authOverlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 5500;
  background:
    radial-gradient(ellipse 1200px 800px at 20% 30%, rgba(232, 0, 125, 0.22), transparent 60%),
    radial-gradient(ellipse 900px 700px at 85% 80%,  rgba(240, 134, 26, 0.18), transparent 60%),
    radial-gradient(ellipse 800px 600px at 60% 10%,  rgba(99, 102, 241, 0.10), transparent 50%),
    #08080a;
  animation: authFadeIn .35s ease-out;
}
#authOverlay.is-open { display: flex !important; }
#authOverlay::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(245, 240, 232, .025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(245, 240, 232, .025) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, black, transparent);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, black, transparent);
}

@keyframes authFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes authCardIn {
  from { opacity: 0; transform: translateY(16px) scale(.98); }
  to   { opacity: 1; transform: translateY(0)    scale(1);  }
}

/* Shell */
.auth-shell {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
}

/* Card */
.auth-card {
  width: 880px;
  max-width: 100%;
  max-height: calc(100vh - 64px);
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  background: rgba(20, 20, 24, .68);
  border: 1px solid rgba(245, 240, 232, .08);
  border-radius: 20px;
  overflow: hidden;
  box-shadow:
    0 32px 90px rgba(0, 0, 0, .55),
    0 0 0 1px rgba(232, 0, 125, .05) inset;
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  animation: authCardIn .45s cubic-bezier(.2, .8, .2, 1);
}
@media (max-width: 760px) {
  .auth-card { grid-template-columns: 1fr; max-width: 460px; }
  .auth-brand { display: none !important; }
}

/* Branding panel (left) */
.auth-brand {
  position: relative;
  padding: 40px 36px;
  background:
    linear-gradient(155deg,
      rgba(232, 0, 125, .25)   0%,
      rgba(99, 102, 241, .15) 50%,
      rgba(240, 134, 26, .18) 100%);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
}
.auth-brand::before {
  content: "";
  position: absolute;
  inset: -2px;
  background:
    radial-gradient(circle at 20%  0%, rgba(232, 0, 125, .35), transparent 45%),
    radial-gradient(circle at 80% 100%, rgba(240, 134, 26, .35), transparent 50%);
  filter: blur(40px);
  z-index: 0;
}
.auth-brand-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.auth-logo-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.auth-logo-row svg {
  filter: drop-shadow(0 6px 24px rgba(232, 0, 125, .35));
  flex-shrink: 0;
}
.auth-wordmark {
  font-size: 20px;
  font-weight: 800;
  color: #f5f0e8;
  letter-spacing: -0.03em;
}
.auth-tagline-h {
  font-size: 28px;
  font-weight: 800;
  color: #f5f0e8;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0;
}
.auth-tagline-h em {
  font-style: normal;
  background: linear-gradient(120deg, #ff4da6 0%, #F0861A 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.auth-tagline-p {
  font-size: 13px;
  color: rgba(245, 240, 232, .7);
  line-height: 1.55;
  margin: 0;
  max-width: 280px;
}
.auth-brand-foot {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 11px;
  color: rgba(245, 240, 232, .5);
}
.auth-brand-foot strong {
  color: rgba(245, 240, 232, .85);
  font-weight: 600;
}

/* Form panel (right) */
.auth-form-wrap {
  padding: 44px 44px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: rgba(13, 13, 16, .6);
  overflow-y: auto;
}
.auth-form-wrap h2 {
  margin: 0 0 4px;
  font-size: 22px;
  font-weight: 700;
  color: #f5f0e8;
  letter-spacing: -0.01em;
}
.auth-form-sub {
  font-size: 13px;
  color: rgba(245, 240, 232, .55);
  margin: 0 0 24px;
  line-height: 1.5;
}
.auth-info-callout {
  font-size: 12px;
  color: rgba(245, 240, 232, .85);
  background: rgba(99, 102, 241, .08);
  border: 1px solid rgba(99, 102, 241, .2);
  border-radius: 10px;
  padding: 12px 14px;
  line-height: 1.55;
  margin: 0 0 16px;
}
.auth-info-callout b { color: #c5cae9; }

.auth-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.auth-field label {
  font-size: 11px;
  font-weight: 600;
  color: rgba(245, 240, 232, .55);
  text-transform: uppercase;
  letter-spacing: .6px;
}
.auth-hint {
  font-weight: 400;
  color: rgba(245, 240, 232, .35);
  text-transform: none;
  letter-spacing: 0;
  margin-left: 6px;
}
.auth-input {
  width: 100%;
  background: rgba(20, 20, 24, .8);
  border: 1px solid rgba(245, 240, 232, .12);
  color: #f5f0e8;
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 14px;
  font-family: 'Outfit', sans-serif;
  outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.auth-input::placeholder { color: rgba(245, 240, 232, .3); }
.auth-input:hover  { border-color: rgba(245, 240, 232, .22); }
.auth-input:focus  {
  border-color: rgba(232, 0, 125, .55);
  box-shadow: 0 0 0 3px rgba(232, 0, 125, .15);
  background: rgba(24, 24, 28, .9);
}

.auth-error {
  display: none;
  font-size: 12px;
  color: #ff8a8a;
  background: rgba(239, 68, 68, .08);
  border: 1px solid rgba(239, 68, 68, .25);
  border-radius: 8px;
  padding: 9px 12px;
  margin-bottom: 12px;
}
.auth-error.visible { display: block; }

.auth-remember {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: rgba(245, 240, 232, .6);
  cursor: pointer;
  margin-bottom: 6px;
  user-select: none;
}
/* Global `input { appearance:none }` reset checkbox'ı görünmez yapıyor;
   custom kutu çiz. */
.auth-remember input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  margin: 0;
  border: 1.5px solid rgba(245, 240, 232, .35);
  border-radius: 4px;
  background: rgba(245, 240, 232, .04);
  display: inline-block;
  position: relative;
  flex-shrink: 0;
  transition: all .12s ease;
}
.auth-remember input[type="checkbox"]:hover {
  border-color: var(--accent);
}
.auth-remember input[type="checkbox"]:checked {
  background: var(--accent);
  border-color: var(--accent);
}
.auth-remember input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 0px;
  width: 5px;
  height: 10px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.auth-btn {
  width: 100%;
  padding: 13px 0;
  background: linear-gradient(120deg, #E8007D 0%, #F0861A 100%);
  color: #fff;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  letter-spacing: .3px;
  margin-top: 8px;
  transition: transform .12s ease, box-shadow .15s ease, opacity .15s;
  box-shadow: 0 8px 24px rgba(232, 0, 125, .25);
}
.auth-btn:hover    { transform: translateY(-1px); box-shadow: 0 12px 32px rgba(232, 0, 125, .35); }
.auth-btn:active   { transform: translateY(0);     box-shadow: 0 4px 14px rgba(232, 0, 125, .25); }
.auth-btn:disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }

.auth-meta {
  text-align: center;
  font-size: 11px;
  color: rgba(245, 240, 232, .35);
  margin-top: 18px;
  letter-spacing: .3px;
}

/* ══════════════════════════════════════════════════
   NAV + APP SWITCHER
══════════════════════════════════════════════════ */
nav {
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
  padding: 0 28px;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  flex-shrink: 0;
  backdrop-filter: blur(10px);
}
.logo { display: flex; align-items: center; gap: 10px; }
.logo-text { font-size: 15px; font-weight: 700; color: var(--text); }
.logo-text span { color: var(--muted); font-weight: 400; }
.nav-r { display: flex; align-items: center; gap: 12px; }

/* App switcher içindeki ayraç — 3 ana modül ile 5 icon-only modül arasında */
.app-sw-divider {
  display: inline-block;
  width: 1px;
  height: 20px;
  background: var(--border);
  margin: 0 4px;
}

/* App Switcher */
.app-sw-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: 8px;
  border: 1px solid transparent; background: transparent;
  color: var(--muted); font-size: 12px; font-weight: 600;
  cursor: pointer; transition: all .15s;
  font-family: 'Outfit', sans-serif; white-space: nowrap;
}
.app-sw-btn:hover { color: var(--text); background: rgba(255,255,255,.05); }
.app-sw-btn.app-sw-asset.app-sw-active { background: rgba(240,134,26,.1); border-color: rgba(240,134,26,.35); color: #F0861A; }
.app-sw-btn.app-sw-task.app-sw-active  { background: rgba(99,102,241,.1);  border-color: rgba(99,102,241,.35);  color: #818CF8; }

/* Icon-only varyant — text gizli, kare buton, native title tooltip aktif */
.app-sw-btn.app-sw-icon-only {
  padding: 0;
  width: 30px;
  height: 30px;
  justify-content: center;
  gap: 0;
  font-size: 0;            /* metin gizle, sadece SVG kalır */
}
.app-sw-btn.app-sw-icon-only svg {
  width: 15px;
  height: 15px;
}

/* Chatbot / Go button */
.app-go-btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 6px; width: 30px; height: 30px;
  border-radius: 999px; border: 1px dashed rgba(245,240,232,.18);
  background: transparent; color: var(--muted); cursor: pointer; transition: all .15s;
}
.app-go-btn:hover { background: rgba(232,0,125,.08); border-color: rgba(232,0,125,.35); color: #E8007D; }
.app-go-btn.app-go-on { background: rgba(232,0,125,.1); border-style: solid; border-color: rgba(232,0,125,.35); color: #E8007D; }

/* Status indicator */
.status {
  display: flex; align-items: center; gap: 0; font-size: 12px;
  color: var(--muted); background: transparent; border: 1px solid transparent;
  border-radius: 20px; padding: 4px; transition: all .2s; cursor: default;
}
.status:hover { background: var(--surface2); border-color: var(--border); gap: 7px; padding: 5px 12px; }
.status:hover #stxt { max-width: 140px; opacity: 1; margin-left: 0; }
.status.has-error { background: rgba(255,80,80,.1); border-color: rgba(255,80,80,.4); color: #ff8080; gap: 7px; padding: 5px 12px; }
.status.has-error #stxt { max-width: 140px; opacity: 1; }
#stxt { max-width: 0; overflow: hidden; white-space: nowrap; opacity: 0; transition: max-width .2s, opacity .15s; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--green); flex-shrink: 0; box-shadow: 0 0 6px rgba(52,211,153,.5); }
.dot.off { background: var(--red); box-shadow: 0 0 6px rgba(255,80,80,.6); }

/* addlib-overlay, addlib-box, btn-cancel, btn-save →
   asset-manager.css ve task-manager.css'de tanımlı. */

/* ── Toast (shared/toast.js tarafından kullanılır) ── */
.toast {
  position: fixed; bottom: 24px; right: 24px;
  background: var(--surface2); border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 16px; font-size: 13px; z-index: 9999;
  transform: translateY(20px); opacity: 0; transition: all .3s; max-width: 320px;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast.ok   { border-color: var(--green);  color: var(--green); }
.toast.err  { border-color: var(--red);    color: var(--red); }
.toast.warn { border-color: var(--yellow); color: var(--yellow); }

