/* ═══════════════════════════════════════════════════════════════
   ÁLBUM DIGITAL SST — Sistema de Diseño Principal
   ═══════════════════════════════════════════════════════════════ */

:root {
  --primary: #6c63ff;
  --secondary: #ff6584;
  --bg-start: #0f0c29;
  --bg-end: #302b63;
  --bg-angle: 135deg;
  --gradient: linear-gradient(var(--bg-angle), var(--primary), var(--secondary));
  --glass-bg: rgba(255,255,255,0.10);
  --glass-border: rgba(255,255,255,0.20);
  --glass-shadow: 0 8px 32px rgba(0,0,0,0.37);
  --blur: blur(20px);
  --border-radius: 16px;
  --transition: all 0.3s cubic-bezier(0.25,0.46,0.45,0.94);
  --font-main: 'Montserrat', sans-serif;
  --font-body: 'Inter', sans-serif;
  --text: #ffffff;
  --text-muted: rgba(255,255,255,0.65);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: radial-gradient(ellipse at top, var(--bg-start), var(--bg-end));
  background-attachment: fixed;
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Header ── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--glass-bg);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border-bottom: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
}

.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.logo-link { text-decoration: none; display: flex; align-items: center; }
.logo-img { height: 50px; max-width: 140px; object-fit: contain; }
.logo-text {
  font-family: var(--font-main);
  font-size: 1.25rem;
  font-weight: 800;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  white-space: nowrap;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-wrap: wrap;
}

.main-nav a {
  color: var(--text);
  text-decoration: none;
  padding: 0.4rem 0.75rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  transition: var(--transition);
  white-space: nowrap;
  position: relative;
}

.main-nav a::after {
  content: '';
  position: absolute;
  bottom: 0; left: 50%; right: 50%;
  height: 2px;
  background: var(--gradient);
  transition: var(--transition);
}

.main-nav a:hover::after { left: 10%; right: 10%; }
.main-nav a:hover { background: rgba(255,255,255,0.1); }

.btn-logout {
  background: rgba(255,100,100,0.2);
  border: 1px solid rgba(255,100,100,0.4);
  border-radius: 8px;
  padding: 0.4rem 0.75rem;
  color: #ff9999 !important;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  transition: var(--transition);
  white-space: nowrap;
}
.btn-logout:hover { background: rgba(255,100,100,0.35); }

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  z-index: 1100;
}

.hamburger span {
  display: block;
  width: 25px; height: 3px;
  background: var(--text);
  border-radius: 3px;
  transition: var(--transition);
}

.hamburger.active span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* ── Notifications ── */
.notif-wrapper { position: relative; }

.notif-bell {
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0.5rem;
  position: relative;
  transition: var(--transition);
}
.notif-bell:hover { transform: scale(1.1); }

.notification-badge {
  position: absolute;
  top: 0; right: 0;
  background: #e53e3e;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  min-width: 18px; height: 18px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--bg-start);
  animation: badgePop 0.3s cubic-bezier(0.34,1.56,0.64,1);
}

.notification-badge.hidden { display: none; }

.notif-panel {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  width: 340px;
  max-height: 480px;
  overflow-y: auto;
  z-index: 2000;
  display: none;
  padding: 0;
  animation: slideDown 0.25s ease;
}

.notif-panel.open { display: block; }

.notif-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--glass-border);
  font-weight: 700;
  font-size: 0.9rem;
}

.btn-link {
  background: none; border: none;
  color: var(--primary); cursor: pointer;
  font-size: 0.8rem; font-family: inherit;
  text-decoration: underline;
}

.notif-item {
  display: flex; gap: 0.75rem; align-items: flex-start;
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  cursor: pointer;
  transition: var(--transition);
}
.notif-item:hover { background: rgba(255,255,255,0.05); }
.notif-item.unread { background: rgba(108,99,255,0.08); }

