/* ═══════════════════════════════════════════════════
   CI Calendario — PRO FUTURISTA v3.0
   Dark glassmorphism · Gradientes · Animaciones
═══════════════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ── VARIABLES ──────────────────────────────────── */
:root {
  --ci-bg:          #0d0d1a;
  --ci-surface:     rgba(255,255,255,0.04);
  --ci-surface2:    rgba(255,255,255,0.07);
  --ci-border:      rgba(255,255,255,0.10);
  --ci-border2:     rgba(255,255,255,0.16);
  --ci-text:        #e8e8f5;
  --ci-muted:       rgba(232,232,245,0.45);
  --ci-purple:      #7c3aed;
  --ci-purple2:     #a855f7;
  --ci-orange:      #f97316;
  --ci-orange2:     #fb923c;
  --ci-green:       #10b981;
  --ci-grad:        linear-gradient(135deg, #7c3aed 0%, #a855f7 50%, #f97316 100%);
  --ci-grad2:       linear-gradient(135deg, #1e1035 0%, #0d0d1a 100%);
  --ci-glow-purple: 0 0 24px rgba(124,58,237,0.45);
  --ci-glow-orange: 0 0 24px rgba(249,115,22,0.45);
  --ci-radius:      18px;
  --ci-font:        'Inter', system-ui, sans-serif;
}

/* ── WRAPPER GLOBAL ─────────────────────────────── */
.ci-calendar-container,
.ci-proponer-wrap {
  font-family: var(--ci-font);
  color: var(--ci-text);
}

/* ── LAYOUT PRINCIPAL ───────────────────────────── */
.ci-calendar-container {
  max-width: 760px;
  margin: 0 auto;
  background: var(--ci-grad2);
  border-radius: var(--ci-radius);
  border: 1px solid var(--ci-border);
  padding: 32px 28px 24px;
  position: relative;
  overflow: visible;
  box-shadow: 0 0 0 1px rgba(124,58,237,.15),
              0 32px 80px rgba(0,0,0,.55);
}

/* Línea de acento superior */
.ci-calendar-container::before {
  content: '';
  position: absolute;
  top: 0; left: 10%; right: 10%;
  height: 2px;
  background: var(--ci-grad);
  border-radius: 0 0 4px 4px;
  opacity: .9;
}

/* ── CABECERA MES ───────────────────────────────── */
.ci-calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
}

.ci-calendar-header button {
  background: var(--ci-surface);
  border: 1px solid var(--ci-border2);
  border-radius: 12px;
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  cursor: pointer;
  color: var(--ci-text);
  transition: all .2s ease;
  backdrop-filter: blur(8px);
}
.ci-calendar-header button:hover {
  background: rgba(124,58,237,.25);
  border-color: var(--ci-purple);
  box-shadow: var(--ci-glow-purple);
  transform: scale(1.08);
}

.ci-calendar-header h2 {
  font-size: 22px;
  font-weight: 800;
  margin: 0;
  background: var(--ci-grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -.02em;
}

/* ── GRID DE DÍAS ───────────────────────────────── */
.ci-calendar-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  text-align: center;
}

.ci-dow-header {
  font-size: 10px;
  font-weight: 700;
  color: var(--ci-muted);
  text-transform: uppercase;
  letter-spacing: .1em;
  padding: 0 0 12px;
}

.ci-day {
  aspect-ratio: 1;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 500;
  color: var(--ci-text);
  background: transparent;
  border: 1px solid transparent;
  transition: all .18s ease;
  position: relative;
}
.ci-day:hover {
  background: var(--ci-surface2);
  border-color: var(--ci-border2);
  transform: translateY(-1px);
}

.ci-day-empty {
  cursor: default;
  opacity: .15;
}
.ci-day-empty:hover {
  background: transparent;
  border-color: transparent;
  transform: none;
}

/* HOY */
.ci-today {
  background: rgba(16,185,129,.15) !important;
  border-color: var(--ci-green) !important;
  color: var(--ci-green) !important;
  font-weight: 800;
  box-shadow: 0 0 16px rgba(16,185,129,.25);
  animation: ci-pulse-green 3s ease-in-out infinite;
}

/* DÍA CON EVENTO */
.ci-event {
  background: rgba(249,115,22,.15) !important;
  border-color: var(--ci-orange) !important;
  font-weight: 700;
  color: var(--ci-orange2) !important;
  box-shadow: 0 0 14px rgba(249,115,22,.2);
}
.ci-event:hover {
  background: rgba(249,115,22,.25) !important;
  box-shadow: var(--ci-glow-orange);
  transform: translateY(-2px) scale(1.04);
}

/* Punto indicador en días con evento */
.ci-event::after {
  content: '';
  position: absolute;
  bottom: 5px;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--ci-orange);
  box-shadow: 0 0 6px var(--ci-orange);
}

@keyframes ci-pulse-green {
  0%, 100% { box-shadow: 0 0 16px rgba(16,185,129,.25); }
  50%       { box-shadow: 0 0 28px rgba(16,185,129,.5); }
}

