/* ═══════════════════════════════════════════════════════════════
   INDEX.CSS — Professional Human-Crafted Preset Marketplace
   Inter Sans-Serif Typography · Restrained Gold Accents · Filter System
   ═══════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

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

:root {
  --bg: #070707;
  --bg-secondary: #0D0D0D;
  --card: #121212;
  --surface: #171717;
  --gold: #D4AF37;
  --gold-hover: #E3C45C;
  --gold-dim: rgba(212, 175, 55, 0.12);
  --border-default: rgba(255, 255, 255, 0.10);
  --border-gold: rgba(212, 175, 55, 0.35);
  --text-primary: #F3F3F1;
  --text-secondary: #A1A1A1;
  --text-muted: #707070;
  --radius-sm: 8px;
  --radius-md: 10px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --container-max: 1200px;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* ─── Typography & Weights ───────────────────────────────────── */
h1, h2, .hero-title, .section-title {
  font-weight: 700;
  color: var(--text-primary);
}

h3, .card-title, .btn, .preset-card-title {
  font-weight: 600;
}

.nav-link, .hero-subtitle, p {
  font-weight: 400;
  color: var(--text-secondary);
}

.small-label, .ba-label, .preset-count-indicator {
  font-weight: 500;
}

/* ─── Navbar ─────────────────────────────────────────────────── */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  padding: 0 32px;
  height: 70px;
  display: flex;
  align-items: center;
  background: rgba(7, 7, 7, 0.90);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-default);
  transition: background 0.2s ease;
}

.nav-inner {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.logo-mark {
  color: var(--gold);
  font-size: 16px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav-link {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color 0.2s ease;
  position: relative;
  padding: 6px 0;
}

.nav-link:hover,
.nav-link.active {
  color: var(--text-primary);
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -21px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gold);
  border-radius: 2px;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ─── Navbar Profile Dropdown ────────────────────────────────── */
.nav-auth-user {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-user-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 5px 14px 5px 6px;
  background: var(--card);
  border: 1px solid var(--border-default);
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  transition: all 0.2s ease;
  cursor: pointer;
}

.nav-user-pill:hover {
  border-color: var(--border-gold);
  background: var(--surface);
  color: var(--gold-hover);
}

.nav-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--gold-dim);
  border: 1.5px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--gold);
  overflow: hidden;
  flex-shrink: 0;
}

.nav-user-name {
  max-width: 120px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dropdown-chevron {
  color: var(--text-muted);
  transition: transform 0.2s ease;
}

.user-dropdown-container {
  position: relative;
}

.user-dropdown-container.open .dropdown-chevron {
  transform: rotate(180deg);
  color: var(--gold);
}

.user-dropdown-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 230px;
  background: var(--card);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-lg);
  padding: 8px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.7);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px) scale(0.96);
  transition: all 0.2s ease;
  z-index: 1050;
}

.user-dropdown-container.open .user-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.dropdown-user-header {
  padding: 8px 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.dropdown-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--gold-dim);
  border: 1.5px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  color: var(--gold);
  flex-shrink: 0;
  overflow: hidden;
}

.dropdown-user-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.dropdown-user-email {
  font-size: 12px;
  color: var(--text-secondary);
  word-break: break-all;
}

.dropdown-divider {
  height: 1px;
  background: var(--border-default);
  margin: 6px 0;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
}

.dropdown-item:hover {
  color: var(--text-primary);
  background: var(--surface);
}

.dropdown-item svg {
  color: var(--text-secondary);
  transition: color 0.2s ease;
}

.dropdown-item:hover svg {
  color: var(--gold);
}

.dropdown-item-danger:hover {
  color: #F87171;
  background: rgba(248, 113, 113, 0.1);
}

.dropdown-item-danger:hover svg {
  color: #F87171;
}

