/*base.css*/

*{
    box-sizing:border-box;
    -webkit-tap-highlight-color:transparent;
}

:root{
    --bg:#f9fafb;
    --text:#111827;
    --muted:#6b7280;
    --card:#ffffff;
    --border:#e5e7eb;
    --chip:#f3f4f6;
    --chipHover:#e5e7eb;
    --accent:#2563eb;
    --accentLight:#eff6ff;
    --danger:#ef4444;
    --font-heading: "Manrope", sans-serif;
    --font-body: "Inter", sans-serif;
}

body.dark{
    --bg:#0f172a;
    --text:#f1f5f9;
    --muted:#94a3b8;
    --card:#1e293b;
    --border:#334155;
    --chip:#334155;
    --chipHover:#475569;
    --accent:#60a5fa;
    --accentLight:#1e3a5f;
    --danger:#f87171;
}

body{
    margin:0;
    font-family:var(--font-body) /*'DM Sans',sans-serif;*/
    background:var(--bg);
    color:var(--text);
    transition:background 0.2s,color 0.2s;
}

h1, h2, h3, h4{
    font-family: var(--font-heading);
    font-weight: 700;
    letter-spacing: -0.02em;
}

p, li, input, button {
  font-family: var(--font-body);
}

/* TOPBAR */
.topbar{
    display:flex;
    justify-content:space-between;
    padding:14px 20px;
    align-items:center;
    position:sticky;
    top:0;
    background:var(--card);
    border-bottom:1px solid var(--border);
    z-index:10;
    backdrop-filter:blur(6px);
}

.brand{
    font-size:15px;
    font-weight:600;
    color:var(--text);
    text-decoration:none;
    letter-spacing:-0.2px;
}

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

.icon-btn{
    width:38px;height:38px;
    border-radius:10px;
    border:1px solid var(--border);
    background:var(--card);
    cursor:pointer;
    color:var(--text);
    font-size:16px;
    display:flex;
    align-items:center;
    justify-content:center;
    transition:background 0.15s, border-color 0.15s;
}

.icon-btn:hover{
    background:var(--chip);
}

.avatar{
    width:36px;height:36px;
    border-radius:50%;
    background:var(--accent);
    display:flex;
    align-items:center;
    justify-content:center;
    font-weight:600;
    font-size:14px;
    color:white;
    cursor:pointer;
    transition:opacity 0.15s;
}

.avatar:hover{opacity:0.85;}

/* PROFILE MENU */
.profile-menu{
    position:absolute;
    right:0;
    top:48px;
    width:190px;
    background:var(--card);
    border:1px solid var(--border);
    border-radius:12px;
    display:none;
    z-index:200;
    box-shadow:0 8px 24px rgba(0,0,0,0.12);
    overflow:hidden;
}

.profile-menu.open{display:block;}

.profile-item{
    padding:11px 14px;
    font-size:13.5px;
    border-bottom:1px solid var(--border);
    cursor:pointer;
    display:flex;
    align-items:center;
    gap:8px;
    transition:background 0.12s;
}

.profile-item:last-child{border-bottom:none;}
.profile-item:hover{background:var(--chip);}

.dark-indicator{
    margin-left:auto;
    font-size:11px;
    color:var(--muted);
    font-family:'DM Mono',monospace;
}

/* MENU (RIGHT SLIDE) */
.menu{
    position:fixed;
    top:0;
    right:0;
    width:260px;
    height:100%;
    background:var(--card);
    border-left:1px solid var(--border);
    transform:translateX(100%);
    transition:transform 0.25s ease;
    z-index:60;
    padding:20px;
}

.menu.open{transform:translateX(0);}

.menu-header{
    display:flex;
    justify-content:space-between;
    align-items:center;
    margin-bottom:6px;
}

.menu-header h3{
    margin:0;
    font-size:16px;
}

.close-btn{
    cursor:pointer;
    font-size:18px;
    color:var(--muted);
    line-height:1;
}

.close-btn:hover{color:var(--text);}

.menu-item{
    padding:12px 0;
    border-bottom:1px solid var(--border);
    cursor:pointer;
    font-size:14px;
    color:var(--text);
    transition:color 0.12s;
}

.menu-item:hover{color:var(--accent);}

.overlay{
    position:fixed;
    inset:0;
    background:rgba(0,0,0,0.35);
    display:none;
    z-index:55;
    backdrop-filter:blur(2px);
}

.overlay.show{display:block;}

