/* =============================================
   SORTEO SAAS - Estilos Personalizados
   ============================================= */

@import url('/assets/fonts/inter.css');

*, *::before, *::after { box-sizing: border-box; }
html, body { overflow-x: hidden; }
img { max-width: 100%; height: auto; }

body {
  font-family: 'Inter', sans-serif;
  background-color: #F5F3FF;
  color: #1F2937;
}

/* Animaciones hero */
@keyframes heroFloat {
  0%, 100% { transform: translateY(0px) rotate(-0.3deg); }
  50%       { transform: translateY(-10px) rotate(0.3deg); }
}
@keyframes heroGlow {
  0%, 100% { text-shadow: 0 0 10px #fde047, 0 0 30px #fde047, 0 0 60px #ca8a04; }
  50%       { text-shadow: 0 0 20px #fef08a, 0 0 60px #fde047, 0 0 100px #eab308; }
}
@keyframes heroBounceIn {
  0%   { opacity: 0; transform: scale(0.7) translateY(30px); }
  60%  { transform: scale(1.05) translateY(-5px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}
.hero-title {
  animation: heroFloat 4s ease-in-out infinite, heroBounceIn 0.8s ease-out both;
}
.hero-title-glow {
  animation: heroGlow 2s ease-in-out infinite;
  display: inline-block;
}

/* Gradientes de la marca */
.gradient-primary { background: linear-gradient(135deg, #6D28D9 0%, #4F46E5 100%); }
.gradient-yape    { background: linear-gradient(135deg, #7C3AED 0%, #EC4899 100%); }
.gradient-hero    { background: linear-gradient(135deg, #14532d 0%, #16a34a 50%, #15803d 100%); }
.gradient-card    { background: linear-gradient(135deg, #EDE9FE 0%, #E0E7FF 100%); }

/* Texto con gradiente */
.text-gradient {
  background: linear-gradient(135deg, #6D28D9, #EC4899);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Navbar */
.navbar {
  backdrop-filter: blur(12px);
  background: rgba(255,255,255,0.9);
  border-bottom: 1px solid rgba(109,40,217,0.1);
}

/* Tarjetas */
.card {
  background: white;
  border-radius: 1rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 4px 20px rgba(109,40,217,0.06);
  transition: transform 0.2s, box-shadow 0.2s;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 4px 16px rgba(109,40,217,0.15); }

/* Botones */
.btn-primary {
  background: linear-gradient(135deg, #6D28D9 0%, #4F46E5 100%);
  color: white;
  padding: 0.6rem 1.4rem;
  border-radius: 0.6rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.btn-primary:hover { opacity: 0.9; transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-secondary {
  background: white;
  color: #6D28D9;
  border: 2px solid #6D28D9;
  padding: 0.55rem 1.3rem;
  border-radius: 0.6rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-secondary:hover { background: #EDE9FE; }

.btn-danger {
  background: #EF4444;
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: opacity 0.2s;
}
.btn-danger:hover { opacity: 0.85; }

.btn-success {
  background: #10B981;
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: opacity 0.2s;
}
.btn-success:hover { opacity: 0.85; }

/* Formularios */
.form-input {
  width: 100%;
  padding: 0.65rem 0.9rem;
  border: 1.5px solid #E5E7EB;
  border-radius: 0.6rem;
  font-size: 0.95rem;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: white;
}
.form-input:focus {
  outline: none;
  border-color: #7C3AED;
  box-shadow: 0 0 0 3px rgba(124,58,237,0.12);
}
.form-label {
  display: block;
  font-weight: 600;
  font-size: 0.85rem;
  color: #374151;
  margin-bottom: 0.35rem;
}
.form-group { margin-bottom: 1.1rem; }

/* Badges de estado */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.7rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.badge-pending  { background: #FEF3C7; color: #92400E; }
.badge-verified { background: #D1FAE5; color: #065F46; }
.badge-rejected { background: #FEE2E2; color: #991B1B; }
.badge-active   { background: #EDE9FE; color: #5B21B6; }
.badge-closed   { background: #F3F4F6; color: #4B5563; }

/* Sidebar Admin */
.sidebar {
  width: 260px;
  background: linear-gradient(180deg, #2D0764 0%, #4C1D95 100%);
  min-height: 100vh;
  transition: transform 0.3s;
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.2rem;
  color: rgba(255,255,255,0.75);
  border-radius: 0.5rem;
  font-weight: 500;
  transition: background 0.2s, color 0.2s;
  cursor: pointer;
  text-decoration: none;
  margin: 0.15rem 0;
}
.sidebar-link:hover  { background: rgba(255,255,255,0.12); color: white; }
.sidebar-link.active { background: rgba(255,255,255,0.2); color: white; }

/* Tabla Admin */
.table-responsive-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.admin-table { width: 100%; border-collapse: collapse; min-width: 560px; }
.admin-table th {
  background: #F5F3FF;
  padding: 0.7rem 1rem;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 700;
  color: #6D28D9;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 2px solid #E5E7EB;
}
.admin-table td {
  padding: 0.8rem 1rem;
  border-bottom: 1px solid #F3F4F6;
  font-size: 0.875rem;
  vertical-align: middle;
}
.admin-table tr:hover td { background: #FAFAFA; }

/* Stat cards */
.stat-card {
  background: white;
  border-radius: 1rem;
  padding: 1.4rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  border-left: 4px solid;
}

/* Steps de registro */
.step-item {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.step-circle {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  flex-shrink: 0;
}
.step-circle.active   { background: linear-gradient(135deg, #6D28D9, #4F46E5); color: white; }
.step-circle.done     { background: #10B981; color: white; }
.step-circle.inactive { background: #E5E7EB; color: #9CA3AF; }

/* Upload zone */
.upload-zone {
  border: 2px dashed #C4B5FD;
  border-radius: 0.75rem;
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  background: #FAFAFA;
}
.upload-zone:hover, .upload-zone.dragover {
  border-color: #7C3AED;
  background: #F5F3FF;
}

/* Toast notifications */
.toast-container {
  position: fixed;
  top: 1.2rem;
  right: 1.2rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.toast {
  padding: 0.85rem 1.2rem;
  border-radius: 0.7rem;
  color: white;
  font-weight: 600;
  font-size: 0.9rem;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  animation: slideIn 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  max-width: 360px;
}
.toast-success { background: linear-gradient(135deg, #059669, #10B981); }
.toast-error   { background: linear-gradient(135deg, #DC2626, #EF4444); }
.toast-info    { background: linear-gradient(135deg, #2563EB, #3B82F6); }
.toast-warning { background: linear-gradient(135deg, #D97706, #F59E0B); }

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

/* Modal */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal-box {
  background: white;
  border-radius: 1rem;
  padding: 2rem;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  animation: modalIn 0.3s ease;
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.9); }
  to   { opacity: 1; transform: scale(1); }
}

/* Loader */
.spinner {
  width: 1.5rem; height: 1.5rem;
  border: 3px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Mobile / Responsive ───────────────────────────────────────────────── */
@media (max-width: 767.98px) {

  /* Sidebar: off-canvas drawer */
  .sidebar {
    position: fixed;
    top: 0; left: 0;
    height: 100%;
    z-index: 1050;
    transform: translateX(-260px);
    transition: transform 0.28s cubic-bezier(0.4,0,0.2,1);
  }
  .sidebar.open { transform: translateX(0); }

  /* Dimmer overlay */
  .sidebar-overlay {
    display: block;
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 1040;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.28s;
  }
  .sidebar-overlay.show {
    opacity: 1;
    pointer-events: all;
  }

  /* Main column takes full width */
  .flex-grow-1.d-flex.flex-column.min-w-0 {
    width: 100% !important;
    min-width: 0 !important;
  }

  /* Admin tables: horizontal scroll */
  .table-responsive-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

  /* Modal full-width on small screens */
  .modal-box {
    padding: 1.25rem;
    max-width: calc(100vw - 2rem);
    max-height: 92vh;
  }

  /* Toast full-width on mobile */
  .toast-container { left: 1rem; right: 1rem; }
  .toast { max-width: 100%; }

  /* Prevent body from scrolling when sidebar is open */
  body.sidebar-open { overflow: hidden; }

  /* Pagination wrap on small screens */
  .pagination { flex-wrap: wrap; }

  /* Stat cards: ensure they don't overflow */
  .stat-card { min-width: 0; }
}

/* Paginación */
.pagination { display: flex; gap: 0.3rem; align-items: center; }
.page-btn {
  padding: 0.4rem 0.75rem;
  border-radius: 0.4rem;
  border: 1.5px solid #E5E7EB;
  background: white;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s;
}
.page-btn:hover    { border-color: #7C3AED; color: #6D28D9; }
.page-btn.active   { background: #6D28D9; border-color: #6D28D9; color: white; }
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* YAPE Banner */
.yape-banner {
  background: linear-gradient(135deg, #7C3AED 0%, #EC4899 100%);
  border-radius: 1rem;
  padding: 1.5rem;
  color: white;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: #9CA3AF;
}
.empty-state svg { margin: 0 auto 1rem; opacity: 0.5; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #F3F4F6; }
::-webkit-scrollbar-thumb { background: #C4B5FD; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #7C3AED; }

/* =============================================
   BOOTSTRAP 5 COMPATIBILITY UTILITIES
   ============================================= */

/* Preserve .hidden class used throughout JS */
.hidden { display: none !important; }

/* Font weight */
.fw-extrabold { font-weight: 800 !important; }
.fw-medium    { font-weight: 500 !important; }

/* Font sizes not in Bootstrap */
.fs-7  { font-size: 0.75rem !important; }

/* Letter spacing */
.tracking-wide    { letter-spacing: 0.025em !important; }
.tracking-wider   { letter-spacing: 0.05em  !important; }
.tracking-widest  { letter-spacing: 0.1em   !important; }

/* Color utilities (purple / green / yellow / emerald) */
.text-purple-700  { color: #6D28D9 !important; }
.text-purple-600  { color: #7C3AED !important; }
.text-purple-300  { color: #C4B5FD !important; }
.text-green-200   { color: #A7F3D0 !important; }
.text-green-100   { color: #D1FAE5 !important; }
.text-green-300   { color: #6EE7B7 !important; }
.text-green-700   { color: #15803D !important; }
.text-yellow-300  { color: #FDE047 !important; }
.text-yellow-700  { color: #A16207 !important; }
.text-yellow-800  { color: #92400E !important; }
.text-yellow-600  { color: #CA8A04 !important; }
.text-red-700     { color: #B91C1C !important; }
.text-red-500     { color: #EF4444 !important; }
.text-blue-700    { color: #1D4ED8 !important; }
.text-blue-600    { color: #2563EB !important; }
.text-green-600   { color: #16A34A !important; }
.text-emerald-600 { color: #059669 !important; }
.text-emerald-700 { color: #047857 !important; }
.text-emerald-800 { color: #065F46 !important; }
.text-emerald-900 { color: #064E3B !important; }

/* Background utilities */
.bg-purple-50  { background-color: #F5F3FF !important; }
.bg-blue-50    { background-color: #EFF6FF !important; }
.bg-yellow-50  { background-color: #FEFCE8 !important; }
.bg-green-50   { background-color: #F0FDF4 !important; }

/* Border color utilities */
.border-yellow-200 { border-color: #FEF08A !important; }
.border-blue-200   { border-color: #BFDBFE !important; }
.border-red-200    { border-color: #FECACA !important; }
.border-purple-500 { border-color: #8B5CF6 !important; }
.border-green-500  { border-color: #22C55E !important; }
.border-blue-500   { border-color: #3B82F6 !important; }
.border-yellow-400 { border-color: #FACC15 !important; }
.border-emerald-500{ border-color: #10B981 !important; }
.border-red-500    { border-color: #EF4444 !important; }

/* Overflow */
.overflow-y-auto { overflow-y: auto !important; -webkit-overflow-scrolling: touch; }
.overflow-x-auto { overflow-x: auto !important; -webkit-overflow-scrolling: touch; }

/* Positioning */
.inset-0 { top: 0 !important; right: 0 !important; bottom: 0 !important; left: 0 !important; }
.min-w-0 { min-width: 0 !important; }

/* Sizing helpers */
.icon-sm { width: 1.25rem; height: 1.25rem; flex-shrink: 0; }
.icon-xs { width: 1rem;    height: 1rem;    flex-shrink: 0; }
.w-9  { width:  2.25rem !important; }
.h-9  { height: 2.25rem !important; }
.w-16 { width:  4rem !important; }
.h-16 { height: 4rem !important; }
.w-28 { width:  7rem !important; }
.h-28 { height: 7rem !important; }

/* Filters */
.grayscale   { filter: grayscale(100%); }
.drop-shadow { filter: drop-shadow(0 1px 2px rgba(0,0,0,0.5)); }

/* Text helpers */
.line-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.lh-relaxed   { line-height: 1.75 !important; }

/* Backdrop */
.backdrop-blur { backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }

/* Object fit */
.object-contain { object-fit: contain; }
.object-cover   { object-fit: cover; }

/* Pulse animation (Tailwind equivalent) */
@keyframes bsPulse { 0%, 100% { opacity: 1; } 50% { opacity: .4; } }
.animate-pulse { animation: bsPulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite; }

/* Scale on hover */
.hover-scale:hover { transform: scale(1.05); }

/* Section vertical padding helpers */
.py-section    { padding-top: 4rem; padding-bottom: 4rem; }
.py-section-lg { padding-top: 5rem; padding-bottom: 5rem; }
