/* ===== App de Sorteos — tema oscuro tipo evento ===== */

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

:root {
  --bg: #0f1220;
  --bg-card: #1a1f36;
  --bg-hover: #232a4a;
  --accent: #ffd24a;
  --accent-2: #2e56b8; /* azul institucional CONECTA 360 */
  --danger: #ff5c7a;
  --success: #4ade80;
  --text: #f2f4ff;
  --text-dim: #9aa3c7;
  --radius: 14px;
}

body {
  font-family: "Segoe UI", system-ui, sans-serif;
  background: radial-gradient(1200px 600px at 50% -100px, #2a2f55 0%, var(--bg) 60%);
  color: var(--text);
  min-height: 100vh;
}

.hidden { display: none !important; }

/* ----- Header ----- */
.app-header {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0.8rem 2rem;
  background: #ffffff;
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid rgba(15, 18, 32, 0.1);
  box-shadow: 0 2px 14px rgba(0, 0, 0, 0.25);
}
.app-header h1 { font-size: 1.4rem; flex: 1; white-space: nowrap; }

/* Logo CONECTA 360 (el header ahora es blanco, no hace falta bloque extra) */
.brand { flex: 1; display: flex; align-items: center; }
.brand img {
  height: 54px;
  width: auto;
  display: block;
}
.tabs { display: flex; gap: 0.5rem; }
.tab {
  background: transparent;
  color: #3d4a75;
  border: 1px solid transparent;
  padding: 0.6rem 1.2rem;
  border-radius: 999px;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s;
}
.tab:hover { color: #1a1f36; background: rgba(46, 86, 184, 0.08); }
.tab.active {
  background: var(--accent-2);
  color: #fff;
  font-weight: 600;
}
.btn-icon {
  background: #eef1f9;
  border: 1px solid rgba(15, 18, 32, 0.12);
  font-size: 1.25rem;
  padding: 0.45rem 0.7rem;
  border-radius: 10px;
  cursor: pointer;
}

/* ----- Layout genérico ----- */
.view { padding: 1.5rem 2rem; max-width: 1400px; margin: 0 auto; }
.card {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
.card h2 { font-size: 1.15rem; margin-bottom: 0.9rem; }
.card h3 { font-size: 1rem; margin-bottom: 0.7rem; color: var(--text-dim); }

.badge {
  background: var(--accent-2);
  color: #fff;
  font-size: 0.75rem;
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
  vertical-align: middle;
}

/* ----- Botones y formularios ----- */
.btn {
  border: none;
  border-radius: 10px;
  padding: 0.6rem 1rem;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.1s, filter 0.2s;
  color: #fff;
}
.btn:hover { filter: brightness(1.15); }
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--accent-2); }
.btn-danger { background: var(--danger); }
.btn-secondary { background: var(--bg-hover); border: 1px solid rgba(255,255,255,0.15); }

input[type="text"], input[type="email"], select {
  background: var(--bg);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  padding: 0.6rem 0.8rem;
  font-size: 0.95rem;
  outline: none;
}
input:focus, select:focus { border-color: var(--accent-2); }

.inline-form { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-bottom: 0.8rem; }
.inline-form input { flex: 1; min-width: 180px; }

.raffle-selector { display: flex; gap: 0.6rem; margin-bottom: 0.8rem; }
.raffle-selector select { flex: 1; }

.io-row { display: flex; gap: 0.6rem; margin-bottom: 0.6rem; }
.io-row .btn { display: inline-block; }

.import-report { font-size: 0.85rem; color: var(--accent); min-height: 1.2em; margin-bottom: 0.5rem; }

.manage-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }

/* ----- Listas ----- */
.item-list { list-style: none; max-height: 420px; overflow-y: auto; }
.item-list li {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.4rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.item-list li .meta { flex: 1; }
.item-list li .email { color: var(--text-dim); font-size: 0.85rem; }
.btn-small {
  background: var(--bg-hover);
  border: 1px solid rgba(255,255,255,0.12);
  color: var(--text);
  border-radius: 8px;
  padding: 0.25rem 0.55rem;
  cursor: pointer;
  font-size: 0.8rem;
}
.btn-small:hover { filter: brightness(1.25); }
.btn-small.danger { color: var(--danger); }
.btn-small.warn { color: var(--accent); }

.empty-msg { text-align: center; color: var(--text-dim); padding: 3rem 1rem; font-size: 1.1rem; }

/* ----- Vista en vivo ----- */
.live-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.25rem;
  align-items: start;
}