.notif-icon { font-size: 1.1rem; margin-top: 2px; flex-shrink: 0; }
.notif-info { flex: 1; min-width: 0; }
.notif-title { font-weight: 600; font-size: 0.85rem; margin-bottom: 2px; }
.notif-snippet { font-size: 0.78rem; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notif-time { font-size: 0.72rem; color: var(--text-muted); margin-top: 3px; }

.notif-empty { text-align: center; padding: 1.5rem; color: var(--text-muted); font-size: 0.85rem; }

.notif-view-all {
  display: block;
  text-align: center;
  padding: 0.75rem;
  border-top: 1px solid var(--glass-border);
  color: var(--primary);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  transition: var(--transition);
}
.notif-view-all:hover { background: rgba(108,99,255,0.1); }

/* ── Main content ── */
.main-content {
  flex: 1;
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* ── Footer ── */
.site-footer {
  background: var(--glass-bg);
  backdrop-filter: var(--blur);
  border-top: 1px solid var(--glass-border);
  padding: 1.5rem;
  text-align: center;
}

.sponsors-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1rem;
  max-width: 800px;
  margin: 0 auto 1rem;
}

.sponsor-card {
  display: flex; flex-direction: column; align-items: center;
  padding: 1rem; text-decoration: none; color: var(--text);
  transition: var(--transition); gap: 0.5rem;
}
.sponsor-card:hover { transform: translateY(-3px); }
.sponsor-logo { height: 60px; max-width: 100px; object-fit: contain; }
.sponsor-placeholder { font-size: 2rem; color: var(--text-muted); }
.sponsor-name { font-size: 0.78rem; font-weight: 600; text-align: center; }

.footer-copy { color: var(--text-muted); font-size: 0.8rem; margin-top: 0.5rem; }

/* ── Glass Card ── */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius);
  box-shadow: var(--glass-shadow);
  color: var(--text);
}

/* ── Buttons ── */
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  background: var(--gradient);
  border: none; border-radius: 50px;
  padding: 12px 28px;
  font-weight: 700; font-size: 0.95rem; font-family: var(--font-body);
  color: white; cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(0,0,0,0.3); }
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 50px;
  padding: 10px 24px;
  font-weight: 600; font-size: 0.9rem; font-family: var(--font-body);
  color: white; cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}
.btn-secondary:hover { background: rgba(255,255,255,0.2); transform: translateY(-1px); }

.btn-danger {
  background: linear-gradient(135deg,#e53e3e,#c53030);
  border:none; border-radius: 50px; padding: 10px 22px;
  color:white; font-weight:600; cursor:pointer; font-family: var(--font-body);
  transition: var(--transition);
}
.btn-danger:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(229,62,62,0.4); }

/* ── Forms ── */
.form-group { margin-bottom: 1.25rem; }
.form-group label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 0.4rem; color: var(--text-muted); }

