/* ================================================
   BienStar2 - Global Styles
   Archivo: css/global.css
   ================================================ */

/* ── Variables ── */
:root {
  --primary:       #4f8ef7;
  --primary-dark:  #2563eb;
  --secondary:     #a855f7;
  --accent:        #06b6d4;
  --success:       #10b981;
  --warning:       #f59e0b;
  --danger:        #ef4444;

  --bg:            #0a0e1a;
  --bg2:           #0f1628;
  --bg3:           #131c35;

  --glass:         rgba(255, 255, 255, 0.05);
  --glass-hover:   rgba(255, 255, 255, 0.09);
  --glass-border:  rgba(255, 255, 255, 0.12);
  --glass-shadow:  rgba(0, 0, 0, 0.4);

  --text:          #e2e8f0;
  --text-muted:    #94a3b8;
  --text-light:    #cbd5e1;

  --font-main:     'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-title:    'Segoe UI', system-ui, sans-serif;

  --radius-sm:     8px;
  --radius-md:     14px;
  --radius-lg:     20px;
  --radius-xl:     30px;

  --blur-sm:       blur(8px);
  --blur-md:       blur(16px);
  --blur-lg:       blur(24px);

  --transition:    all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);

  --shadow-sm:     0 2px 12px rgba(0,0,0,0.3);
  --shadow-md:     0 8px 32px rgba(0,0,0,0.4);
  --shadow-lg:     0 20px 60px rgba(0,0,0,0.5);
  --shadow-glow:   0 0 30px rgba(79, 142, 247, 0.3);
  --shadow-glow2:  0 0 30px rgba(168, 85, 247, 0.3);
}

/* ── Reset ── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── Fondo animado global ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at 15% 15%, rgba(79, 142, 247, 0.12) 0%, transparent 55%),
    radial-gradient(ellipse at 85% 85%, rgba(168, 85, 247, 0.12) 0%, transparent 55%),
    radial-gradient(ellipse at 50% 50%, rgba(6, 182, 212, 0.06) 0%, transparent 65%);
  z-index: 0;
  pointer-events: none;
  animation: bgPulse 8s ease-in-out infinite alternate;
}

@keyframes bgPulse {
  0%   { opacity: 0.8; }
  100% { opacity: 1; }
}

/* ── Scrollbar personalizada ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--primary), var(--secondary));
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* ── Selección de texto ── */
::selection {
  background: rgba(79, 142, 247, 0.3);
  color: #fff;
}

/* ── Tipografía ── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-title);
  font-weight: 700;
  line-height: 1.2;
  color: var(--text);
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.5rem); }
h3 { font-size: clamp(1.2rem, 2vw, 1.8rem); }
h4 { font-size: clamp(1rem, 1.5vw, 1.4rem); }

p { color: var(--text-muted); line-height: 1.75; }

a {
  color: var(--primary);
  text-decoration: none;
  transition: var(--transition);
}
a:hover { color: var(--accent); }

img { max-width: 100%; display: block; }

ul { list-style: none; }

/* ── Contenedor principal ── */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

.container-wide {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

/* ── Glass Card ── */
.glass-card {
  background: var(--glass);
  backdrop-filter: var(--blur-md);
  -webkit-backdrop-filter: var(--blur-md);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.glass-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
}

.glass-card:hover {
  background: var(--glass-hover);
  border-color: rgba(79, 142, 247, 0.3);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  transform: translateY(-4px);
}

/* ── Botones ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  text-decoration: none;
  white-space: nowrap;
}

.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0);
  transition: var(--transition);
}

.btn:hover::before { background: rgba(255,255,255,0.08); }

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  box-shadow: 0 4px 20px rgba(79, 142, 247, 0.4);
}

.btn-primary:hover {
  box-shadow: 0 6px 30px rgba(79, 142, 247, 0.6);
  transform: translateY(-2px);
  color: #fff;
}

.btn-secondary {
  background: linear-gradient(135deg, var(--secondary), #7c3aed);
  color: #fff;
  box-shadow: 0 4px 20px rgba(168, 85, 247, 0.4);
}

.btn-secondary:hover {
  box-shadow: 0 6px 30px rgba(168, 85, 247, 0.6);
  transform: translateY(-2px);
  color: #fff;
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
}

.btn-outline:hover {
  background: rgba(79, 142, 247, 0.1);
  transform: translateY(-2px);
  color: var(--primary);
}

.btn-glass {
  background: var(--glass);
  backdrop-filter: var(--blur-sm);
  color: var(--text);
  border: 1px solid var(--glass-border);
}

.btn-glass:hover {
  background: var(--glass-hover);
  border-color: var(--primary);
  color: var(--primary);
}

/* ── Badges ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-primary { background: rgba(79,142,247,0.2); color: var(--primary); border: 1px solid rgba(79,142,247,0.3); }
.badge-secondary { background: rgba(168,85,247,0.2); color: var(--secondary); border: 1px solid rgba(168,85,247,0.3); }
.badge-accent { background: rgba(6,182,212,0.2); color: var(--accent); border: 1px solid rgba(6,182,212,0.3); }
.badge-success { background: rgba(16,185,129,0.2); color: var(--success); border: 1px solid rgba(16,185,129,0.3); }
.badge-warning { background: rgba(245,158,11,0.2); color: var(--warning); border: 1px solid rgba(245,158,11,0.3); }
.badge-danger  { background: rgba(239,68,68,0.2); color: var(--danger); border: 1px solid rgba(239,68,68,0.3); }

/* ── Section Header ── */
.section-header {
  text-align: center;
  margin-bottom: 60px;
}

.section-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--primary);
  margin-bottom: 14px;
}

