/* ═══════════════════════════════════════════════════════════════
   PROFILE.CSS — Premium Black & Gold Creator Dashboard
   Inter Sans-Serif Typography · 4-Card Statistics · Filterable Grid
   ═══════════════════════════════════════════════════════════════ */

@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,
[data-theme="dark"] {
  --bg: #070707;
  --card: #111111;
  --surface: #171717;
  --gold: #D4AF37;
  --gold-bright: #F1CE62;
  --gold-dim: rgba(212, 175, 55, 0.15);
  --border-gold: rgba(212, 175, 55, 0.30);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --text: #F5F5F5;
  --text-muted: #9CA3AF;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
}

[data-theme="light"] {
  --bg: #F7F6F2;
  --card: #FFFFFF;
  --surface: #FAF9F6;
  --gold: #A77B12;
  --gold-bright: #8A650C;
  --gold-dim: rgba(167, 123, 18, 0.10);
  --border-gold: rgba(167, 123, 18, 0.30);
  --border-subtle: rgba(23, 23, 23, 0.12);
  --text: #171717;
  --text-muted: #555555;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

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

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

.stat-value, .preset-card-item-title, .btn-label, button, .badge-pill {
  font-weight: 600;
}

.nav-link, p, .stat-label, .ba-label, .filter-tab {
  font-weight: 500;
}

/* ─── Navbar ─────────────────────────────────────────────────── */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  padding: 0 32px; height: 68px;
  display: flex; align-items: center;
  background: rgba(7, 7, 7, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-gold);
}

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

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

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

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

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

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

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

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

/* ─── Navbar User 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(--surface);
  border: 1px solid var(--border-gold);
  border-radius: 999px;
  font-size: 13px; font-weight: 600; color: var(--text);
  transition: all 0.2s ease; cursor: pointer;
}

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

.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: 240px; background: var(--card);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-lg);
  padding: 10px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.8), 0 0 25px rgba(212, 175, 55, 0.1);
  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: 10px; display: flex; align-items: center; gap: 12px;
}

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

.dropdown-user-name { font-size: 14px; font-weight: 600; color: var(--text); }
.dropdown-user-email { font-size: 12px; color: var(--text-muted); word-break: break-all; }

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

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

.dropdown-item:hover { color: var(--text); background: var(--surface); }
.dropdown-item svg { color: var(--text-muted); 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; }

/* ─── Profile Main Layout ─────────────────────────────────────── */
.profile-main {
  padding-top: 68px; max-width: 1400px; margin: 0 auto;
  padding-left: 32px; padding-right: 32px; padding-bottom: 100px;
}

/* ─── Profile Cover Section ───────────────────────────────────── */
.profile-hero-banner {
  position: relative; width: 100%; height: 280px;
  border-radius: var(--radius-lg); overflow: hidden;
  margin-top: 24px; margin-bottom: 32px;
  border: 1px solid var(--border-gold);
  background: var(--surface);
}

.profile-cover-img {
  width: 100%; height: 100%; object-fit: cover; object-position: center;
  filter: brightness(0.6);
}

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

.profile-hero-content {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 24px; z-index: 2;
}

/* Avatar with Gold Lighting Glow */
.profile-avatar-wrapper { position: relative; margin-bottom: 14px; }

.profile-avatar {
  width: 96px; height: 96px; border-radius: 50%;
  background: var(--surface);
  border: 3px solid var(--gold);
  box-shadow: 0 0 25px rgba(212, 175, 55, 0.35), 0 0 50px rgba(212, 175, 55, 0.15);
  display: flex; align-items: center; justify-content: center;
  font-size: 36px; font-weight: 700; color: var(--gold);
  overflow: hidden;
}

.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }

.profile-identity-group {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}

.profile-name-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: center;
}

.profile-name {
  font-size: 32px; font-weight: 700; color: var(--text);
  letter-spacing: -0.02em; text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
}

.profile-email {
  font-size: 14px; font-weight: 500; color: var(--text-muted);
}

/* Creator / Admin Badge */
.creator-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px; background: var(--gold-dim);
  border: 1px solid var(--border-gold);
  color: var(--gold-bright); border-radius: 20px;
  font-size: 12px; font-weight: 600;
}