/* ─── Buttons Design System ───────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 22px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  outline: none;
  border: none;
  white-space: nowrap;
}

.btn:focus-visible {
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--gold);
}

.btn-primary {
  background: var(--gold);
  color: #070707;
}

.btn-primary:hover {
  background: var(--gold-hover);
  transform: translateY(-2px);
}

.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-default);
}

.btn-outline:hover {
  background: var(--surface);
  border-color: var(--border-gold);
  color: var(--gold);
  transform: translateY(-2px);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-default);
  height: 38px;
  padding: 0 16px;
  font-size: 13px;
}

.btn-ghost:hover {
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.2);
  background: var(--surface);
}

.btn-sm {
  height: 36px;
  padding: 0 14px;
  font-size: 13px;
  border-radius: var(--radius-sm);
}

.btn-lg {
  height: 48px;
  padding: 0 28px;
  font-size: 15px;
  border-radius: var(--radius-md);
}

/* Mobile Toggle */
.nav-mobile-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}

.nav-mobile-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 1px;
}

/* ─── Hero Section ───────────────────────────────────────────── */
.hero {
  position: relative;
  height: 520px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 70px;
  overflow: hidden;
  background: var(--bg);
  margin-bottom: 72px; /* Spacing between Hero & Latest Presets */
}

.hero-bg-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: 0.20;
  filter: contrast(1.1) brightness(0.75);
  pointer-events: none;
}

.hero-gradient-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(7,7,7,0.3) 0%, rgba(7,7,7,0.7) 60%, rgba(7,7,7,1) 100%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  text-align: center;
  max-width: 760px;
  margin: 0 auto;
  padding: 0 24px;
  z-index: 2;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px;
  background: var(--card);
  border: 1px solid var(--border-gold);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  color: var(--gold);
  margin-bottom: 24px;
}

.hero-title {
  font-size: 56px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  margin-bottom: 18px;
}

.hero-subtitle {
  font-size: 16px;
  font-weight: 400;
  color: var(--text-secondary);
  max-width: 560px;
  margin: 0 auto 32px;
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

/* ─── Gallery Section & Filter System ────────────────────────── */
.gallery-section {
  padding: 0 32px 100px;
  max-width: var(--container-max);
  margin: 0 auto;
}

.section-header {
  margin-bottom: 24px;
}

.section-title-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.section-title {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.section-subtitle {
  font-size: 14px;
  font-weight: 400;
  color: var(--text-secondary);
}

.preset-count-indicator {
  font-size: 13px;
  font-weight: 600;
  color: var(--gold);
  background: var(--gold-dim);
  border: 1px solid var(--border-gold);
  padding: 4px 12px;
  border-radius: 20px;
}

/* Filter Toolbar */
.filter-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  background: var(--card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: 12px;
  margin-bottom: 16px;
}

.search-input-wrapper {
  position: relative;
  flex: 1;
  min-width: 240px;
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.search-input {
  width: 100%;
  height: 44px;
  padding-left: 38px;
  padding-right: 14px;
  background: var(--bg);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 400;
  color: var(--text-primary);
  outline: none;
  transition: all 0.2s ease;
}

.search-input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.2);
}

.desktop-filter-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.filter-select {
  height: 44px;
  padding: 0 32px 0 14px;
  background: var(--bg);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  outline: none;
  cursor: pointer;
  transition: all 0.2s ease;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%20%23A1A1A1' stroke-width='2' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

.filter-select:hover,
.filter-select:focus {
  border-color: var(--gold);
}

.btn-clear-filters {
  height: 44px;
  padding: 0 16px;
  background: transparent;
  border: 1px solid var(--border-gold);
  color: var(--gold);
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-clear-filters:hover {
  background: var(--gold-dim);
}

/* Active Filter Chips */
.active-chips {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: var(--surface);
  border: 1px solid var(--border-gold);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  color: var(--gold);
}

.chip-remove {
  background: none;
  border: none;
  color: var(--gold);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  line-height: 1;
  padding: 0 2px;
}

.chip-remove:hover {
  color: #F87171;
}

/* Mobile Filter System */
.mobile-filter-actions {
  display: none;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.btn-mobile-filter {
  flex: 1;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--bg);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
}

.mobile-filter-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--gold);
  color: #070707;
  font-size: 11px;
  font-weight: 700;
}

/* Mobile Filter Drawer */
.mobile-drawer-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 1100;
}

