/* ─── LuxePersona Dashboard ─────────────────────────────── */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --black: #0a0a0a;
  --dark: #111111;
  --card: #161616;
  --card-hover: #1a1a1a;
  --border: #222;
  --gold: #c9a44a;
  --gold-light: #e8d48b;
  --gold-dim: rgba(201,164,74,0.15);
  --cream: #f5f0e8;
  --muted: #888;
  --white: #fafafa;
  --danger: #e74c3c;
  --success: #27ae60;
  --info: #3498db;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--black);
  color: var(--cream);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
}

body::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 1;
}

/* ─── LAYOUT ─── */
.app-layout {
  display: flex;
  min-height: 100vh;
  position: relative;
  z-index: 2;
}

/* ─── SIDEBAR ─── */
.sidebar {
  width: 240px;
  background: var(--dark);
  border-right: 1px solid var(--border);
  padding: 24px 0;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 10;
}

.sidebar-logo {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 1.3rem;
  letter-spacing: -0.5px;
  color: var(--white);
  padding: 0 24px;
  margin-bottom: 8px;
}

.sidebar-logo span { color: var(--gold); }

.sidebar-tag {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: var(--muted);
  padding: 0 24px;
  margin-bottom: 32px;
}

.sidebar-nav { flex: 1; }

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  transition: all 0.2s;
  border-left: 3px solid transparent;
  cursor: pointer;
}

.sidebar-link:hover {
  color: var(--cream);
  background: rgba(255,255,255,0.03);
}

.sidebar-link.active {
  color: var(--gold);
  background: var(--gold-dim);
  border-left-color: var(--gold);
}

.sidebar-link svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.sidebar-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
}

.sidebar-footer a {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.8rem;
  transition: color 0.2s;
}

.sidebar-footer a:hover { color: var(--cream); }

/* ─── MAIN CONTENT ─── */
.main {
  flex: 1;
  margin-left: 240px;
  padding: 32px 40px;
  min-height: 100vh;
}

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

.page-title {
  font-family: 'Syne', sans-serif;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--white);
  letter-spacing: -0.5px;
}

.page-subtitle {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 4px;
  font-weight: 300;
}

/* ─── BUTTONS ─── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 8px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.btn-gold {
  background: var(--gold);
  color: var(--black);
}

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

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

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

.btn-danger {
  background: transparent;
  color: var(--danger);
  border: 1px solid rgba(231,76,60,0.3);
}

.btn-danger:hover {
  background: rgba(231,76,60,0.1);
  border-color: var(--danger);
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.8rem;
}

.btn svg {
  width: 16px;
  height: 16px;
}

/* ─── STATS CARDS ─── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
}

.stat-card-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--muted);
  margin-bottom: 8px;
}

.stat-card-value {
  font-family: 'Syne', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--gold);
}

/* ─── PERSONA GRID ─── */
.persona-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.persona-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s;
  cursor: pointer;
}

.persona-card:hover {
  border-color: var(--gold);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(201,164,74,0.08);
}

.persona-card-avatar {
  width: 100%;
  height: 200px;
  background: linear-gradient(135deg, var(--dark), var(--card));
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

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

.persona-card-avatar .placeholder {
  font-family: 'Syne', sans-serif;
  font-size: 3rem;
  font-weight: 800;
  color: var(--gold);
  opacity: 0.3;
}

.persona-card-body {
  padding: 20px;
}

.persona-card-name {
  font-family: 'Syne', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 4px;
}

.persona-card-platform {
  font-size: 0.8rem;
  color: var(--muted);
  text-transform: capitalize;
  margin-bottom: 12px;
}

.persona-card-stats {
  display: flex;
  gap: 16px;
}

.persona-card-stat {
  font-size: 0.75rem;
  color: var(--muted);
}

.persona-card-stat strong {
  color: var(--cream);
  font-weight: 500;
}

.persona-status {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 500;
}

.persona-status.draft {
  background: rgba(136,136,136,0.15);
  color: var(--muted);
}

.persona-status.active {
  background: rgba(39,174,96,0.15);
  color: var(--success);
}

.persona-status.paused {
  background: rgba(201,164,74,0.15);
  color: var(--gold);
}

/* ─── EMPTY STATE ─── */
.empty-state {
  text-align: center;
  padding: 80px 20px;
  border: 2px dashed var(--border);
  border-radius: 16px;
  background: rgba(22,22,22,0.5);
}

.empty-state h3 {
  font-family: 'Syne', sans-serif;
  font-size: 1.4rem;
  color: var(--white);
  margin-bottom: 8px;
}

.empty-state p {
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 24px;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

/* ─── MODAL ─── */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--dark);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 90%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(20px);
  transition: transform 0.3s;
}

