/* ============================================================
   fiesta-photos · assets/css/app.css
   ============================================================ */

/* ── Variables ─────────────────────────────────────────────── */
:root {
  --bg:           #0f0c1a;
  --surface:      #1a1630;
  --surface2:     #241e3f;
  --border:       rgba(255,255,255,0.08);
  --accent:       #c084fc;
  --accent2:      #f472b6;
  --gold:         #fbbf24;
  --text:         #f1f0f5;
  --text-muted:   #8b7fa8;
  --green:        #22c55e;
  --red:          #ef4444;
  --amber:        #f59e0b;
  --radius:       14px;
  --radius-sm:    8px;
  --shadow:       0 8px 32px rgba(0,0,0,0.4);
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body:    'DM Sans', system-ui, sans-serif;
}

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

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ══════════════════════════════════════════════════════════════
   UPLOADER PAGE
══════════════════════════════════════════════════════════════ */

.uploader-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem 1rem;
  background: radial-gradient(ellipse at 30% 20%, #3b1f6e 0%, var(--bg) 60%);
}

.uploader-container {
  width: 100%;
  max-width: 540px;
}

.uploader-header {
  text-align: center;
  margin-bottom: 2rem;
  position: relative;
}

.evento-titulo {
  font-family: var(--font-display);
  font-size: clamp(2rem, 6vw, 3rem);
  background: linear-gradient(135deg, var(--accent), var(--accent2), var(--gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
}

.evento-subtitulo {
  color: var(--text-muted);
  margin-top: .5rem;
  font-weight: 300;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
}

.card--closed {
  text-align: center;
  padding: 3rem 2rem;
}
.card--closed .icon { font-size: 3rem; display: block; margin-bottom: 1rem; }
.card--closed h2   { font-family: var(--font-display); margin-bottom: .5rem; }
.card--closed p    { color: var(--text-muted); }

/* Drop zone */
.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 3rem 2rem;
  text-align: center;
  transition: border-color .2s, background .2s;
  cursor: pointer;
}
.drop-zone.drag-over {
  border-color: var(--accent);
  background: rgba(192,132,252,.07);
}
.drop-icon  { font-size: 3rem; margin-bottom: 1rem; }
.drop-text  { font-size: 1.1rem; font-weight: 500; margin-bottom: .3rem; }
.drop-sub   { color: var(--text-muted); margin-bottom: 1rem; }
.drop-formatos { font-size: .8rem; color: var(--text-muted); margin-top: 1rem; }

/* Elegir archivos button */
.btn-elegir {
  display: inline-block;
  padding: .6rem 1.6rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 50px;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: .95rem;
  transition: background .2s;
}
.btn-elegir:hover { background: var(--accent); color: #fff; }

/* Preview grid */
.preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: .75rem;
  margin-top: 1.5rem;
}
.preview-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface2);
}
.preview-item img, .preview-item video {
  width: 100%; height: 100%;
  object-fit: cover;
}
.preview-remove {
  position: absolute; top: 4px; right: 4px;
  width: 20px; height: 20px;
  background: rgba(0,0,0,.7);
  border: none; border-radius: 50%;
  color: #fff; font-size: .75rem;
  cursor: pointer; display: flex;
  align-items: center; justify-content: center;
}
.preview-status {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
  background: rgba(0,0,0,.5);
  opacity: 0; transition: opacity .3s;
}
.preview-status.visible { opacity: 1; }

/* Botón subir */
.btn-subir {
  display: block; width: 100%;
  margin-top: 1.5rem;
  padding: .9rem;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border: none; border-radius: 50px;
  color: #fff; font-size: 1.05rem; font-weight: 500;
  font-family: var(--font-body);
  cursor: pointer; transition: opacity .2s, transform .1s;
}
.btn-subir:hover   { opacity: .9; }
.btn-subir:active  { transform: scale(.98); }
.btn-subir:disabled { opacity: .5; cursor: not-allowed; }

/* Progreso */
.progreso-wrap { margin-top: 1.5rem; }
.progreso-label { font-size: .9rem; color: var(--text-muted); margin-bottom: .5rem; }
.progreso-bar   {
  height: 8px; background: var(--surface2);
  border-radius: 99px; overflow: hidden;
}
.progreso-fill  {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  border-radius: 99px;
  transition: width .4s ease;
  width: 0%;
}

/* Resultado */
.resultado {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: var(--radius-sm);
  text-align: center;
  font-weight: 500;
}
.resultado--ok  { background: rgba(34,197,94,.1); color: var(--green); }
.resultado--err { background: rgba(239,68,68,.1);  color: var(--red); }

/* Footer */
.uploader-footer {
  text-align: center;
  margin-top: 1.5rem;
  color: var(--text-muted);
  font-size: .9rem;
}

/* ══════════════════════════════════════════════════════════════
   GALERÍA PAGE
══════════════════════════════════════════════════════════════ */

.galeria-page { background: var(--bg); }

