/* =====================================================
   TIME EFFECTS — Consejo Regional IX Ica
   Efectos de Mañana / Tarde / Noche
   ===================================================== */

/* ── PARTICLES BACKGROUND CANVAS ── */
#particles-bg-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0;
  transition: opacity 2s ease;
}
#particles-bg-canvas.visible { opacity: 1; }

/* ── ENTRY OVERLAY ── */
#time-entry-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  opacity: 1;
  transition: opacity 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}
#time-entry-overlay.fade-out {
  opacity: 0;
  pointer-events: none;
}

/* Entry canvas */
#entry-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* ── ENTRY CONTENT ── */
.entry-inner {
  position: relative;
  z-index: 2;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  animation: entryContentIn 1s cubic-bezier(0.34, 1.56, 0.64, 1) 0.6s both;
}

@keyframes entryContentIn {
  from { opacity: 0; transform: translateY(30px) scale(0.9); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Logo ring */
.entry-logo-ring {
  position: relative;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 22px;
}
.entry-logo-ring::before {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  animation: logoRingRotate 3s linear infinite;
}
.entry-logo-ring::after {
  content: '';
  position: absolute;
  inset: -14px;
  border-radius: 50%;
  opacity: 0.5;
  animation: logoRingRotate 5s linear infinite reverse;
}

@keyframes logoRingRotate {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.entry-logo-ring img {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: contain;
  background: white;
  padding: 8px;
  position: relative;
  z-index: 1;
  animation: logoPulse 2s ease-in-out infinite;
}

@keyframes logoPulse {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.04); }
}

/* Text elements */
.entry-greeting {
  font-family: 'Playfair Display', serif;
  font-size: clamp(36px, 6vw, 72px);
  font-weight: 800;
  letter-spacing: 2px;
  line-height: 1;
  margin-bottom: 10px;
  animation: entryTextIn 1s ease 1s both;
}
@keyframes entryTextIn {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.entry-institution {
  font-family: 'Playfair Display', serif;
  font-size: clamp(14px, 2.5vw, 22px);
  font-weight: 600;
  letter-spacing: 3px;
  margin-bottom: 4px;
  animation: entryTextIn 1s ease 1.2s both;
}

.entry-tagline {
  font-size: clamp(11px, 1.8vw, 14px);
  font-weight: 400;
  letter-spacing: 4px;
  text-transform: uppercase;
  opacity: 0.7;
  margin-bottom: 24px;
  animation: entryTextIn 1s ease 1.4s both;
}

.entry-divider {
  width: 80px;
  height: 2px;
  border-radius: 2px;
  margin: 0 auto 20px;
  animation: entryDividerIn 1s ease 1.6s both;
}
@keyframes entryDividerIn {
  from { opacity: 0; width: 0; }
  to   { opacity: 1; width: 80px; }
}

.entry-time-icon {
  font-size: 28px;
  margin-bottom: 10px;
  animation: entryIconIn 1s ease 1.8s both;
}
@keyframes entryIconIn {
  from { opacity: 0; transform: scale(0.5); }
  to   { opacity: 1; transform: scale(1); }
}

.entry-time-label {
  font-size: clamp(12px, 1.5vw, 15px);
  font-weight: 300;
  letter-spacing: 2px;
  opacity: 0.8;
  animation: entryTextIn 1s ease 2s both;
}

/* ──────────────────────────────────────────────────
   MORNING PERIOD
   ────────────────────────────────────────────────── */
#time-entry-overlay.period-morning {
  background: linear-gradient(180deg,
    #fff4e0 0%,
    #ffd89b 20%,
    #ffb347 45%,
    #e8722a 70%,
    #a03420 100%
  );
}

body.time-morning .entry-logo-ring::before {
  background: conic-gradient(from 0deg, #ffd700, #ff8c00, #ffd700);
}
body.time-morning .entry-logo-ring::after {
  background: conic-gradient(from 0deg, transparent 50%, rgba(255,200,0,0.4) 100%);
  border: 2px dashed rgba(255,200,0,0.5);
}
body.time-morning .entry-logo-ring img {
  box-shadow: 0 0 40px rgba(255,200,0,0.6), 0 0 80px rgba(255,150,0,0.3);
}
body.time-morning .entry-greeting { color: #4a1240; text-shadow: 0 2px 20px rgba(255,180,0,0.5); }
body.time-morning .entry-institution { color: #5a1a10; }
body.time-morning .entry-tagline { color: #6a2a10; }
body.time-morning .entry-divider { background: linear-gradient(90deg, #c89b2c, #ff8c00, #c89b2c); }
body.time-morning .entry-time-label { color: #4a1240; }

/* ──────────────────────────────────────────────────
   AFTERNOON PERIOD
   ────────────────────────────────────────────────── */
#time-entry-overlay.period-afternoon {
  background: linear-gradient(135deg,
    #0d1b3e 0%,
    #4a1240 30%,
    #6f1d5a 55%,
    #9b4820 75%,
    #c89b2c 100%
  );
}

body.time-afternoon .entry-logo-ring::before {
  background: conic-gradient(from 0deg, #c89b2c, #e8b83d, #9b2a7e, #c89b2c);
}
body.time-afternoon .entry-logo-ring::after {
  background: conic-gradient(from 0deg, transparent 40%, rgba(200,155,44,0.5) 100%);
  border: 2px dashed rgba(200,155,44,0.4);
}
body.time-afternoon .entry-logo-ring img {
  box-shadow: 0 0 40px rgba(200,155,44,0.7), 0 0 80px rgba(111,29,90,0.4);
}
body.time-afternoon .entry-greeting { color: #ffe8a0; text-shadow: 0 2px 30px rgba(200,155,44,0.7); }
body.time-afternoon .entry-institution { color: rgba(255,255,255,0.95); }
body.time-afternoon .entry-tagline { color: rgba(255,255,255,0.65); }
body.time-afternoon .entry-divider { background: linear-gradient(90deg, #c89b2c, #e8b83d, #c89b2c); }
body.time-afternoon .entry-time-label { color: rgba(255,255,255,0.8); }

/* ──────────────────────────────────────────────────
   NIGHT PERIOD
   ────────────────────────────────────────────────── */
#time-entry-overlay.period-night {
  background: radial-gradient(ellipse at 80% 20%, #0d1b3e 0%, #050510 40%, #0a0822 70%, #0d0820 100%);
}

body.time-night .entry-logo-ring::before {
  background: conic-gradient(from 0deg, #3a5a8a, #8a9abf, #c89b2c, #3a5a8a);
}
body.time-night .entry-logo-ring::after {
  background: conic-gradient(from 0deg, transparent 30%, rgba(150,180,230,0.3) 100%);
  border: 2px dashed rgba(150,180,230,0.3);
}
body.time-night .entry-logo-ring img {
  box-shadow: 0 0 40px rgba(100,150,230,0.5), 0 0 80px rgba(50,80,150,0.3);
}
body.time-night .entry-greeting { color: #d0e4ff; text-shadow: 0 2px 30px rgba(100,150,230,0.7), 0 0 60px rgba(50,100,200,0.4); }
body.time-night .entry-institution { color: rgba(200,220,255,0.9); }
body.time-night .entry-tagline { color: rgba(180,200,240,0.6); }
body.time-night .entry-divider { background: linear-gradient(90deg, #3a5a8a, #8aaad0, #c89b2c, #8aaad0, #3a5a8a); }
body.time-night .entry-time-label { color: rgba(200,220,255,0.7); }

/* ──────────────────────────────────────────────────
   BODY THEME MODIFICATIONS
   ────────────────────────────────────────────────── */

/* Morning: warm golden tones */
body.time-morning {
  --dorado: #c47a00;
  --dorado-light: #e89a10;
}
body.time-morning header::before {
  background: radial-gradient(ellipse 700px 300px at 25% 50%, rgba(232,184,61,0.2) 0%, transparent 70%),
              radial-gradient(ellipse 400px 400px at 85% 10%, rgba(255,220,120,0.1) 0%, transparent 60%);
}

/* Night: cool dark adjustments */
body.time-night {
  --gris-suave: #f0eff5;
}
body.time-night header {
  background: linear-gradient(135deg, #2a0840 0%, #3d1060 50%, #1a0840 100%);
}
body.time-night header::after {
  background: linear-gradient(90deg, transparent, #8aaad0, rgba(200,155,44,0.8), #8aaad0, transparent);
}

/* ── AMBIENT GLOW EFFECTS ON HEADER ── */
body.time-morning header {
  box-shadow: 0 4px 30px rgba(232,180,50,0.25);
  transition: box-shadow 1s ease;
}
body.time-afternoon header {
  box-shadow: 0 4px 30px rgba(200,155,44,0.2);
}
body.time-night header {
  box-shadow: 0 4px 30px rgba(100,150,230,0.2);
}

/* ── NAV SUBTLE TIME TINT ── */
body.time-morning nav {
  background: rgba(255,252,245,0.98);
}
body.time-night nav {
  background: rgba(250,248,255,0.98);
}

/* ── TIME BADGE (shown after overlay) ── */
#time-badge {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 89;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 30px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.25);
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
  opacity: 0;
  transform: translateY(-10px);
  transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
}
#time-badge.visible {
  opacity: 1;
  transform: translateY(0);
}
#time-badge .badge-icon { font-size: 14px; }
#time-badge .badge-text { }
#time-badge .badge-time { opacity: 0.7; }

body.time-morning #time-badge {
  background: rgba(255, 240, 200, 0.85);
  color: #6a2a00;
  border-color: rgba(220, 160, 0, 0.3);
}
body.time-afternoon #time-badge {
  background: rgba(111,29,90,0.12);
  color: var(--vino-dark);
  border-color: rgba(111,29,90,0.2);
}
body.time-night #time-badge {
  background: rgba(10,20,60,0.75);
  color: #c0d8ff;
  border-color: rgba(100,150,230,0.25);
}

/* ── CAROUSEL EXTRA GLOW ── */
body.time-morning .carousel {
  box-shadow: 0 24px 70px rgba(200,140,30,0.25), 0 0 0 1px rgba(232,184,61,0.2);
}
body.time-night .carousel {
  box-shadow: 0 24px 70px rgba(50,80,160,0.2), 0 0 0 1px rgba(100,150,230,0.15);
}

/* ── ANIMATED SHIMMER ON NAV LINKS (morning only) ── */
body.time-morning nav a.active {
  background: rgba(200,140,0,0.1);
  color: #7a2a00;
}
body.time-morning nav a:hover {
  color: #8a3000;
}

/* ── CARD GLOW SUBTLE TINTS ── */
body.time-night .card {
  background: linear-gradient(135deg, #ffffff 0%, #f8f5ff 100%);
}

/* ── SECTION BG TINTS ── */
body.time-morning .nosotros-section {
  background: linear-gradient(180deg, #fffdf5 0%, #fff8e8 100%);
}
body.time-night .nosotros-section {
  background: linear-gradient(180deg, #fdfcff 0%, #f8f5ff 100%);
}

/* Responsive entry */
@media (max-width: 600px) {
  .entry-logo-ring { width: 90px; height: 90px; }
  .entry-logo-ring img { width: 76px; height: 76px; }
  .entry-greeting { font-size: 34px; }
  .entry-institution { font-size: 14px; letter-spacing: 2px; }
}
