/* ============================================
   Web Share Target Hub — Styles
   ============================================ */

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

:root {
  --primary: #7C3AED;
  --primary-light: #A78BFA;
  --accent: #06B6D4;
  --accent-glow: rgba(6,182,212,0.15);
  --success: #10B981;
  --warning: #F59E0B;
  --danger: #EF4444;
  --bg: #0B0E11;
  --bg-card: rgba(255,255,255,0.04);
  --bg-glass: rgba(255,255,255,0.06);
  --border: rgba(255,255,255,0.08);
  --border-hover: rgba(255,255,255,0.16);
  --text: #E8E8E8;
  --text-dim: #9CA3AF;
  --text-muted: #6B7280;
  --radius: 12px;
  --radius-sm: 8px;
  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --shadow: 0 4px 24px rgba(0,0,0,0.3);
  --transition: 250ms ease;
}

html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font); background: var(--bg);
  color: var(--text); line-height: 1.6; min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* --- Header --- */
.header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(11,14,17,0.85);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}
.header__inner {
  max-width: 900px; margin: 0 auto; padding: 0.75rem 1.5rem;
  display: flex; align-items: center; justify-content: space-between;
}
.header__brand { display: flex; align-items: center; gap: 0.6rem; }
.header__icon { font-size: 1.3rem; }
.header__title { font-size: 1.15rem; font-weight: 700; letter-spacing: -0.02em; }
.header__actions { display: flex; gap: 0.5rem; }

