/* ═══════════════════════════════════════════════════════════════
   FotoEventos — Design System
   Aesthetic: Dark luxury editorial, photo-first, Instagram-inspired
═══════════════════════════════════════════════════════════════ */

:root {
  --bg: #0a0a0a;
  --bg-2: #111111;
  --bg-3: #1a1a1a;
  --bg-4: #222222;
  --border: rgba(255,255,255,0.08);
  --border-hover: rgba(255,255,255,0.18);
  --text: #f0ede8;
  --text-2: #9a9690;
  --text-3: #5a5754;
  --accent: #e8c97e;
  --accent-dim: rgba(232,201,126,0.15);
  --red: #e85555;
  --green: #5cb85c;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 18px;
  --font-body: 'DM Sans', sans-serif;
  --font-display: 'Playfair Display', serif;
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow: 0 4px 24px rgba(0,0,0,0.6);
  --shadow-lg: 0 12px 48px rgba(0,0,0,0.8);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ── Typography ── */
h1, h2, h3 { font-family: var(--font-display); letter-spacing: -0.02em; }
h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); font-weight: 400; }
h2 { font-size: clamp(1.3rem, 3vw, 1.8rem); font-weight: 400; }
h3 { font-size: 1.1rem; font-weight: 400; }
p, label, input, textarea, select, button { font-family: var(--font-body); }
a { color: inherit; text-decoration: none; }

/* ── Navbar ── */
.navbar {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; height: 60px;
  background: rgba(10,10,10,0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.navbar-brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 600; font-size: 1rem; letter-spacing: -0.01em;
}
.navbar-links { display: flex; align-items: center; gap: 8px; }
.nav-link {
  padding: 6px 14px; border-radius: var(--radius-sm);
  font-size: 0.875rem; font-weight: 500; color: var(--text-2);
  transition: color var(--transition), background var(--transition);
}
.nav-link:hover, .nav-link.active { color: var(--text); background: var(--bg-3); }

/* ── Main content ── */
.main-content { padding: 32px 24px; max-width: 1200px; margin: 0 auto; }

/* ── Page header ── */
.page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; margin-bottom: 32px; flex-wrap: wrap;
}
.page-header h1 { line-height: 1.1; }
.page-header p { color: var(--text-2); font-size: 0.9rem; margin-top: 4px; }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 20px; border-radius: var(--radius-sm);
  font-size: 0.875rem; font-weight: 500; cursor: pointer;
  border: none; transition: all var(--transition); white-space: nowrap;
}
.btn-primary {
  background: var(--accent); color: #0a0a0a;
}
.btn-primary:hover { background: #f0d68e; transform: translateY(-1px); box-shadow: 0 4px 16px rgba(232,201,126,0.3); }
.btn-secondary {
  background: var(--bg-3); color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--bg-4); border-color: var(--border-hover); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { color: var(--text); background: var(--bg-3); }
.btn-danger { background: var(--red); color: white; }
.btn-sm { padding: 6px 12px; font-size: 0.8rem; }
.btn-icon { padding: 8px; border-radius: 50%; aspect-ratio: 1; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none !important; }

/* ── Cards ── */
.card {
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  transition: border-color var(--transition), transform var(--transition);
}
.card:hover { border-color: var(--border-hover); }
.card-body { padding: 20px; }

/* ── Event Grid (Admin) ── */
.events-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.event-card {
  cursor: pointer;
  position: relative; overflow: hidden;
}
.event-card:hover { transform: translateY(-2px); }
.event-card-cover {
  width: 100%; aspect-ratio: 16/9; object-fit: cover;
  background: var(--bg-3);
  display: flex; align-items: center; justify-content: center;
}
.event-card-cover-placeholder {
  width: 100%; aspect-ratio: 16/9; background: var(--bg-3);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-3);
}
.event-card-body { padding: 16px; }
.event-card-title { font-family: var(--font-display); font-size: 1rem; margin-bottom: 4px; }
.event-card-meta { font-size: 0.78rem; color: var(--text-2); display: flex; gap: 12px; flex-wrap: wrap; margin-top: 8px; }
.event-card-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.badge {
  display: inline-flex; align-items: center;
  padding: 2px 8px; border-radius: 20px; font-size: 0.72rem; font-weight: 500;
}
.badge-active { background: rgba(92,184,92,0.15); color: var(--green); }
.badge-inactive { background: rgba(232,85,85,0.15); color: var(--red); }

/* ── Forms ── */
.form-group { margin-bottom: 20px; }
.form-label { display: block; font-size: 0.82rem; font-weight: 500; color: var(--text-2); margin-bottom: 6px; letter-spacing: 0.04em; text-transform: uppercase; }
.form-control {
  width: 100%; padding: 11px 14px; background: var(--bg-3);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text); font-size: 0.9rem;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.form-control:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }
.form-control::placeholder { color: var(--text-3); }
select.form-control { appearance: none; cursor: pointer; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-section { padding: 24px; border-bottom: 1px solid var(--border); }
.form-section:last-child { border-bottom: none; }
.form-section-title { font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-3); margin-bottom: 20px; }
.form-footer { padding: 20px 24px; display: flex; gap: 12px; background: var(--bg-2); border-top: 1px solid var(--border); }

/* ── Alert ── */
.alert { padding: 12px 16px; border-radius: var(--radius-sm); font-size: 0.875rem; margin-bottom: 20px; }
.alert-error { background: rgba(232,85,85,0.1); color: var(--red); border: 1px solid rgba(232,85,85,0.2); }
.alert-success { background: rgba(92,184,92,0.1); color: var(--green); border: 1px solid rgba(92,184,92,0.2); }

/* ── Login ── */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: var(--bg);
  background-image: radial-gradient(ellipse at 20% 50%, rgba(232,201,126,0.04) 0%, transparent 50%),
                    radial-gradient(ellipse at 80% 20%, rgba(232,201,126,0.03) 0%, transparent 50%);
}
.login-card {
  width: 100%; max-width: 400px; margin: 0 16px;
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
}
.login-header { padding: 36px 32px 0; text-align: center; }
.login-logo {
  width: 52px; height: 52px; background: var(--accent-dim);
  border-radius: 14px; display: flex; align-items: center; justify-content: center;
  margin: 0 auto 20px;
}
.login-title { font-family: var(--font-display); font-size: 1.6rem; font-weight: 400; margin-bottom: 4px; }
.login-subtitle { font-size: 0.85rem; color: var(--text-2); }
.login-body { padding: 28px 32px 36px; }

/* ── Upload zone ── */
.upload-zone {
  border: 2px dashed var(--border); border-radius: var(--radius);
  padding: 48px 24px; text-align: center; cursor: pointer;
  transition: all var(--transition); position: relative;
}
.upload-zone:hover, .upload-zone.drag-over {
  border-color: var(--accent); background: var(--accent-dim);
}
.upload-zone input[type="file"] {
  position: absolute; inset: 0; opacity: 0; cursor: pointer;
}
.upload-zone-icon { font-size: 2.5rem; margin-bottom: 12px; opacity: 0.5; }
.upload-zone-text { font-size: 0.9rem; color: var(--text-2); }
.upload-zone-text strong { color: var(--accent); }
.upload-progress { margin-top: 24px; }
.upload-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 0.85rem;
}
.upload-item:last-child { border-bottom: none; }
.upload-item-name { flex: 1; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-item-status { font-size: 0.78rem; font-weight: 500; }
.status-ok { color: var(--green); }
.status-err { color: var(--red); }
.status-pending { color: var(--text-3); }

/* ── Print Queue ── */
.queue-table { width: 100%; border-collapse: collapse; }
.queue-table th, .queue-table td {
  padding: 12px 16px; text-align: left;
  border-bottom: 1px solid var(--border); font-size: 0.875rem;
}
.queue-table th { color: var(--text-3); font-weight: 500; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; }
.queue-table tr:hover td { background: var(--bg-3); }
.queue-thumb { width: 48px; height: 48px; object-fit: cover; border-radius: 6px; background: var(--bg-3); }

/* ── Frames ── */
.frames-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.frame-card { cursor: pointer; text-align: center; }
.frame-preview {
  aspect-ratio: 4/3; background: var(--bg-3); border-radius: var(--radius-sm);
  margin-bottom: 10px; display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--border); transition: border-color var(--transition);
  overflow: hidden;
}
.frame-card.selected .frame-preview { border-color: var(--accent); }
.frame-name { font-size: 0.85rem; color: var(--text-2); }

/* ── Tabs ── */
.tabs { display: flex; gap: 4px; margin-bottom: 24px; border-bottom: 1px solid var(--border); }
.tab-btn {
  padding: 10px 20px; background: none; border: none; cursor: pointer;
  font-family: var(--font-body); font-size: 0.875rem; color: var(--text-2);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: color var(--transition), border-color var(--transition);
}
.tab-btn.active { color: var(--text); border-bottom-color: var(--accent); }
.tab-btn:hover { color: var(--text); }

/* ── Skeleton ── */
.skeleton {
  background: linear-gradient(90deg, var(--bg-3) 25%, var(--bg-4) 50%, var(--bg-3) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--radius-sm);
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ── Responsive ── */
@media (max-width: 640px) {
  .main-content { padding: 20px 16px; }
  .form-row { grid-template-columns: 1fr; }
  .page-header { flex-direction: column; }
  .navbar { padding: 0 16px; }
  .events-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--bg-4); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-3); }