.creator-badge-admin {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.4);
  color: #FBBF24;
}

/* Edit Profile Action Button */
.profile-cover-action {
  position: absolute; top: 20px; right: 20px; z-index: 3;
}

/* ─── Buttons Design System ───────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 18px;
  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: #000;
  box-shadow: 0 4px 14px rgba(212, 175, 55, 0.25);
}

.btn-primary:hover {
  background: var(--gold-bright);
  box-shadow: 0 6px 20px rgba(212, 175, 55, 0.4);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--surface);
  border: 1px solid var(--border-gold);
  color: var(--text);
}

.btn-secondary:hover {
  background: var(--gold-dim);
  border-color: var(--gold-bright);
  color: var(--gold-bright);
  transform: translateY(-1px);
}

.btn-sm { height: 34px; padding: 0 12px; font-size: 13px; border-radius: var(--radius-sm); }
.btn-icon { width: 40px; height: 40px; padding: 0; border-radius: var(--radius-md); }

/* ─── Statistics Grid Section ─────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 40px;
}

.stat-card {
  background: linear-gradient(145deg, var(--card) 0%, var(--surface) 100%);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex; flex-direction: column; justify-content: space-between;
  min-height: 120px;
  transition: all 0.25s ease;
  position: relative; overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.stat-card::before {
  content: ''; position: absolute; top: -20px; right: -20px;
  width: 80px; height: 80px;
  background: radial-gradient(circle, rgba(212, 175, 55, 0.12) 0%, transparent 70%);
  pointer-events: none;
}

.stat-card:hover {
  border-color: var(--gold-bright);
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6), 0 0 20px rgba(212, 175, 55, 0.2);
}

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

.stat-label {
  font-size: 13px; font-weight: 500; color: var(--text-muted);
}

.stat-icon {
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  background: var(--gold-dim); border: 1px solid var(--border-gold);
  display: flex; align-items: center; justify-content: center;
  color: var(--gold); flex-shrink: 0;
}

.stat-value {
  font-size: 28px; font-weight: 700; color: var(--text);
  letter-spacing: -0.02em; line-height: 1.1;
}

/* ─── My Presets Section ─────────────────────────────────────── */
.section-header-bar {
  display: flex; items-center; justify-content: space-between;
  flex-wrap: wrap; gap: 16px; margin-bottom: 24px;
}

.section-title-group {
  display: flex; align-items: center; gap: 12px;
}

.section-title-large {
  font-size: 24px; font-weight: 700; color: var(--text);
  letter-spacing: -0.01em;
}

.preset-count-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 28px; height: 26px; padding: 0 8px;
  background: var(--gold-dim); border: 1px solid var(--border-gold);
  color: var(--gold); border-radius: 999px;
  font-size: 13px; font-weight: 600;
}

/* Search Box & Filter Bar */
.controls-bar {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
}

.search-box-wrapper {
  position: relative; width: 260px;
}

.search-box-input {
  width: 100%; height: 40px; padding-left: 38px; padding-right: 14px;
  background: var(--card); border: 1px solid var(--border-gold);
  border-radius: var(--radius-md); font-size: 13px; font-weight: 500;
  color: var(--text); outline: none; transition: all 0.2s ease;
}

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

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

/* Filter Tabs */
.filter-tabs {
  display: flex; align-items: center; gap: 4px;
  background: var(--card); padding: 4px;
  border: 1px solid var(--border-gold); border-radius: var(--radius-md);
}

.filter-tab {
  padding: 6px 14px; height: 32px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 500; color: var(--text-muted);
  border: none; background: transparent; cursor: pointer; transition: all 0.2s ease;
}

.filter-tab:hover { color: var(--text); }
.filter-tab.active {
  background: var(--gold-dim); color: var(--gold-bright);
  font-weight: 600; border: 1px solid var(--border-gold);
}

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

/* Preset Card Item */
.preset-card-item {
  background: var(--card);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex; flex-direction: column;
  transition: all 0.25s ease;
  position: relative;
}