.section-label::before,
.section-label::after {
  content: '';
  width: 30px;
  height: 1px;
  background: var(--primary);
  opacity: 0.5;
}

.section-title {
  font-size: clamp(1.8rem, 3vw, 2.8rem);
  font-weight: 800;
  background: linear-gradient(135deg, var(--text) 0%, var(--text-muted) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 16px;
}

.section-title span {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.section-subtitle {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 580px;
  margin: 0 auto;
}

/* ── Divider ── */
.divider {
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 999px;
  margin: 16px auto 0;
}

/* ── Section spacing ── */
.section { padding: 100px 0; position: relative; z-index: 1; }
.section-sm { padding: 60px 0; position: relative; z-index: 1; }

/* ── Grid layouts ── */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; }

/* ── Flex helpers ── */
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-col { display: flex; flex-direction: column; }
.gap-sm { gap: 8px; }
.gap-md { gap: 16px; }
.gap-lg { gap: 24px; }

/* ── Glow text ── */
.glow-text {
  text-shadow: 0 0 20px rgba(79, 142, 247, 0.6), 0 0 40px rgba(79, 142, 247, 0.3);
}

.glow-text-purple {
  text-shadow: 0 0 20px rgba(168, 85, 247, 0.6), 0 0 40px rgba(168, 85, 247, 0.3);
}

/* ── Separator line ── */
.line-sep {
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--glass-border), transparent);
  margin: 40px 0;
}

/* ── Tags ── */
.tag {
  display: inline-block;
  padding: 3px 10px;
  background: rgba(79, 142, 247, 0.1);
  border: 1px solid rgba(79, 142, 247, 0.2);
  border-radius: 999px;
  font-size: 0.75rem;
  color: var(--primary);
  font-weight: 500;
}

/* ── Image placeholder ── */
.img-placeholder {
  width: 100%;
  aspect-ratio: 16/9;
  background: var(--glass);
  border: 1px dashed var(--glass-border);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.img-placeholder svg { width: 40px; height: 40px; opacity: 0.4; }

/* ── Image gallery thumbnail ── */
.gallery-thumb {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  border-radius: var(--radius-md);
  border: 1px solid var(--glass-border);
  transition: var(--transition);
  cursor: pointer;
}

.gallery-thumb:hover {
  transform: scale(1.02);
  border-color: var(--primary);
  box-shadow: var(--shadow-glow);
}

/* ── Lightbox ── */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.9);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(4px);
}

.lightbox.active { display: flex; }

.lightbox img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: var(--radius-md);
  border: 1px solid var(--glass-border);
}

.lightbox-close {
  position: absolute;
  top: 20px; right: 24px;
  font-size: 2rem;
  color: var(--text);
  cursor: pointer;
  line-height: 1;
  transition: var(--transition);
}

.lightbox-close:hover { color: var(--danger); transform: rotate(90deg); }

/* ── Hero section base ── */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
  overflow: hidden;
}

.hero-inner-page {
  min-height: 55vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
  overflow: hidden;
  padding-top: 90px;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  z-index: 0;
}

.hero-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(10,14,26,0.6) 0%,
    rgba(10,14,26,0.7) 50%,
    rgba(10,14,26,1) 100%
  );
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 40px 20px;
}

/* ── Page title banner ── */
.page-banner {
  text-align: center;
  position: relative;
  z-index: 2;
  padding: 40px 20px;
}

.page-banner .banner-label {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--accent);
  margin-bottom: 12px;
  display: block;
}

.page-banner h1 {
  font-size: clamp(2.2rem, 5vw, 4rem);
  font-weight: 900;
  background: linear-gradient(135deg, #fff 0%, var(--primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 16px;
}

.page-banner p {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto;
}

/* ── Rank card ── */
.rank-card {
  padding: 28px 24px;
  text-align: center;
}

.rank-icon {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
}

.rank-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}

.rank-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ── Stat box ── */
.stat-box {
  padding: 28px 20px;
  text-align: center;
}

.stat-number {
  font-size: 2.5rem;
  font-weight: 900;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: block;
  line-height: 1;
  margin-bottom: 8px;
}

.stat-label {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ── Breadcrumb ── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb .sep { opacity: 0.4; }
.breadcrumb .current { color: var(--primary); }

/* ── Alert / Info box ── */
.alert {
  padding: 16px 20px;
  border-radius: var(--radius-md);
  border-left: 4px solid;
  margin-bottom: 20px;
  font-size: 0.9rem;
}

.alert-info { background: rgba(79,142,247,0.1); border-color: var(--primary); color: var(--text-light); }
.alert-success { background: rgba(16,185,129,0.1); border-color: var(--success); color: var(--text-light); }
.alert-warning { background: rgba(245,158,11,0.1); border-color: var(--warning); color: var(--text-light); }
.alert-danger { background: rgba(239,68,68,0.1); border-color: var(--danger); color: var(--text-light); }

/* ── Form elements ── */
.form-group { margin-bottom: 20px; }

.form-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-light);
  margin-bottom: 8px;
}

.form-control {
  width: 100%;
  padding: 12px 16px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  color: var(--text);
  font-size: 0.95rem;
  font-family: var(--font-main);
  transition: var(--transition);
  backdrop-filter: var(--blur-sm);
  outline: none;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 142, 247, 0.15);
  background: rgba(255,255,255,0.07);
}

.form-control::placeholder { color: rgba(148, 163, 184, 0.5); }

textarea.form-control {
  resize: vertical;
  min-height: 120px;
}

/* ── Responsive ── */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .section { padding: 70px 0; }
  .container { padding: 0 16px; }
}

@media (max-width: 480px) {
  .section { padding: 50px 0; }
  .btn { padding: 10px 20px; font-size: 0.88rem; }
}