.modal-overlay.active .modal {
  transform: translateY(0);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 28px;
  border-bottom: 1px solid var(--border);
}

.modal-title {
  font-family: 'Syne', sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--white);
}

.modal-close {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  transition: color 0.2s;
}

.modal-close:hover { color: var(--white); }

.modal-body {
  padding: 28px;
}

.modal-footer {
  padding: 20px 28px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* ─── FORM ─── */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--muted);
  margin-bottom: 8px;
}

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 16px;
  color: var(--cream);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  transition: border-color 0.2s;
  outline: none;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  border-color: var(--gold);
}

.form-textarea {
  min-height: 100px;
  resize: vertical;
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23888' fill='none' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

.form-select option {
  background: var(--dark);
  color: var(--cream);
}

/* ─── AVATAR UPLOAD ─── */
.avatar-upload {
  width: 120px;
  height: 120px;
  border-radius: 16px;
  border: 2px dashed var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  overflow: hidden;
  background: var(--card);
  position: relative;
}

.avatar-upload:hover {
  border-color: var(--gold);
}

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

.avatar-upload .upload-hint {
  font-size: 0.7rem;
  color: var(--muted);
  text-align: center;
  padding: 8px;
}

.avatar-upload svg {
  color: var(--muted);
  margin-bottom: 4px;
}

/* ─── PERSONA DETAIL ─── */
.persona-header {
  display: flex;
  gap: 32px;
  margin-bottom: 40px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--border);
}

.persona-avatar-large {
  width: 180px;
  height: 180px;
  border-radius: 16px;
  background: var(--card);
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.persona-avatar-large .placeholder {
  font-family: 'Syne', sans-serif;
  font-size: 4rem;
  font-weight: 800;
  color: var(--gold);
  opacity: 0.3;
}

.persona-info { flex: 1; }

.persona-info h1 {
  font-family: 'Syne', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 8px;
}

.persona-meta {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-bottom: 16px;
}

.persona-backstory {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.7;
  max-width: 600px;
}

.persona-detail-stats {
  display: flex;
  gap: 32px;
  margin-top: 20px;
}

.persona-detail-stat {
  text-align: center;
}

.persona-detail-stat .value {
  font-family: 'Syne', sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--gold);
}

.persona-detail-stat .label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--muted);
  margin-top: 2px;
}

.persona-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

/* ─── CONTENT GALLERY ─── */
.gallery-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.gallery-header h2 {
  font-family: 'Syne', sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--white);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.gallery-item {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  aspect-ratio: 1;
  background: var(--card);
  cursor: pointer;
  transition: all 0.2s;
}

.gallery-item:hover {
  border-color: var(--gold);
  transform: scale(1.02);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-item-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 12px;
  background: linear-gradient(transparent, rgba(0,0,0,0.8));
  opacity: 0;
  transition: opacity 0.2s;
}

.gallery-item:hover .gallery-item-overlay {
  opacity: 1;
}

.gallery-item-title {
  font-size: 0.8rem;
  color: var(--white);
  font-weight: 500;
}

.gallery-item-meta {
  font-size: 0.7rem;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4px;
}

.gallery-item-delete {
  background: none;
  border: none;
  color: var(--danger);
  cursor: pointer;
  padding: 2px;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.gallery-item-delete:hover {
  opacity: 1;
}

.gallery-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  border: 2px dashed var(--border);
  border-radius: 12px;
}

.gallery-empty p {
  color: var(--muted);
  margin-bottom: 16px;
}

/* ─── UPLOAD ZONE ─── */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 40px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 20px;
  background: var(--card);
}

.upload-zone:hover,
.upload-zone.dragover {
  border-color: var(--gold);
  background: var(--gold-dim);
}