/* --- Buttons --- */
.btn {
  display: inline-flex; align-items: center; gap: 0.4rem;
  border: none; cursor: pointer; font-family: var(--font);
  font-size: 0.85rem; font-weight: 500; border-radius: var(--radius-sm);
  transition: all var(--transition); white-space: nowrap;
}
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn--ghost {
  background: var(--bg-glass); color: var(--text-dim);
  padding: 0.5rem 0.85rem; border: 1px solid var(--border);
}
.btn--ghost:hover { background: rgba(255,255,255,0.1); color: var(--text); }
.btn--accent {
  background: var(--accent); color: #0B0E11;
  padding: 0.5rem 1rem; font-weight: 600;
}
.btn--accent:hover { filter: brightness(1.15); transform: translateY(-1px); }
.btn--sm { font-size: 0.78rem; padding: 0.35rem 0.7rem; }
.btn--icon { background: none; border: none; color: var(--text-dim); padding: 0.3rem; cursor: pointer; }
.btn--icon:hover { color: var(--text); }
.btn--danger { background: var(--danger); color: #fff; }
.btn--danger:hover { filter: brightness(1.1); }

/* --- Main --- */
.main { max-width: 900px; margin: 0 auto; padding: 1.25rem 1.5rem 3rem; }

/* --- Status Banner --- */
.status-banner {
  display: flex; align-items: center; gap: 1rem;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
}
.status-banner__icon { font-size: 2rem; flex-shrink: 0; }
.status-banner__title { font-size: 0.95rem; font-weight: 600; }
.status-banner__desc { font-size: 0.82rem; color: var(--text-dim); margin-top: 0.15rem; }
.status-banner--ok { border-color: rgba(16,185,129,0.3); }
.status-banner--warning { border-color: rgba(245,158,11,0.3); }

/* --- Section Title --- */
.section-title { font-size: 0.9rem; font-weight: 600; margin-bottom: 0.75rem; color: var(--text); }

/* --- Quick Add --- */
.quick-add { margin-bottom: 1.5rem; }
.quick-add__form {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}
.quick-add__tabs {
  display: flex; border-bottom: 1px solid var(--border);
}
.tab {
  flex: 1; padding: 0.6rem; font-family: var(--font);
  font-size: 0.82rem; font-weight: 500; cursor: pointer;
  background: none; border: none; color: var(--text-dim);
  border-bottom: 2px solid transparent;
  transition: all var(--transition);
}
.tab:hover { color: var(--text); background: rgba(255,255,255,0.03); }
.tab--active, .tab.active {
  color: var(--accent); border-bottom-color: var(--accent);
}
.quick-add__input-area { padding: 1rem; }
.input {
  width: 100%; padding: 0.65rem 0.85rem;
  background: rgba(0,0,0,0.2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text);
  font-family: var(--font); font-size: 0.88rem;
  transition: all var(--transition); resize: vertical;
}
.input::placeholder { color: var(--text-muted); }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.input--sm { font-size: 0.82rem; padding: 0.5rem 0.75rem; }
.input--file {
  padding: 0.5rem; font-size: 0.82rem; cursor: pointer;
}
.input--file::file-selector-button {
  background: var(--bg-glass); border: 1px solid var(--border);
  color: var(--text-dim); border-radius: var(--radius-sm);
  padding: 0.35rem 0.75rem; font-family: var(--font);
  font-size: 0.78rem; cursor: pointer; margin-right: 0.5rem;
}
.quick-add__footer {
  display: flex; gap: 0.75rem; padding: 0 1rem 1rem;
  align-items: center;
}
.quick-add__footer .input--sm { flex: 1; }

/* --- Filters --- */
.filters {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1rem; flex-wrap: wrap; gap: 0.5rem;
}
.filters__chips { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.chip {
  padding: 0.35rem 0.75rem; border-radius: 999px;
  font-size: 0.78rem; font-weight: 500; font-family: var(--font);
  background: var(--bg-glass); color: var(--text-dim);
  border: 1px solid var(--border); cursor: pointer;
  transition: all var(--transition);
}
.chip:hover { background: rgba(255,255,255,0.1); color: var(--text); }
.chip--active { background: var(--primary); color: #fff; border-color: var(--primary); }
.filters__count { font-size: 0.78rem; color: var(--text-muted); }

/* --- Items Grid --- */
.items-grid {
  display: grid; grid-template-columns: 1fr; gap: 0.75rem;
}

/* --- Item Card --- */
.item-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1rem;
  transition: all var(--transition); animation: fadeIn 300ms ease backwards;
  position: relative;
}
.item-card:hover { border-color: var(--border-hover); box-shadow: var(--shadow); }

.item-card__header {
  display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.6rem;
}
.item-card__type-icon {
  width: 32px; height: 32px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; flex-shrink: 0;
}
.item-card__type-icon--text { background: rgba(124,58,237,0.15); }
.item-card__type-icon--url { background: rgba(6,182,212,0.15); }
.item-card__type-icon--file { background: rgba(245,158,11,0.15); }

.item-card__title { font-size: 0.88rem; font-weight: 600; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-card__time { font-size: 0.7rem; color: var(--text-muted); flex-shrink: 0; }

.item-card__body { font-size: 0.82rem; color: var(--text-dim); line-height: 1.5; word-break: break-word; }
.item-card__body a { color: var(--accent); text-decoration: none; }
.item-card__body a:hover { text-decoration: underline; }

.item-card__file-info { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.4rem; }
.item-card__file-tag {
  font-size: 0.7rem; padding: 0.2rem 0.5rem; border-radius: 999px;
  background: var(--bg-glass); color: var(--text-muted); border: 1px solid var(--border);
}

.item-card__actions {
  display: flex; gap: 0.4rem; margin-top: 0.75rem; padding-top: 0.6rem;
  border-top: 1px solid var(--border);
}

/* --- Empty State --- */
.empty-state {
  text-align: center; padding: 3rem 2rem;
}
.empty-state[hidden] { display: none; }
.empty-state__icon { font-size: 3rem; display: block; margin-bottom: 1rem; }
.empty-state__title { font-size: 1.05rem; font-weight: 600; margin-bottom: 0.35rem; }
.empty-state__desc { font-size: 0.85rem; color: var(--text-dim); }

/* --- Toast --- */
.toast {
  position: fixed; bottom: 1.5rem; left: 50%; transform: translateX(-50%);
  background: var(--primary); color: #fff;
  padding: 0.6rem 1.25rem; border-radius: var(--radius);
  font-size: 0.85rem; font-weight: 500;
  box-shadow: var(--shadow); z-index: 500;
  animation: toastIn 300ms ease;
}
.toast[hidden] { display: none; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(10px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* --- Responsive --- */
@media (max-width: 600px) {
  .main { padding: 1rem; }
  .header__inner { padding: 0.6rem 1rem; }
  .btn__text { display: none; }
  .quick-add__footer { flex-direction: column; }
}

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 999px; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
