/* ==========================================================================
   kısayol — hızlı erişim sayfası
   ========================================================================== */

:root{
  --font-body: 'Manrope', 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Consolas', monospace;

  --bg: #060912;
  --bg-soft: #0a0f1c;
  --bg-elevated: #0e1526;
  --bg-card: #111a2e;
  --bg-card-hover: #16213a;
  --border: rgba(186, 204, 240, 0.10);
  --border-strong: rgba(186, 204, 240, 0.20);
  --text: #e9eefb;
  --text-dim: #8b96b3;
  --text-faint: #57608a;
  --accent: #16c2a4;
  --accent-2: #40e0c8;
  --accent-soft: rgba(22, 194, 164, 0.16);
  --accent-contrast: #032e2a;
  --danger: #ff5c5c;
  --danger-soft: rgba(255, 92, 92, 0.14);
  --shadow-lg: 0 24px 60px -20px rgba(0,0,0,0.6);
  --shadow-md: 0 10px 30px -12px rgba(0,0,0,0.5);
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 10px;
  color-scheme: dark;
}

:root[data-theme="light"]{
  --bg: #f7f9fc;
  --bg-soft: #eef2f7;
  --bg-elevated: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f3f6fa;
  --border: rgba(15, 23, 42, 0.09);
  --border-strong: rgba(15, 23, 42, 0.18);
  --text: #0f172a;
  --text-dim: #64748b;
  --text-faint: #97a3b8;
  --accent: #0d9c86;
  --accent-2: #0b7d6c;
  --accent-soft: rgba(13, 156, 134, 0.13);
  --accent-contrast: #f0fffb;
  --shadow-lg: 0 24px 60px -24px rgba(15,23,42,0.20);
  --shadow-md: 0 10px 26px -14px rgba(15,23,42,0.16);
  color-scheme: light;
}

*{ box-sizing: border-box; }
html,body{ height: 100%; }
body{
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  position: relative;
  overflow-x: hidden;
  transition: background 0.4s ease, color 0.4s ease;
}

.hidden{ display: none !important; }

/* ---------------- authentication ---------------- */
.auth-screen{
  min-height: 100%; display: grid; place-items: center;
  padding: 24px; background:
    radial-gradient(circle at 20% 15%, var(--accent-soft), transparent 32rem),
    var(--bg);
}
.auth-card{
  width: min(100%, 420px); padding: clamp(28px, 6vw, 42px);
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
}
.auth-mark{
  width: 52px; height: 52px; display: grid; place-items: center;
  margin-bottom: 24px; border-radius: 15px; background: var(--accent);
  color: var(--accent-contrast); font-size: 1.45rem;
}
.auth-kicker{
  margin: 0 0 7px; color: var(--accent); font-family: var(--font-mono);
  font-size: .68rem; font-weight: 700; letter-spacing: .1em;
}
.auth-card h1{ margin: 0; font-size: clamp(1.8rem, 6vw, 2.45rem); letter-spacing: -.04em; }
.auth-description{ margin: 10px 0 28px; color: var(--text-dim); line-height: 1.6; }
.auth-error{
  margin: 14px 0 0; padding: 10px 12px; border-radius: 9px;
  background: var(--danger-soft); color: var(--danger); font-size: .82rem;
}
.auth-submit{ width: 100%; justify-content: center; margin-top: 18px; padding-block: 12px; }
.auth-submit:disabled{ opacity: .6; cursor: wait; transform: none; }

::selection{ background: var(--accent); color: var(--accent-contrast); }

button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible{
  outline: 2px solid var(--accent); outline-offset: 2px;
}

/* ---------------- layout shells ---------------- */
.topbar, .page{ position: relative; z-index: 1; }

.topbar{
  display: flex; align-items: center; gap: 20px;
  padding: 16px clamp(16px, 4vw, 48px);
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  backdrop-filter: blur(6px);
  flex-wrap: wrap;
  position: sticky; top: 0; z-index: 50;
}