.upload-zone svg {
  color: var(--muted);
  margin-bottom: 12px;
}

.upload-zone p {
  color: var(--muted);
  font-size: 0.9rem;
}

.upload-zone .browse {
  color: var(--gold);
  text-decoration: underline;
  cursor: pointer;
}

.upload-preview {
  width: 100%;
  max-height: 300px;
  object-fit: contain;
  border-radius: 8px;
  margin-bottom: 16px;
  display: none;
}

.upload-preview.visible {
  display: block;
}

/* ─── BREADCRUMB ─── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
  font-size: 0.85rem;
}

.breadcrumb a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
}

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

.breadcrumb .sep { color: #333; }

.breadcrumb .current { color: var(--cream); }

/* ─── TOAST ─── */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 20px;
  color: var(--cream);
  font-size: 0.85rem;
  animation: slideIn 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 260px;
}

.toast.success { border-left: 3px solid var(--success); }
.toast.error { border-left: 3px solid var(--danger); }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ─── LOADING ─── */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px;
  color: var(--muted);
}

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

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

/* ─── SCROLLBAR ─── */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--black);
}

::-webkit-scrollbar-thumb {
  background: #333;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #444;
}

/* ─── UPGRADE BANNER ─── */
.upgrade-banner {
  background: linear-gradient(135deg, rgba(201,164,74,0.08), rgba(201,164,74,0.02));
  border: 1px solid rgba(201,164,74,0.2);
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: 32px;
  transition: all 0.2s;
}

.upgrade-banner:hover {
  border-color: var(--gold);
  background: linear-gradient(135deg, rgba(201,164,74,0.12), rgba(201,164,74,0.04));
}

.upgrade-banner-content {
  display: flex;
  align-items: center;
  gap: 16px;
}

.upgrade-banner-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--gold-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold);
  flex-shrink: 0;
}

/* ─── PRICING PAGE ─── */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.pricing-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  transition: all 0.3s;
  position: relative;
}

.pricing-card:hover {
  border-color: rgba(201,164,74,0.3);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

.pricing-card.popular {
  border-color: var(--gold);
  box-shadow: 0 0 40px rgba(201,164,74,0.08);
}

.pricing-badge {
  position: absolute;
  top: 16px;
  right: 16px;
  background: var(--gold);
  color: var(--black);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  padding: 4px 12px;
  border-radius: 12px;
  font-weight: 700;
}

.pricing-card-header {
  padding: 36px 28px 24px;
  border-bottom: 1px solid var(--border);
}

.pricing-tier {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: var(--muted);
  margin-bottom: 12px;
}

.pricing-price {
  font-family: 'Syne', sans-serif;
  font-size: 2.8rem;
  font-weight: 800;
  color: var(--white);
  line-height: 1;
  margin-bottom: 8px;
}

.pricing-price span {
  font-size: 1rem;
  font-weight: 400;
  color: var(--muted);
}

.pricing-desc {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 300;
}

.pricing-card-body {
  padding: 28px;
}

.pricing-features {
  list-style: none;
  margin-bottom: 28px;
}

.pricing-features li {
  color: var(--cream);
  font-size: 0.9rem;
  padding: 10px 0;
  border-bottom: 1px solid rgba(34,34,34,0.8);
  display: flex;
  align-items: center;
  gap: 10px;
}

.pricing-features li:last-child {
  border-bottom: none;
}

.pricing-features .check {
  color: var(--gold);
  font-weight: 600;
}

/* ─── MOBILE ─── */
@media (max-width: 768px) {
  .sidebar {
    width: 60px;
    overflow: hidden;
  }

  .sidebar-logo, .sidebar-tag {
    display: none;
  }

  .sidebar-link {
    justify-content: center;
    padding: 14px 0;
  }

  .sidebar-link span { display: none; }
  .sidebar-footer { display: none; }

  .main {
    margin-left: 60px;
    padding: 20px 16px;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .persona-grid {
    grid-template-columns: 1fr;
  }

  .persona-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .page-header {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }

  .pricing-grid {
    grid-template-columns: 1fr;
  }

  .upgrade-banner-content {
    flex-direction: column;
    text-align: center;
  }
}