/* =========================
   TOPBAR
========================= */

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 0 20px;
  height: var(--nav-h);
  position: sticky;
  top: 0;
  /* Subtle transparency */
  background: rgba(249, 250, 251, 0.82);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 10;
  transition: background 0.2s;
}

body.dark .topbar {
  background: rgba(15, 23, 42, 0.80);
}

.brand {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  flex-shrink: 0;
  letter-spacing: -0.2px;
}

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

/* =========================
   UPGRADE PILL
========================= */

.upgrade-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 13px;
  background: var(--accentLight);
  color: var(--accent);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: opacity 0.15s;
}

.upgrade-pill:hover {
  opacity: 0.8;
}

/* =========================
   ICON BUTTON
========================= */

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  flex-shrink: 0;
}

.icon-btn:hover {
  background: var(--chip);
}

/* =========================
   AVATAR + PROFILE MENU
========================= */

.avatar-wrap {
  position: relative;
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.15s;
  border: none;
  cursor: pointer;
}

.avatar:hover {
  opacity: 0.85;
}

.profile-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  width: 250px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  z-index: 200;
  /* Animated open */
  opacity: 0;
  transform: translateY(-10px) scale(0.97);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.profile-menu.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.profile-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 14px;
}

.profile-avatar-lg {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 17px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.profile-name {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
}

.profile-email {
  font-size: 12px;
  color: var(--muted);
}

.profile-divider {
  height: 1px;
  background: var(--border);
}

.profile-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  font-size: 13.5px;
  color: var(--text);
  text-decoration: none;
  transition: background 0.12s;
  width: 100%;
  text-align: left;
  border: none;
  background: none;
  cursor: pointer;
  font-family: var(--font-sans);
}

.profile-item:hover {
  background: var(--chip);
}

.profile-item.danger {
  color: var(--danger);
}

.profile-item-icon {
  font-size: 15px;
  flex-shrink: 0;
}

/* Dark mode toggle pill inside profile menu */
.toggle-pill {
  margin-left: auto;
  width: 34px;
  height: 20px;
  border-radius: 999px;
  background: var(--border);
  position: relative;
  transition: background 0.2s;
  flex-shrink: 0;
}

.toggle-pill.on {
  background: var(--accent);
}

.toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s;
}

.toggle-pill.on .toggle-thumb {
  transform: translateX(14px);
}

/* =========================
   SEARCH
========================= */

.search-wrapper {
  position: relative;
  flex: 1;
  max-width: 300px;
}

.search-input {
  width: 100%;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 14px;
  transition: border-color 0.15s, box-shadow 0.15s;
  box-sizing: border-box;
}

.search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
  outline: none;
}

.search-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  max-height: 240px;
  overflow-y: auto;
  display: none;
  z-index: 50;
  animation: fadeSlideDown 0.16s ease;
}

.search-result-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  font-size: 14px;
  color: var(--text);
  text-decoration: none;
  transition: background 0.12s;
  cursor: pointer;
}

.search-result-item:hover {
  background: var(--chip);
}

.search-result-badge {
  font-size: 11px;
  color: var(--muted);
  font-family: var(--font-mono);
  background: var(--chip);
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
}

.search-empty {
  padding: 16px;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}

/* =========================
   SIDE MENU
========================= */

.menu {
  position: fixed;
  top: 0;
  right: 0;
  width: 260px;
  height: 100%;
  background: var(--card);
  border-left: 1px solid var(--border);
  padding: 20px;
  transform: translateX(100%);
  transition: transform 0.28s ease;
  z-index: 60;
}

.menu.open {
  transform: translateX(0);
}

.menu-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.menu-header h3 {
  margin: 0;
  font-size: 16px;
}

.close-btn {
  font-size: 16px;
  color: var(--muted);
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px;
  border-radius: 6px;
  transition: color 0.12s, background 0.12s;
}

.close-btn:hover {
  color: var(--text);
  background: var(--chip);
}

.menu-item {
  display: block;
  width: 100%;
  padding: 11px 12px;
  text-align: left;
  border-radius: 8px;
  background: var(--chip);
  margin-bottom: 8px;
  font-size: 14px;
  color: var(--text);
  transition: background 0.12s;
}

.menu-item:hover {
  background: var(--chipHover);
}

/* =========================
   OVERLAY
========================= */

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  z-index: 55;
}

.overlay.show {
  opacity: 1;
  visibility: visible;
}

/* =========================
   SECTION TITLE
========================= */

.section-title {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--muted);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin: 28px 0 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}
