/* Apple-inspired dark-only UI touch for LinkStash */
:root {
  --apple-bg-1: #0c0c0f;
  --apple-bg-2: #13131a;
  --apple-muted: #aaaabb; /* slightly lighter for readability */
  --apple-accent: #007aff; /* keep blue accent for contrast */
  --apple-card-border: rgba(255,255,255,0.1);
  --apple-surface: rgba(20,20,28,0.8);
  /* override original var-text3 used in base stylesheet */
  --text3: #aaaabb;
}

html, body {
  background: linear-gradient(180deg, var(--apple-bg-1), var(--apple-bg-2));
  color: #f0f0f5;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Header: lighter, airy, centered */
#header {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  background: linear-gradient(180deg, var(--apple-bg-1), rgba(19,19,26,0.95)) !important;
  border-bottom: none !important;
  padding-top: max(20px, env(safe-area-inset-top)) !important;
  padding-bottom: 12px !important;
  z-index: 50 !important;
}

#header-inner { justify-content: center !important; gap: 14px; }
#logo h1 { font-weight: 600; font-size: 20px; color: #f0f0f5; letter-spacing: -0.2px; }
#link-count-chip { display: none !important; }

#logo-icon {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--apple-surface);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 18px rgba(11,18,32,0.06);
  font-size: 18px;
  border: 1px solid var(--apple-card-border);
}

/* Card surfaces: subtle white cards with soft shadows */
.save-section, .settings-card, .link-card, .links-list > .link-card {
  background: var(--apple-surface) !important;
  border: 1px solid var(--apple-card-border) !important;
  box-shadow: 0 8px 24px rgba(11,18,32,0.04) !important;
  border-radius: 16px !important;
}

.link-card { display:flex; gap:12px; align-items: center; }
.link-card-accent { display:none; }
.link-favicon { border-radius: 8px; background: linear-gradient(180deg,#22222f,#1a1a24); box-shadow: 0 6px 12px rgba(0,0,0,0.4); }
.link-title { color: #f0f0f5; font-weight: 600; }
.link-domain, .link-time, .link-tag, .link-type-badge { color: var(--apple-muted); }

/* Inputs: iOS-like rounded fields */
#link-input, #search-input, .settings-input, select {
  background: rgba(20,20,28,0.9) !important;
  border: 1px solid var(--apple-card-border) !important;
  border-radius: 12px !important;
  box-shadow: none !important;
  color: #f0f0f5 !important;
}
select { appearance: none; padding-right: 24px; }

#save-btn { background: var(--apple-accent) !important; color: white !important; box-shadow: 0 8px 18px rgba(0,122,255,0.3) !important; border:none; }
#paste-btn { background: transparent !important; border: 1px solid var(--apple-card-border) !important; }

/* Bottom nav: Apple floating island */
#bottom-nav {
  position: fixed !important;
  left: 50% !important;
  bottom: 20px !important;
  transform: translateX(-50%) !important;
  width: fit-content !important;
  height: 50px !important;
  background: rgba(35, 35, 45, 0.85) !important;
  backdrop-filter: blur(25px) !important;
  -webkit-backdrop-filter: blur(25px) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: 999px !important;
  padding: 0 8px !important;
  padding-bottom: env(safe-area-inset-bottom) !important;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.85), inset 0 1px 1px rgba(255, 255, 255, 0.08) !important;
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  gap: 0 !important;
  z-index: 100 !important;
}
.nav-tab {
  flex-shrink: 0;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  width: 60px !important;
  height: 50px !important;
  gap: 2px !important;
  color: var(--apple-muted);
  background: transparent !important;
  border-radius: 20px !important;
  cursor: pointer !important;
  transition: all 0.25s ease !important;
  font-size: 9px !important;
  letter-spacing: 0.2px !important;
  position: relative !important;
}
.nav-tab:hover {
  color: #e0e0e5;
  background: rgba(255, 255, 255, 0.05) !important;
}
.nav-tab.active {
  color: var(--apple-accent);
  background: rgba(0, 122, 255, 0.25) !important;
}
.nav-tab-icon {
  font-size: 22px !important;
  line-height: 1 !important;
}

/* Toast: subtle */
#toast { background: rgba(11,18,32,0.9); color: #fff; border-radius: 14px; }

/* Empty state: gentle */
.empty-state { color: var(--apple-muted); }

/* Tweak small elements for a cleaner, Apple-like spacing */
.save-section { padding: 18px !important; }
.input-actions { gap: 8px !important; }
.card-btn { border-radius: 10px !important; }

/* Make scrollbar subtle on WebKit */
::-webkit-scrollbar { height: 8px; width: 8px; }
::-webkit-scrollbar-thumb { background: rgba(11,18,32,0.06); border-radius: 8px; }

/* Account for fixed header in page content */
.page {
  padding-top: 110px !important;
  padding-bottom: calc(110px + var(--safe-bottom)) !important;
}

/* ═══════════════════════════════════════════ */
/* RESPONSIVE DESIGN */
/* ═══════════════════════════════════════════ */

/* Small phones (< 380px) */
@media (max-width: 379px) {
  #header { padding: max(20px, env(safe-area-inset-top)) 16px 12px !important; }
  #logo h1 { font-size: 18px !important; }
  .save-section { padding: 14px !important; }
  .link-title { font-size: 12px !important; }
  .nav-tab { width: 55px !important; font-size: 8px !important; }
  .nav-tab-icon { font-size: 20px !important; }
  #bottom-nav { width: calc(100% - 24px) !important; left: 12px !important; transform: translateX(0) !important; }
  .page { padding-top: 100px !important; padding-bottom: 100px !important; }
}

/* Standard mobile (380px - 480px) */
@media (min-width: 380px) and (max-width: 480px) {
  #header { padding: max(20px, env(safe-area-inset-top)) 18px 14px !important; }
  .save-section { padding: 16px !important; margin-bottom: 20px !important; }
  .link-card-body { padding: 12px !important; }
  .link-title { font-size: 13px !important; }
  .nav-tab { width: 65px !important; }
  #bottom-nav { width: auto !important; padding: 0 8px !important; }
  .page { padding-top: 110px !important; padding-bottom: 110px !important; }
}

/* Tablets & larger (481px+) */
@media (min-width: 481px) {
  #app { max-width: 600px !important; }
  .save-section { padding: 20px !important; }
  .link-card-body { padding: 14px !important; }
  #bottom-nav { width: fit-content !important; padding: 0 12px !important; }
  .nav-tab { width: 70px !important; padding: 0 2px !important; }
  .page { padding-top: 120px !important; padding-bottom: 120px !important; }
}

/* Landscape orientation adjustments */
@media (orientation: landscape) and (max-height: 500px) {
  #header { padding-top: max(15px, env(safe-area-inset-top)) !important; padding-bottom: 10px !important; }
  .page { padding-top: 80px !important; padding-bottom: 80px !important; }
  #bottom-nav { bottom: 10px !important; height: 45px !important; }
  .nav-tab { width: 55px !important; height: 45px !important; }
  .nav-tab-icon { font-size: 18px !important; }
  .nav-tab { font-size: 7px !important; }
}