.input-wrap { position: relative; }
.input-wrap .input-icon { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 0.9rem; }
.input-wrap input,
.input-wrap select,
.input-wrap textarea {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.5rem;
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.9rem;
  transition: var(--transition);
  outline: none;
}
.input-wrap input:focus,
.input-wrap select:focus,
.input-wrap textarea:focus {
  border-color: var(--primary);
  background: rgba(255,255,255,0.12);
  box-shadow: 0 0 0 3px rgba(108,99,255,0.2);
}
.input-wrap select option { background: #1a1a2e; color: var(--text); }

input[type="checkbox"], input[type="radio"] { width: auto; accent-color: var(--primary); }

/* ── Progress Bar ── */
.progress-bar-wrap { background: rgba(255,255,255,0.1); border-radius: 50px; height: 10px; overflow: hidden; }
.progress-bar-fill {
  height: 100%;
  background: var(--gradient);
  border-radius: 50px;
  transition: width 0.6s cubic-bezier(0.25,0.46,0.45,0.94);
}

/* ── Alerts ── */
.alert {
  padding: 0.85rem 1.25rem;
  border-radius: 10px;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  display: flex; align-items: center; gap: 0.6rem;
  border: 1px solid;
}
.alert-success { background: rgba(56,161,105,0.15); border-color: rgba(56,161,105,0.4); color: #9ae6b4; }
.alert-danger  { background: rgba(229,62,62,0.15);  border-color: rgba(229,62,62,0.4);  color: #feb2b2; }
.alert-warning { background: rgba(237,137,54,0.15); border-color: rgba(237,137,54,0.4); color: #fbd38d; }
.alert-info    { background: rgba(66,153,225,0.15); border-color: rgba(66,153,225,0.4); color: #90cdf4; }

/* ── Toast ── */
.toast-container { position: fixed; top: 80px; right: 1.5rem; z-index: 9999; display: flex; flex-direction: column; gap: 0.5rem; }
.toast {
  padding: 0.85rem 1.25rem;
  border-radius: 12px;
  display: flex; align-items: center; gap: 0.75rem;
  font-size: 0.9rem; font-weight: 600;
  min-width: 260px; max-width: 380px;
  animation: slideInRight 0.35s cubic-bezier(0.34,1.56,0.64,1);
  cursor: pointer;
}
.toast-success { background: rgba(56,161,105,0.9); backdrop-filter: var(--blur); border: 1px solid rgba(56,161,105,0.5); }
.toast-danger  { background: rgba(229,62,62,0.9);  backdrop-filter: var(--blur); border: 1px solid rgba(229,62,62,0.5); }
.toast-info    { background: rgba(66,153,225,0.9); backdrop-filter: var(--blur); border: 1px solid rgba(66,153,225,0.5); }
.toast-warning { background: rgba(237,137,54,0.9); backdrop-filter: var(--blur); border: 1px solid rgba(237,137,54,0.5); }
.toast.removing { animation: slideOutRight 0.3s ease forwards; }

/* ── Modal ── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  z-index: 5000;
  animation: fadeIn 0.2s ease;
}

.modal-overlay.hidden { display: none; }

.modal-box {
  background: linear-gradient(135deg,#1a1a2e,#16213e);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 2rem;
  max-width: 500px;
  width: 90%;
  position: relative;
  animation: scaleIn 0.3s cubic-bezier(0.34,1.56,0.64,1);
}

.modal-close {
  position: absolute; top: 1rem; right: 1rem;
  background: none; border: none; color: var(--text-muted);
  font-size: 1.25rem; cursor: pointer; transition: var(--transition);
}
.modal-close:hover { color: var(--text); transform: rotate(90deg); }

/* ── Table ── */
.data-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.data-table th {
  text-align: left;
  padding: 0.75rem 1rem;
  background: rgba(255,255,255,0.06);
  color: var(--text-muted);
  font-weight: 600;
  border-bottom: 1px solid var(--glass-border);
}
.data-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  vertical-align: middle;
}
.data-table tr:hover td { background: rgba(255,255,255,0.03); }

/* ── Rarity badges ── */
.badge { display: inline-block; padding: 2px 10px; border-radius: 50px; font-size: 0.75rem; font-weight: 700; }
.badge-common    { background: rgba(150,150,150,0.25); color: #ccc; }
.badge-uncommon  { background: rgba(56,161,105,0.25); color: #9ae6b4; }
.badge-rare      { background: rgba(66,153,225,0.25); color: #90cdf4; }
.badge-epic      { background: rgba(159,122,234,0.25); color: #d6bcfa; }
.badge-legendary { background: rgba(237,137,54,0.25); color: #fbd38d; }

/* ── Spinner ── */
.spinner {
  display: inline-block;
  width: 20px; height: 20px;
  border: 3px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.spinner-lg { width: 40px; height: 40px; border-width: 4px; }

/* ── Tabs ── */
.tabs-nav {
  display: flex; gap: 0.5rem; flex-wrap: wrap;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--glass-border);
  padding-bottom: 0.5rem;
}

.tab-btn {
  padding: 0.6rem 1.25rem;
  background: none; border: none;
  color: var(--text-muted); cursor: pointer;
  font-family: var(--font-body); font-size: 0.9rem; font-weight: 600;
  border-radius: 8px; transition: var(--transition);
  border: 1px solid transparent;
}
.tab-btn.active, .tab-btn:hover {
  color: var(--text);
  background: rgba(108,99,255,0.15);
  border-color: var(--primary);
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── Album ── */
.album-container {
  position: relative;
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  aspect-ratio: 4/3;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5), 0 0 0 2px var(--glass-border);
}

.album-background {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}

.album-slot {
  position: absolute;
  cursor: pointer;
  border-radius: 8px;
  border: 2px dashed rgba(255,255,255,0.4);
  transition: var(--transition);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}

.album-slot:hover { border-color: var(--primary); background: rgba(108,99,255,0.1); }
.album-slot.filled { border-style: solid; border-color: rgba(255,255,255,0.2); }
.album-slot img { width: 100%; height: 100%; object-fit: contain; }

.album-slot-empty-icon { color: rgba(255,255,255,0.3); font-size: 1.5rem; }

/* ── Sticker card ── */
.sticker-card {
  display: flex; flex-direction: column; align-items: center;
  padding: 1rem;
  border-radius: 12px;
  cursor: grab;
  transition: var(--transition);
  gap: 0.5rem;
  text-align: center;
}
.sticker-card:hover { transform: translateY(-4px) scale(1.03); }
.sticker-card img { width: 80px; height: 80px; object-fit: contain; }
.sticker-card-name { font-size: 0.75rem; font-weight: 600; color: var(--text-muted); }
.sticker-card-dup { font-size: 0.7rem; background: rgba(255,255,255,0.15); border-radius: 50px; padding: 1px 8px; }

/* ── Pagination ── */
.album-nav {
  display: flex; align-items: center; justify-content: center; gap: 1.5rem;
  padding: 1rem 0;
}
.album-nav button {
  background: var(--glass-bg); border: 1px solid var(--glass-border);
  color: var(--text); padding: 0.5rem 1.25rem; border-radius: 50px;
  cursor: pointer; font-family: var(--font-body); font-weight: 600;
  transition: var(--transition);
}
.album-nav button:hover:not(:disabled) { background: rgba(108,99,255,0.25); }
.album-nav button:disabled { opacity: 0.4; cursor: default; }
.album-page-indicator { font-weight: 700; font-size: 1rem; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .hamburger { display: flex; }

  .main-nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    background: rgba(15,12,41,0.97);
    backdrop-filter: var(--blur);
    flex-direction: column;
    padding: 5rem 2rem 2rem;
    transform: translateY(-110%);
    transition: transform 0.35s cubic-bezier(0.25,0.46,0.45,0.94);
    z-index: 1050;
    border-bottom: 1px solid var(--glass-border);
  }

  .main-nav.open { transform: translateY(0); }

  .main-nav a { font-size: 1rem; padding: 0.75rem 1rem; border-radius: 10px; }

  .main-content { padding: 1.5rem 1rem; }

  .notif-panel { width: 95vw; right: -1rem; }

  .album-container { border-radius: 12px; }

  .album-slot-empty-icon { font-size: 1rem; }
}

@media (max-width: 480px) {
  .logo-text { font-size: 1rem; }
  .header-inner { padding: 0.6rem 1rem; }
  .main-content { padding: 1rem 0.75rem; }
}

/* ── Login page ── */
.login-page {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
  background: radial-gradient(ellipse at top, var(--bg-start, #0f0c29), var(--bg-end, #302b63));
}

.login-card {
  width: 100%;
  max-width: 480px;
  padding: 2.5rem;
}

.login-logo {
  text-align: center;
  margin-bottom: 2rem;
}

.login-logo h1 {
  font-family: var(--font-main);
  font-size: 1.75rem;
  font-weight: 800;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Stats cards ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  padding: 1.25rem;
  text-align: center;
}

.stat-value {
  font-size: 2rem;
  font-weight: 800;
  font-family: var(--font-main);
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label { font-size: 0.8rem; color: var(--text-muted); font-weight: 600; margin-top: 0.25rem; }

/* ── Trivia modal ── */
.trivia-options { display: grid; gap: 0.6rem; margin-top: 1rem; }
.trivia-option {
  padding: 0.85rem 1.25rem;
  background: rgba(255,255,255,0.07);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  font-family: var(--font-body);
  font-size: 0.9rem;
  transition: var(--transition);
}
.trivia-option:hover { background: rgba(108,99,255,0.2); border-color: var(--primary); }
.trivia-option.correct { background: rgba(56,161,105,0.25); border-color: #38a169; color: #9ae6b4; }
.trivia-option.incorrect { background: rgba(229,62,62,0.25); border-color: #e53e3e; color: #feb2b2; animation: shake 0.5s ease; }

/* ── Collection grid ── */
.collection-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 1rem;
}

/* ── Ranking ── */
.ranking-item {
  display: flex; align-items: center; gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.ranking-pos { font-size: 1.25rem; font-weight: 800; width: 2rem; text-align: center; }
.ranking-pos.gold   { color: #f6d860; }
.ranking-pos.silver { color: #c0c0c0; }
.ranking-pos.bronze { color: #cd7f32; }
.ranking-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: var(--primary); display:flex; align-items:center; justify-content:center; font-weight:700; }
.ranking-name { flex: 1; font-weight: 600; }
.ranking-pts { font-weight: 800; color: var(--primary); }

/* ── Helpers ── */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.hidden { display: none !important; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.w-full { width: 100%; }
.section-title { font-family: var(--font-main); font-size: 1.4rem; font-weight: 800; margin-bottom: 1.25rem; }