.mobile-drawer-backdrop.open { display: block; }

.mobile-drawer {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--card);
  border-top: 1px solid var(--border-gold);
  border-top-left-radius: var(--radius-xl);
  border-top-right-radius: var(--radius-xl);
  padding: 20px;
  z-index: 1200;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-drawer.open { transform: translateY(0); }

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

.drawer-title { font-size: 18px; font-weight: 700; }
.drawer-close { background: none; border: none; font-size: 24px; color: var(--text-muted); cursor: pointer; }

.drawer-body { display: flex; flex-direction: column; gap: 16px; margin-bottom: 24px; }
.drawer-group { display: flex; flex-direction: column; gap: 6px; }
.drawer-label { font-size: 12px; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; }

.drawer-footer { display: flex; gap: 12px; }
.drawer-footer .btn { flex: 1; }

/* ─── Preset Grid ─────────────────────────────────────────────── */
.preset-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

/* Editorial Preset Card */
.preset-card {
  background: var(--card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
}

.preset-card:hover {
  border-color: var(--border-gold);
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
}

.preset-card-image {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--surface);
}

.preset-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.preset-card:hover .preset-card-image img {
  transform: scale(1.05);
}

.before-after-bar {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  display: flex;
  justify-content: space-between;
  padding: 6px 12px;
  background: linear-gradient(0deg, rgba(0,0,0,0.85) 0%, transparent 100%);
  z-index: 2;
}

.ba-label {
  font-size: 10px;
  font-weight: 600;
  color: #E5E7EB;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.preset-card-favorite {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(7, 7, 7, 0.6);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 3;
}

.preset-card-favorite svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: var(--text-primary);
  stroke-width: 2;
  transition: all 0.2s ease;
}

.preset-card-favorite.active svg {
  fill: #EF4444;
  stroke: #EF4444;
}

.preset-card-info {
  padding: 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.preset-card-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.preset-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}

.preset-card-meta .dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--text-muted);
}

/* Compact Empty State */
.gallery-empty {
  text-align: center;
  padding: 48px 24px;
  background: var(--card);
  border: 1px dashed var(--border-gold);
  border-radius: var(--radius-lg);
  max-width: 480px;
  margin: 0 auto;
}

.empty-icon {
  font-size: 24px;
  color: var(--gold);
  margin-bottom: 12px;
}

.gallery-empty h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 6px;
}

.gallery-empty p {
  font-size: 14px;
  color: var(--text-secondary);
}

.gallery-loading {
  text-align: center;
  padding: 48px 0;
  color: var(--text-secondary);
}

.loader {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border-default);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 12px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ─── Footer ─────────────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--border-default);
  background: var(--bg-secondary);
  padding: 40px 32px;
}

.footer-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 700;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 24px;
  font-size: 13px;
  color: var(--text-secondary);
}

.footer-links a:hover {
  color: var(--gold);
}

.footer-copy {
  font-size: 13px;
  color: var(--text-muted);
}

/* ─── Responsive Layout Breakpoints ──────────────────────────── */
@media (max-width: 1200px) {
  .preset-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 900px) {
  .desktop-filter-controls { display: none; }
  .mobile-filter-actions { display: flex; }
  .preset-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .navbar { padding: 0 20px; height: 64px; }
  .nav-links {
    display: none;
    position: absolute;
    top: 64px; left: 0; right: 0;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-default);
    flex-direction: column;
    padding: 20px;
    gap: 16px;
  }
  .nav-links.open { display: flex; }
  .nav-mobile-toggle { display: flex; }

  .hero { height: auto; min-height: 440px; padding-top: 90px; padding-bottom: 50px; margin-bottom: 48px; }
  .hero-title { font-size: 38px; }
  .hero-subtitle { font-size: 14px; }
  .hero-actions { flex-direction: column; gap: 12px; }
  .btn-lg { width: 100%; }

  .gallery-section { padding: 0 20px 64px; }
  .section-title { font-size: 26px; }

  .preset-grid { grid-template-columns: 1fr; }
  .footer-inner { flex-direction: column; text-align: center; justify-content: center; }
}