.prize-focus { text-align: center; padding: 2rem; }
.label-premio { color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.15em; font-size: 0.8rem; }
.current-prize-title { font-size: 1.8rem; color: var(--accent); margin: 0.4rem 0 1.2rem; }

.winner-display {
  min-height: 130px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 0.3rem;
}
.winner-name {
  font-size: 2.6rem;
  font-weight: 800;
  text-shadow: 0 0 24px rgba(255, 210, 74, 0.35);
  animation: pop-in 0.5s ease;
}
.winner-email { color: var(--text-dim); font-size: 1.1rem; }

@keyframes pop-in {
  from { transform: scale(0.6); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.btn-draw {
  background: linear-gradient(135deg, var(--accent), #ff9d2e);
  color: #2a1d00;
  font-size: 1.3rem;
  padding: 0.9rem 2.4rem;
  border-radius: 999px;
  margin-top: 1.2rem;
  box-shadow: 0 6px 20px rgba(255, 180, 40, 0.35);
}
.btn-draw:disabled { opacity: 0.5; cursor: not-allowed; box-shadow: none; }

.live-message { margin-top: 0.8rem; min-height: 1.4em; color: var(--danger); font-weight: 600; }

.upcoming-list { list-style: none; }
.upcoming-list li {
  padding: 0.6rem 0.8rem;
  border-radius: 10px;
  margin-bottom: 0.4rem;
  background: var(--bg-hover);
  display: flex;
  gap: 0.7rem;
  align-items: center;
}
.upcoming-list li.current {
  border: 1px solid var(--accent);
  box-shadow: 0 0 12px rgba(255, 210, 74, 0.25);
}
.upcoming-list .prize-num {
  background: var(--accent-2);
  border-radius: 8px;
  padding: 0.2rem 0.5rem;
  font-weight: 700;
  font-size: 0.85rem;
}

/* ----- Panel de ganadores ----- */
.winners-panel { position: sticky; top: 90px; max-height: calc(100vh - 120px); display: flex; flex-direction: column; }
.winners-list { list-style: none; overflow-y: auto; }
.winners-list li {
  background: var(--bg-hover);
  border-left: 4px solid var(--success);
  border-radius: 10px;
  padding: 0.7rem 0.9rem;
  margin-bottom: 0.6rem;
  display: flex;
  gap: 0.6rem;
  align-items: center;
}
.winners-list .meta { flex: 1; }
.winners-list .w-prize { font-size: 0.8rem; color: var(--accent); font-weight: 700; }
.winners-list .w-name { font-weight: 700; }
.winners-list .w-email { font-size: 0.8rem; color: var(--text-dim); }

/* ----- Overlay de animación ----- */
.draw-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 10, 22, 0.92);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 100;
  backdrop-filter: blur(4px);
}
.overlay-prize {
  color: var(--accent);
  font-size: 1.4rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  margin-bottom: 1rem;
}
.overlay-name {
  font-size: clamp(2rem, 7vw, 4.5rem);
  font-weight: 900;
  text-shadow: 0 0 30px rgba(124, 92, 255, 0.6);
  animation: flicker 0.1s linear infinite;
}
@keyframes flicker {
  0% { opacity: 1; } 50% { opacity: 0.85; } 100% { opacity: 1; }
}

/* ----- Responsive ----- */
@media (max-width: 900px) {
  .manage-grid, .live-grid { grid-template-columns: 1fr; }
  .winners-panel { position: static; max-height: none; }
  .app-header { flex-wrap: wrap; gap: 0.8rem; padding: 0.8rem 1rem; }
  .brand img { height: 42px; }
  .view { padding: 1rem; }
  .winner-name { font-size: 1.9rem; }
}