.galeria-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(15,12,26,.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 1rem 2rem;
}
.galeria-header-inner {
  max-width: 1400px; margin: 0 auto;
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
}
.galeria-header h1 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  flex: 1;
}
.badge-total {
  background: var(--surface2);
  padding: .3rem .8rem;
  border-radius: 99px;
  font-size: .85rem;
  color: var(--text-muted);
}
.btn-subir-header {
  padding: .5rem 1.2rem;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-radius: 99px;
  color: #fff; font-size: .9rem; font-weight: 500;
  text-decoration: none;
}

.galeria-main { max-width: 1400px; margin: 0 auto; padding: 2rem; }

.galeria-vacia {
  text-align: center;
  padding: 6rem 2rem;
  color: var(--text-muted);
}
.galeria-vacia span { font-size: 4rem; display: block; margin-bottom: 1rem; }
.galeria-vacia p   { margin-bottom: 1.5rem; }

/* Masonry grid */
.masonry-grid {
  columns: 5 220px;
  column-gap: 12px;
}
.masonry-item {
  break-inside: avoid;
  margin-bottom: 12px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  position: relative;
  background: var(--surface);
}
.galeria-img {
  display: block; width: 100%;
  transition: transform .3s;
}
.masonry-item:hover .galeria-img { transform: scale(1.03); }

.video-thumb { position: relative; }
.play-overlay {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 2.5rem;
  background: rgba(0,0,0,.35);
  color: #fff;
  transition: background .2s;
}
.video-thumb:hover .play-overlay { background: rgba(0,0,0,.5); }

/* Lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,.92);
  display: flex; align-items: center; justify-content: center;
}
.lb-media-wrap { max-width: 90vw; max-height: 90vh; }
.lb-media-wrap img, .lb-media-wrap video {
  max-width: 100%; max-height: 90vh;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
}
.lb-close, .lb-prev, .lb-next {
  position: fixed;
  background: rgba(255,255,255,.1);
  border: none; color: #fff;
  font-size: 1.5rem; cursor: pointer;
  border-radius: 50%;
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  transition: background .2s;
}
.lb-close:hover, .lb-prev:hover, .lb-next:hover { background: rgba(255,255,255,.25); }
.lb-close { top: 1rem; right: 1rem; }
.lb-prev  { left: 1rem;  top: 50%; transform: translateY(-50%); }
.lb-next  { right: 1rem; top: 50%; transform: translateY(-50%); }
.lb-counter {
  position: fixed; bottom: 1.5rem; left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,.6); font-size: .9rem;
}

/* ══════════════════════════════════════════════════════════════
   ADMIN – LOGIN
══════════════════════════════════════════════════════════════ */

.admin-login-page {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh;
  background: radial-gradient(ellipse at 60% 30%, #2d1b5e 0%, var(--bg) 60%);
}

.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem;
  width: 100%; max-width: 380px;
  box-shadow: var(--shadow);
  text-align: center;
}
.login-icon { font-size: 2.5rem; margin-bottom: .75rem; }
.login-card h1 { font-family: var(--font-display); font-size: 1.8rem; margin-bottom: .25rem; }
.login-sub     { color: var(--text-muted); margin-bottom: 1.5rem; }

/* ══════════════════════════════════════════════════════════════
   ADMIN – DASHBOARD & FOTOS
══════════════════════════════════════════════════════════════ */

.admin-page { display: flex; min-height: 100vh; }

.admin-sidebar {
  width: 220px; flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  padding: 1.5rem 0;
  position: sticky; top: 0; height: 100vh;
}
.sidebar-logo {
  font-size: 2rem; text-align: center;
  margin-bottom: 2rem;
}
.sidebar-nav { flex: 1; }
.nav-item {
  display: block;
  padding: .7rem 1.5rem;
  color: var(--text-muted);
  font-size: .9rem;
  transition: background .15s, color .15s;
  text-decoration: none;
}
.nav-item:hover, .nav-item.active {
  background: var(--surface2);
  color: var(--text);
}
.sidebar-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  font-size: .8rem;
  color: var(--text-muted);
  display: flex; justify-content: space-between;
  align-items: center;
}

.admin-content {
  flex: 1;
  padding: 2rem;
  overflow-y: auto;
  background: var(--bg);
}

.admin-topbar {
  display: flex; align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
}
.admin-topbar h1 {
  font-family: var(--font-display);
  font-size: 1.8rem;
}

/* Stats */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  text-align: center;
}
.stat-icon { font-size: 1.8rem; margin-bottom: .5rem; }
.stat-num  { font-size: 2rem; font-weight: 700; font-family: var(--font-display); }
.stat-label { font-size: .8rem; color: var(--text-muted); margin-top: .25rem; }

/* Sections */
.admin-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}
.admin-section h2 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  margin-bottom: 1rem;
}

/* Table */
.admin-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.admin-table th {
  text-align: left;
  padding: .6rem 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  font-weight: 500;
}
.admin-table td {
  padding: .7rem 1rem;
  border-bottom: 1px solid var(--border);
}
.row--active td { background: rgba(192,132,252,.05); }