/* ── TOOLTIP ────────────────────────────────────── */
.ci-tooltip {
  display: none;
  position: fixed;
  background: rgba(13,13,26,.92);
  backdrop-filter: blur(16px);
  border: 1px solid var(--ci-border2);
  padding: 12px 16px;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,.5), var(--ci-glow-purple);
  z-index: 99999;
  font-size: 13px;
  line-height: 1.6;
  max-width: 240px;
  pointer-events: none;
  color: var(--ci-text);
  animation: ci-fadein .12s ease;
}
.ci-tooltip strong { color: #fff; font-weight: 700; }

@keyframes ci-fadein {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── SECCIÓN PRÓXIMOS EVENTOS ───────────────────── */
.ci-events-box {
  margin-top: 30px;
  padding-top: 24px;
  border-top: 1px solid var(--ci-border);
}

.ci-events-box h3 {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ci-muted);
  margin: 0 0 16px;
}

/* Tarjeta de evento individual */
.ci-event-mini {
  background: var(--ci-surface);
  border: 1px solid var(--ci-border);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 10px;
  backdrop-filter: blur(8px);
  transition: all .2s ease;
  position: relative;
  overflow: hidden;
}
.ci-event-mini::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--ci-grad);
  border-radius: 3px 0 0 3px;
}
.ci-event-mini:hover {
  background: var(--ci-surface2);
  border-color: rgba(124,58,237,.35);
  transform: translateX(4px);
  box-shadow: -4px 0 20px rgba(124,58,237,.15);
}

.ci-event-title {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 6px;
  line-height: 1.3;
}
.ci-event-date,
.ci-event-time,
.ci-event-loc,
.ci-event-din {
  font-size: 12px;
  color: var(--ci-muted);
  display: block;
  line-height: 1.7;
}
.ci-no-eventos {
  color: var(--ci-muted);
  font-size: 14px;
  text-align: center;
  padding: 20px;
  border: 1px dashed var(--ci-border);
  border-radius: 12px;
}

/* ── EVENTOS PASADOS — DESPLEGABLE ──────────────── */
.ci-past-events {
  margin-top: 16px;
  border: 1px solid var(--ci-border);
  border-radius: 14px;
  overflow: hidden;
  background: var(--ci-surface);
}

.ci-past-events summary {
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ci-muted);
  padding: 12px 16px;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
  user-select: none;
  transition: all .15s;
}
.ci-past-events summary::-webkit-details-marker { display: none; }
.ci-past-events summary::before {
  content: '▸';
  font-size: 10px;
  transition: transform .2s;
  display: inline-block;
}
.ci-past-events[open] summary::before { transform: rotate(90deg); }
.ci-past-events summary:hover { color: var(--ci-text); background: var(--ci-surface2); }
.ci-past-events[open] summary { border-bottom: 1px solid var(--ci-border); color: var(--ci-text); }

.ci-past-badge {
  font-size: 10px;
  color: rgba(232,232,245,.3);
  font-weight: 400;
  letter-spacing: .04em;
}
.ci-past-content { padding: 12px; }

/* ═══════════════════════════════════════════════════
   FORMULARIO PROPONER EVENTO — PRO
═══════════════════════════════════════════════════ */
.ci-proponer-wrap {
  max-width: 760px;
  margin: 24px auto 0;
  background: var(--ci-grad2);
  border: 1px solid var(--ci-border);
  border-radius: var(--ci-radius);
  padding: 36px 32px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(124,58,237,.1),
              0 32px 80px rgba(0,0,0,.5);
}

/* Línea de acento superior */
.ci-proponer-wrap::before {
  content: '';
  position: absolute;
  top: 0; left: 10%; right: 10%;
  height: 2px;
  background: var(--ci-grad);
  opacity: .7;
  border-radius: 0 0 4px 4px;
}

/* Orbe de fondo decorativo */
.ci-proponer-wrap::after {
  content: '';
  position: absolute;
  width: 320px; height: 320px;
  background: radial-gradient(circle, rgba(124,58,237,.12) 0%, transparent 70%);
  top: -80px; right: -80px;
  pointer-events: none;
  border-radius: 50%;
}

.ci-proponer-titulo {
  font-size: 20px;
  font-weight: 800;
  margin: 0 0 6px;
  background: var(--ci-grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -.02em;
  position: relative; z-index: 1;
}
.ci-proponer-sub {
  font-size: 13px;
  color: var(--ci-muted);
  margin: 0 0 28px;
  position: relative; z-index: 1;
}

/* Filas del formulario */
.ci-form-row {
  display: flex;
  gap: 16px;
  margin-bottom: 18px;
  flex-wrap: wrap;
  position: relative; z-index: 1;
}
.ci-form-row-3 > .ci-form-group { flex: 1 1 140px; }
.ci-form-row   > .ci-form-group { flex: 1 1 200px; }

.ci-form-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.ci-form-group-full {
  width: 100%;
  margin-bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  position: relative; z-index: 1;
}

.ci-form-group label,
.ci-form-group-full label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ci-muted);
}
.ci-req { color: var(--ci-orange); margin-left: 2px; }
.ci-opt { color: rgba(232,232,245,.25); font-weight: 400; }