.search-wrap{
  flex: 1; min-width: 200px; max-width: 520px;
  position: relative; margin: 0 auto;
}
.search-wrap input{
  width: 100%; padding: 12px 42px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--bg-elevated);
  color: var(--text); font-family: var(--font-body); font-size: 0.92rem;
  outline: none; box-shadow: var(--shadow-md);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.search-wrap input:focus{ border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search-icon{
  position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; color: var(--text-faint); pointer-events: none;
}
.search-kbd{
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  font-family: var(--font-mono); font-size: 0.7rem; color: var(--text-faint);
  border: 1px solid var(--border); border-radius: 5px; padding: 1px 6px;
  background: var(--bg-soft);
}

.topbar-actions{ display: flex; align-items: center; gap: 10px; position: relative; }

.icon-btn{
  width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--bg-elevated); color: var(--text-dim);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  transition: all 0.18s ease;
}
.icon-btn svg{ width: 18px; height: 18px; }
.icon-btn:hover{ color: var(--text); border-color: var(--border-strong); transform: translateY(-1px); }

.icon-moon{ display: none; }
:root[data-theme="light"] .icon-sun{ display: none; }
:root[data-theme="light"] .icon-moon{ display: block; }

.add-btn{
  display: flex; align-items: center; gap: 8px;
  padding: 10px 18px; border-radius: 12px; border: none;
  background: var(--accent); color: var(--accent-contrast);
  font-family: var(--font-body); font-weight: 700; font-size: 0.88rem;
  cursor: pointer; box-shadow: var(--shadow-md);
  transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease;
}
.add-btn svg{ width: 16px; height: 16px; }
.add-btn:hover{ transform: translateY(-2px); filter: brightness(1.08); }
.add-btn:active{ transform: translateY(0); }
.add-btn.ghost-btn{
  background: transparent; color: var(--text); border: 1.5px solid var(--border-strong);
  box-shadow: none;
}
.add-btn.ghost-btn:hover{ border-color: var(--accent); color: var(--accent); filter: none; }

/* ---------------- hero ---------------- */
.page{ max-width: 1180px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 48px) 60px; }

.hero{ padding: clamp(24px, 5vw, 40px) 4px 4px; }
.hero-clock{
  margin: 0; font-family: var(--font-mono); color: var(--text-faint);
  font-size: 0.85rem; letter-spacing: 0.04em;
}

/* ---------------- sections ---------------- */
#categoriesContainer{
  display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 12px; align-items: start;
}
.category-section{
  position: relative;
  background: var(--bg-card); border: 1px solid var(--border);
  border-top: 3px solid var(--accent);
  border-radius: var(--radius-md); padding: 14px; box-shadow: var(--shadow-md);
}
.section-heading{ display: flex; align-items: center; gap: 8px; margin: 0 0 10px; flex-wrap: wrap; }
.section-heading h3{
  margin: 0; font-family: var(--font-body); font-weight: 700; font-size: 0.88rem;
  color: var(--accent); text-transform: uppercase; letter-spacing: 0.05em;
}
.section-hint{ font-size: 0.76rem; color: var(--text-faint); font-family: var(--font-mono); }

.add-to-cat-btn{
  margin-left: auto; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--border);
  background: transparent; color: var(--text-faint); font-size: 0.68rem; cursor: pointer;
  font-family: var(--font-body); white-space: nowrap; transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.add-to-cat-btn:hover{ color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }

.cat-menu-btn{
  width: 22px; height: 22px; border-radius: 6px; border: none; background: transparent;
  color: var(--text-faint); display: flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0; transition: background 0.15s, color 0.15s;
}
.cat-menu-btn:hover{ background: var(--bg-soft); color: var(--text); }
.cat-menu-btn svg{ width: 14px; height: 14px; }

.cat-menu{
  position: absolute; top: 40px; right: 12px; background: var(--bg-elevated);
  border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; padding: 5px; z-index: 20; min-width: 120px;
}
.cat-menu.hidden{ display: none; }
.cat-menu button{
  text-align: left; padding: 8px 10px; border: none; background: none; color: var(--text);
  font-size: 0.82rem; border-radius: 7px; cursor: pointer; font-family: var(--font-body);
}
.cat-menu button:hover{ background: var(--bg-card-hover); }
.cat-menu button.danger{ color: var(--danger); }