.preset-card-item:hover {
  border-color: var(--gold-bright);
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6), 0 0 25px rgba(212, 175, 55, 0.12);
}

.preset-card-thumb-container {
  position: relative; width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden; background: var(--surface);
}

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

.preset-card-item:hover .preset-card-thumb-container img {
  transform: scale(1.06);
}

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

.ba-label {
  font-size: 11px; font-weight: 600; color: #E5E7EB;
  letter-spacing: 0.04em; uppercase;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

/* Card Body */
.preset-card-body {
  padding: 16px; display: flex; flex-direction: column; flex: 1;
}

.preset-card-header-row {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 8px;
  margin-bottom: 8px;
}

.preset-card-item-title {
  font-size: 16px; font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1;
}

/* Status Badges */
.status-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 600; uppercase;
}

.status-badge-published {
  background: rgba(16, 185, 129, 0.15);
  color: #34D399; border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-badge-pending {
  background: rgba(245, 158, 11, 0.15);
  color: #FBBF24; border: 1px solid rgba(245, 158, 11, 0.3);
}

.status-badge-draft {
  background: rgba(156, 163, 175, 0.15);
  color: #9CA3AF; border: 1px solid rgba(156, 163, 175, 0.3);
}

/* Action Buttons Grid */
.preset-card-actions {
  display: flex; align-items: center; gap: 8px;
  margin-top: auto; pt: 12px;
}

.btn-card-edit {
  flex: 1; height: 38px; padding: 0 10px;
  background: var(--gold-dim); border: 1px solid var(--border-gold);
  color: var(--gold-bright); font-size: 13px; font-weight: 600;
  border-radius: var(--radius-sm); cursor: pointer; text-align: center;
  transition: all 0.2s ease;
}

.btn-card-edit:hover {
  background: var(--gold); color: #000;
}

.btn-card-stats {
  flex: 1.2; height: 38px; padding: 0 10px;
  background: var(--surface); border: 1px solid var(--border-subtle);
  color: var(--text-muted); font-size: 13px; font-weight: 500;
  border-radius: var(--radius-sm); text-align: center;
  display: inline-flex; align-items: center; justify-content: center;
  transition: all 0.2s ease;
}

.btn-card-stats:hover {
  color: var(--text); background: rgba(255, 255, 255, 0.06);
  border-color: var(--border-gold);
}

.btn-card-more {
  width: 38px; height: 38px; border-radius: var(--radius-sm);
  background: var(--surface); border: 1px solid var(--border-subtle);
  color: var(--text-muted); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s ease; flex-shrink: 0;
}

.btn-card-more:hover {
  color: var(--gold); border-color: var(--border-gold);
}

/* Empty & Skeleton States */
.empty-state-box {
  grid-column: 1 / -1;
  text-align: center; padding: 64px 20px;
  background: var(--card); border: 1px dashed var(--border-gold);
  border-radius: var(--radius-lg);
}

.empty-state-icon {
  width: 48px; height: 48px; color: var(--gold); margin: 0 auto 16px;
  opacity: 0.8;
}

.empty-state-title { font-size: 18px; font-weight: 700; margin-bottom: 6px; }
.empty-state-desc { font-size: 14px; color: var(--text-muted); max-width: 400px; margin: 0 auto 20px; }

.skeleton-card {
  height: 280px; background: var(--card); border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle); animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 0.3; }
}

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

@media (max-width: 900px) {
  .presets-grid-responsive { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .profile-main { padding-left: 16px; padding-right: 16px; }
  .profile-hero-banner { height: 260px; }
  .profile-name { font-size: 24px; }
  .profile-avatar { width: 80px; height: 80px; font-size: 28px; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .stat-card { padding: 14px; min-height: 100px; }
  .stat-value { font-size: 22px; }
  .presets-grid-responsive { grid-template-columns: 1fr; gap: 16px; }
  .controls-bar { width: 100%; flex-direction: column; align-items: stretch; }
  .search-box-wrapper { width: 100%; }
  .filter-tabs { width: 100%; justify-content: space-around; }
  .filter-tab { flex: 1; text-align: center; }
  .profile-cover-action { top: 12px; right: 12px; }
}