/* Mini bar */
.mini-bar { height: 6px; background: var(--surface2); border-radius: 99px; overflow: hidden; width: 100px; display: inline-block; vertical-align: middle; }
.mini-fill { height: 100%; border-radius: 99px; }
.mini-pct  { font-size: .8rem; color: var(--text-muted); margin-left: .4rem; }

/* Badges */
.badge {
  display: inline-block;
  padding: .2rem .7rem;
  border-radius: 99px;
  font-size: .78rem;
  font-weight: 500;
}
.badge--green { background: rgba(34,197,94,.15);  color: var(--green); }
.badge--red   { background: rgba(239,68,68,.15);   color: var(--red);   }
.badge--gray  { background: var(--surface2);        color: var(--text-muted); }
.badge--amber { background: rgba(245,158,11,.15);  color: var(--amber); }

/* Buttons */
.btn-primary {
  display: inline-block;
  padding: .7rem 1.5rem;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border: none; border-radius: 99px;
  color: #fff; font-size: .95rem; font-weight: 500;
  font-family: var(--font-body);
  cursor: pointer; text-decoration: none;
  transition: opacity .2s;
}
.btn-primary:hover { opacity: .85; text-decoration: none; }
.btn-full { display: block; width: 100%; text-align: center; }

.btn-sm {
  padding: .35rem .85rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: .82rem;
  cursor: pointer;
  font-family: var(--font-body);
}
.btn-sm:hover { background: var(--accent); border-color: var(--accent); }
.btn-sm--outline { background: transparent; border-color: var(--accent); color: var(--accent); }

.btn-toggle {
  padding: .5rem 1.2rem;
  border: none; border-radius: 99px;
  font-family: var(--font-body);
  font-size: .9rem; cursor: pointer;
}
.btn-toggle--on  { background: rgba(34,197,94,.15); color: var(--green); }
.btn-toggle--off { background: rgba(239,68,68,.15);  color: var(--red); }

/* Config form */
.config-form { display: flex; gap: 1rem; align-items: flex-end; flex-wrap: wrap; }

/* Hora chart */
.hora-chart { display: flex; align-items: flex-end; gap: 8px; height: 120px; }
.hora-bar-wrap { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.hora-bar {
  width: 28px;
  background: linear-gradient(to top, var(--accent), var(--accent2));
  border-radius: 4px 4px 0 0;
  min-height: 4px;
}
.hora-label { font-size: .7rem; color: var(--text-muted); }

/* Admin fotos grid */
.admin-fotos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
  margin-bottom: 2rem;
}
.admin-foto-item { border-radius: var(--radius-sm); overflow: hidden; }
.admin-foto-thumb {
  position: relative;
  aspect-ratio: 1;
  background: var(--surface);
}
.admin-foto-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
}
.admin-foto-overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.5);
  opacity: 0; transition: opacity .2s;
  display: flex; align-items: center; justify-content: center;
  gap: .5rem;
}
.admin-foto-item:hover .admin-foto-overlay { opacity: 1; }
.video-badge {
  position: absolute; bottom: 4px; left: 4px;
  background: rgba(0,0,0,.7);
  color: #fff; font-size: .7rem;
  padding: .15rem .4rem;
  border-radius: 4px;
}
.cuenta-badge {
  font-size: .72rem;
  background: rgba(192,132,252,.3);
  color: var(--accent);
  padding: .15rem .4rem;
  border-radius: 4px;
}
.btn-delete {
  background: none; border: none;
  cursor: pointer; font-size: 1.1rem;
  line-height: 1;
}

/* Pagination */
.pagination { display: flex; gap: .5rem; justify-content: center; }
.page-btn {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text); font-size: .85rem;
  text-decoration: none;
}
.page-btn--active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* Forms */
.form-group { margin-bottom: 1rem; }
.form-group label {
  display: block;
  font-size: .85rem;
  color: var(--text-muted);
  margin-bottom: .4rem;
}
.form-group input {
  width: 100%;
  padding: .65rem .9rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-body);
  font-size: .95rem;
  outline: none;
  transition: border-color .2s;
}
.form-group input:focus { border-color: var(--accent); }

/* Alert */
.alert {
  padding: .75rem 1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  font-size: .9rem;
}
.alert--error { background: rgba(239,68,68,.1); color: var(--red); border: 1px solid rgba(239,68,68,.2); }
.alert--ok    { background: rgba(34,197,94,.1);  color: var(--green); border: 1px solid rgba(34,197,94,.2); }

/* Scrollbar */
::-webkit-scrollbar       { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--surface2); border-radius: 3px; }

/* Responsive */
@media (max-width: 768px) {
  .admin-sidebar  { display: none; }
  .masonry-grid   { columns: 2 140px; }
  .stats-grid     { grid-template-columns: repeat(2, 1fr); }
  .galeria-header { padding: .75rem 1rem; }
  .galeria-main   { padding: 1rem; }
}