.subcategory{ position: relative; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border); }
.subsection-heading{ display: flex; align-items: center; gap: 8px; margin: 0 0 8px; flex-wrap: wrap; }
.subsection-heading h4{
  margin: 0; font-family: var(--font-body); font-weight: 700; font-size: 0.66rem;
  color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.05em;
}

/* ---------------- link list (stacked rectangular rows) ---------------- */
.list-empty-hint{ margin: 4px 2px 0; color: var(--text-faint); font-size: 0.8rem; }

.link-list{ display: flex; flex-direction: column; }

.link-row{
  position: relative; display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 7px 4px; cursor: pointer; color: var(--text);
  background: transparent; border: none; border-bottom: 1px solid var(--border);
  opacity: 0; transform: translateY(4px);
  animation: row-in 0.3s ease forwards;
  transition: background 0.15s ease;
}
.link-row:last-child{ border-bottom: none; }
@keyframes row-in{ to{ opacity: 1; transform: translateY(0); } }
.link-row:hover{ background: var(--accent-soft); border-radius: 6px; }
.link-row:focus-visible{ outline: none; background: var(--accent-soft); border-radius: 6px; box-shadow: 0 0 0 2px var(--accent-soft); }

.row-body{ flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0; }
.row-name{
  font-weight: 600; font-size: 0.85rem; line-height: 1.25;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.row-domain{
  font-family: var(--font-mono); font-size: 0.68rem; line-height: 1.25; color: var(--text-faint);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.row-menu-btn{
  width: 22px; height: 22px; border-radius: 6px; border: none; background: transparent;
  color: var(--text-faint); display: flex; align-items: center; justify-content: center;
  cursor: pointer; opacity: 0; transition: opacity 0.15s, background 0.15s, color 0.15s;
  flex-shrink: 0;
}
.link-row:hover .row-menu-btn, .link-row:focus-within .row-menu-btn{ opacity: 1; }
.row-menu-btn:hover{ background: var(--bg-card); color: var(--text); }
.row-menu-btn svg{ width: 13px; height: 13px; }

.row-menu{
  position: absolute; top: 36px; right: 8px; background: var(--bg-elevated);
  border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; padding: 5px; z-index: 10; min-width: 130px;
}
.row-menu.hidden{ display: none; }
.row-menu button{
  text-align: left; padding: 8px 10px; border: none; background: none; color: var(--text);
  font-size: 0.82rem; border-radius: 7px; cursor: pointer; font-family: var(--font-body);
}
.row-menu button:hover{ background: var(--bg-card-hover); }
.row-menu button.danger{ color: var(--danger); }

.favicon-wrap{
  width: 24px; height: 24px; border-radius: 6px; background: var(--bg-soft);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
  flex-shrink: 0; font-size: 0.68rem; font-weight: 700; border: 1px solid var(--border);
}
.favicon-wrap img{ width: 15px; height: 15px; }

/* ---------------- empty state ---------------- */
.empty-state{
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 60px 20px; border: 1.5px dashed var(--border-strong); border-radius: var(--radius-lg);
  gap: 6px;
}
.empty-state.hidden{ display: none; }
.empty-emoji{ font-size: 1.6rem; color: var(--accent); margin: 0 0 6px; }
.empty-title{ font-family: var(--font-body); font-size: 1.3rem; font-weight: 600; margin: 0; }
.empty-sub{ color: var(--text-dim); margin: 0 0 16px; max-width: 360px; }

/* ---------------- modals ---------------- */
.modal-overlay{
  position: fixed; inset: 0; background: rgba(6,5,4,0.6); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; z-index: 100; padding: 20px;
  animation: overlay-in 0.18s ease;
}
.modal-overlay.hidden{ display: none; }
@keyframes overlay-in{ from{ opacity: 0; } to{ opacity: 1; } }

.modal{
  background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 26px; width: 100%; max-width: 420px; box-shadow: var(--shadow-lg);
  animation: modal-in 0.22s cubic-bezier(.2,.8,.2,1);
}
@keyframes modal-in{ from{ opacity: 0; transform: translateY(14px) scale(0.98); } to{ opacity: 1; transform: translateY(0) scale(1); } }

.modal-head{ display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.modal-head h3{ margin: 0; font-family: var(--font-body); font-weight: 600; font-size: 1.25rem; }

.field{ display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; font-size: 0.82rem; color: var(--text-dim); }
.field input, .field select{
  padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--bg-card); color: var(--text); font-family: var(--font-body); font-size: 0.92rem;
  outline: none; transition: border-color 0.18s, box-shadow 0.18s;
}
.field input:focus, .field select:focus{ border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.select-row{ display: flex; gap: 8px; }
.select-row select{ flex: 1; }
.mini-btn{
  padding: 0 12px; border-radius: 10px; border: 1px dashed var(--border-strong);
  background: transparent; color: var(--text-dim); font-size: 0.78rem; cursor: pointer;
  white-space: nowrap;
}
.mini-btn:hover{ color: var(--accent); border-color: var(--accent); }

.modal-actions{ display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.btn{
  padding: 10px 18px; border-radius: 12px; border: none; font-weight: 700; font-size: 0.86rem;
  cursor: pointer; font-family: var(--font-body); transition: filter 0.15s, transform 0.15s;
}
.btn:hover{ transform: translateY(-1px); }
.btn.primary{ background: var(--accent); color: var(--accent-contrast); }
.btn.ghost{ background: transparent; border: 1px solid var(--border-strong); color: var(--text); }
.btn.danger{ background: var(--danger); color: #2a0a0a; }

.confirm-modal{ max-width: 340px; text-align: center; }
.confirm-modal p{ margin: 6px 0 4px; color: var(--text); }

.category-list{ display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; max-height: 320px; overflow-y: auto; }
.category-group{ display: flex; flex-direction: column; gap: 6px; }
.category-row-item{
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px;
  background: var(--bg-card); border: 1px solid var(--border);
}
.category-row-item.sub{ margin-left: 22px; background: var(--bg-soft); }
.category-row-item .cname{ flex: 1; font-size: 0.88rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.category-row-item .ccount{ font-family: var(--font-mono); font-size: 0.7rem; color: var(--text-faint); white-space: nowrap; }
.category-row-item button{
  width: 26px; height: 26px; border-radius: 7px; border: none; background: transparent;
  color: var(--text-faint); cursor: pointer; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.category-row-item button:hover{ background: var(--danger-soft); color: var(--danger); }
.category-row-item button svg{ width: 14px; height: 14px; }
.add-sub-btn{
  width: auto !important; padding: 0 10px; border-radius: 999px !important;
  border: 1px dashed var(--border-strong) !important; color: var(--text-dim) !important;
  font-size: 0.7rem; font-family: var(--font-body); white-space: nowrap;
}
.add-sub-btn:hover{ background: transparent !important; color: var(--accent) !important; border-color: var(--accent) !important; }

.new-category-form{ display: flex; flex-direction: column; gap: 8px; }
.new-category-row{ display: flex; gap: 8px; }
.new-category-form select,
.new-category-form input[type="text"]{
  padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--bg-card); color: var(--text); font-family: var(--font-body); font-size: 0.88rem;
}
.new-category-form input[type="text"]{ flex: 1; }

/* ---------------- toast ---------------- */
.toast{
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(0);
  background: var(--bg-elevated); border: 1px solid var(--border-strong); color: var(--text);
  padding: 12px 20px; border-radius: 12px; box-shadow: var(--shadow-lg); font-size: 0.85rem;
  z-index: 200; display: flex; align-items: center; gap: 8px;
  animation: toast-in 0.25s ease;
}
.toast.hidden{ display: none; }
@keyframes toast-in{ from{ opacity: 0; transform: translateX(-50%) translateY(10px); } to{ opacity: 1; transform: translateX(-50%) translateY(0); } }

/* ---------------- responsive ---------------- */
@media (max-width: 640px){
  .topbar{ gap: 12px; }
  .search-wrap{ order: 3; max-width: none; flex-basis: 100%; }
  .add-btn span{ display: none; }
  .add-btn{ padding: 10px 12px; }
}