/* Inputs */
.ci-proponer-form input[type="text"],
.ci-proponer-form input[type="date"],
.ci-proponer-form input[type="time"],
.ci-proponer-form textarea {
  padding: 11px 14px;
  background: rgba(255,255,255,.05);
  border: 1px solid var(--ci-border2);
  border-radius: 10px;
  font-size: 14px;
  font-family: var(--ci-font);
  color: var(--ci-text);
  outline: none;
  transition: all .2s ease;
  width: 100%;
  box-sizing: border-box;
  backdrop-filter: blur(4px);
  /* Fix color scheme for dark inputs */
  color-scheme: dark;
}
.ci-proponer-form input::placeholder,
.ci-proponer-form textarea::placeholder {
  color: rgba(232,232,245,.25);
}
.ci-proponer-form input:focus,
.ci-proponer-form textarea:focus {
  border-color: var(--ci-purple);
  background: rgba(124,58,237,.1);
  box-shadow: 0 0 0 3px rgba(124,58,237,.15), var(--ci-glow-purple);
}
.ci-proponer-form textarea {
  min-height: 100px;
  resize: vertical;
}

/* Mapa */
.ci-mapa-proponer {
  width: 100%;
  height: 220px;
  border-radius: 12px;
  margin-top: 8px;
  border: 1px solid var(--ci-border2);
  z-index: 0;
  overflow: hidden;
  /* Leaflet dentro de fondo oscuro */
  filter: brightness(.9) contrast(1.05) saturate(.9);
}

/* Input archivo */
.ci-file-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.ci-btn-file {
  padding: 9px 16px;
  background: var(--ci-surface2);
  border: 1px solid var(--ci-border2);
  border-radius: 8px;
  font-size: 13px;
  font-family: var(--ci-font);
  color: var(--ci-text);
  cursor: pointer;
  transition: all .18s;
}
.ci-btn-file:hover {
  background: rgba(124,58,237,.2);
  border-color: var(--ci-purple);
}
#ci-file-label { font-size: 12px; color: var(--ci-muted); }
.ci-form-group-full small { font-size: 11px; color: rgba(232,232,245,.25); }

/* Botón enviar */
.ci-form-submit-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
  margin-bottom: 14px;
  position: relative; z-index: 1;
}

.ci-btn-submit {
  padding: 13px 32px;
  background: var(--ci-grad);
  background-size: 200% 200%;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  font-family: var(--ci-font);
  cursor: pointer;
  letter-spacing: .02em;
  transition: all .25s ease;
  box-shadow: 0 4px 20px rgba(124,58,237,.4);
  animation: ci-grad-shift 4s ease infinite;
  background-size: 200%;
}
.ci-btn-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(124,58,237,.6), 0 0 0 1px rgba(255,255,255,.1);
}
.ci-btn-submit:active { transform: translateY(0); }
.ci-btn-submit:disabled {
  opacity: .5;
  cursor: not-allowed;
  transform: none;
  animation: none;
}

@keyframes ci-grad-shift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Mensajes */
.ci-proponer-msg {
  display: none;
  padding: 13px 16px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  margin-top: 8px;
  position: relative; z-index: 1;
  animation: ci-fadein .2s ease;
}
.ci-msg-ok {
  background: rgba(16,185,129,.12);
  border: 1px solid rgba(16,185,129,.3);
  color: #6ee7b7;
}
.ci-msg-err {
  background: rgba(239,68,68,.1);
  border: 1px solid rgba(239,68,68,.25);
  color: #fca5a5;
}

/* Aviso inferior */
.ci-proponer-notice {
  margin-top: 18px;
  padding: 12px 16px;
  background: rgba(124,58,237,.08);
  border: 1px solid rgba(124,58,237,.2);
  border-radius: 10px;
  font-size: 12px;
  color: rgba(168,85,247,.85);
  position: relative; z-index: 1;
  letter-spacing: .01em;
}

/* ── SCROLLBAR personalizado ────────────────────── */
.ci-past-content::-webkit-scrollbar { width: 4px; }
.ci-past-content::-webkit-scrollbar-track { background: transparent; }
.ci-past-content::-webkit-scrollbar-thumb { background: var(--ci-border2); border-radius: 4px; }

/* ── RESPONSIVE ─────────────────────────────────── */
@media (max-width: 640px) {
  .ci-calendar-container { padding: 20px 14px 18px; }
  .ci-proponer-wrap      { padding: 24px 16px; }
  .ci-form-row,
  .ci-form-row-3         { flex-direction: column; }
  .ci-calendar-header h2 { font-size: 18px; }
  .ci-day                { font-size: 12px; border-radius: 8px; }
}
