/* ════════════════════════════════════════════════════════════════════════
   calendario-premium.css  ·  TWENTYSIX CRM
   ────────────────────────────────────────────────────────────────────────
   Diseño PREMIUM del modal "Nuevo evento" + bloque Copiloto IA.
   · NO modifica style.css — es una capa de override que se carga DESPUÉS.
   · Reutiliza la paleta de marca (--accent #e8ff47, --ink, grises…).
   · Todos los estilos van namespaced bajo #gcal-event-modal para no
     afectar a ningún otro componente del CRM.
   Carga: <link rel="stylesheet" href="calendario-premium.css"> al final del <head>
   ════════════════════════════════════════════════════════════════════════ */

/* ── Overlay con desenfoque ───────────────────────────────────────────── */
#gcal-event-overlay.cal-premium-overlay {
    background: rgba(12, 12, 14, 0.55) !important;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    animation: calOverlayIn 0.2s var(--ease, ease);
}
@keyframes calOverlayIn { from { opacity: 0; } to { opacity: 1; } }

/* ── Contenedor del modal ─────────────────────────────────────────────── */
#gcal-event-modal.cal-premium {
    width: 560px !important;
    max-width: 95vw !important;
    max-height: 92vh;
    overflow: hidden;
    border-radius: 20px !important;
    background: var(--white, #fff) !important;
    box-shadow:
        0 32px 80px rgba(12, 12, 14, 0.28),
        0 4px 16px rgba(12, 12, 14, 0.12),
        0 0 0 1px rgba(12, 12, 14, 0.04) !important;
    display: flex;
    flex-direction: column;
    animation: calModalIn 0.32s var(--ease-spring, cubic-bezier(0.34,1.56,0.64,0.94));
}
@keyframes calModalIn {
    from { opacity: 0; transform: translate(-50%, -48%) scale(0.96); }
    to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* ── Cabecera ─────────────────────────────────────────────────────────── */
.cal-premium .cal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 22px 26px 18px;
    border-bottom: 1px solid var(--grey-10, #ebebed);
    flex-shrink: 0;
}
.cal-premium .cal-head-title {
    display: flex;
    align-items: center;
    gap: 11px;
}
.cal-premium .cal-head-dot {
    width: 9px; height: 9px; border-radius: 50%;
    background: var(--accent, #e8ff47);
    box-shadow: 0 0 0 4px var(--accent-dim, rgba(232,255,71,0.12));
}
.cal-premium .cal-head h3 {
    font-size: 17px; font-weight: 800; letter-spacing: -0.01em;
    color: var(--ink, #0c0c0e); margin: 0;
}
.cal-premium .cal-close {
    background: var(--grey-5, #f5f5f7); border: none; cursor: pointer;
    width: 32px; height: 32px; border-radius: 9px;
    color: var(--grey-60, #71717a); font-size: 17px; line-height: 1;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.15s var(--ease, ease);
}
.cal-premium .cal-close:hover { background: var(--grey-10, #ebebed); color: var(--ink, #0c0c0e); }

/* ── Cuerpo con scroll ────────────────────────────────────────────────── */
.cal-premium .cal-body {
    padding: 22px 26px;
    overflow-y: auto;
    display: flex; flex-direction: column; gap: 18px;
}
.cal-premium .cal-body::-webkit-scrollbar { width: 8px; }
.cal-premium .cal-body::-webkit-scrollbar-thumb {
    background: var(--grey-20, #d4d4d8); border-radius: 4px;
}

/* ══════════════════════════════════════════════════════════════════════
   BLOQUE COPILOTO IA
   ══════════════════════════════════════════════════════════════════════ */
.cal-copilot {
    background: linear-gradient(135deg, rgba(232,255,71,0.10), rgba(232,255,71,0.03));
    border: 1px solid rgba(232,255,71,0.35);
    border-radius: 14px;
    padding: 16px;
    display: flex; flex-direction: column; gap: 12px;
    position: relative;
}
.cal-copilot-label {
    display: flex; align-items: center; gap: 8px;
    font-size: 11px; font-weight: 800; letter-spacing: 0.06em;
    text-transform: uppercase; color: var(--ink, #0c0c0e);
}
.cal-copilot-label .spark {
    font-size: 14px;
    filter: drop-shadow(0 0 6px rgba(232,255,71,0.6));
}
.cal-copilot-row {
    display: flex; gap: 8px; align-items: stretch;
}
.cal-copilot-agent {
    flex: 0 0 auto; min-width: 150px; max-width: 200px;
    padding: 9px 12px; border-radius: 9px;
    border: 1px solid var(--grey-20, #d4d4d8);
    background: var(--white, #fff);
    font-size: 13px; font-weight: 600; color: var(--ink, #0c0c0e);
    cursor: pointer; transition: border-color 0.15s var(--ease, ease);
}
.cal-copilot-agent:focus { outline: none; border-color: var(--accent, #e8ff47); }
.cal-copilot textarea {
    width: 100%; min-height: 56px; resize: vertical;
    padding: 11px 13px; border-radius: 10px;
    border: 1px solid var(--grey-20, #d4d4d8);
    background: var(--white, #fff);
    font-family: inherit; font-size: 13.5px; line-height: 1.5;
    color: var(--ink, #0c0c0e);
    transition: border-color 0.15s var(--ease, ease);
}
.cal-copilot textarea:focus { outline: none; border-color: var(--accent, #e8ff47); }
.cal-copilot textarea::placeholder { color: var(--grey-40, #a1a1aa); }

.cal-copilot-actions {
    display: flex; align-items: center; gap: 10px; justify-content: space-between;
}
.cal-copilot-hint {
    font-size: 11px; color: var(--grey-60, #71717a); line-height: 1.4;
}
.cal-btn-propose {
    display: inline-flex; align-items: center; gap: 7px;
    background: var(--ink, #0c0c0e); color: var(--accent, #e8ff47);
    border: none; cursor: pointer;
    padding: 10px 18px; border-radius: 10px;
    font-size: 13px; font-weight: 700; letter-spacing: 0.01em;
    white-space: nowrap;
    transition: transform 0.12s var(--ease, ease), box-shadow 0.15s var(--ease, ease);
}
.cal-btn-propose:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(12,12,14,0.22); }
.cal-btn-propose:active { transform: translateY(0); }
.cal-btn-propose:disabled { opacity: 0.55; cursor: default; transform: none; box-shadow: none; }

/* Estado del copiloto (pensando / ok / error) */
.cal-copilot-status {
    font-size: 12px; font-weight: 600; line-height: 1.5;
    padding: 0; min-height: 0; display: none;
    align-items: flex-start; gap: 7px;
}
.cal-copilot-status.show { display: flex; padding: 4px 0 0; }
.cal-copilot-status.thinking { color: var(--grey-60, #71717a); }
.cal-copilot-status.ok       { color: var(--green, #10b981); }
.cal-copilot-status.error    { color: var(--red, #ef4444); }
.cal-copilot-status .dots::after {
    content: ''; animation: calDots 1.2s steps(4, end) infinite;
}
@keyframes calDots {
    0% { content: ''; } 25% { content: '·'; }
    50% { content: '··'; } 75% { content: '···'; }
}

/* ── Separador "o rellena a mano" ─────────────────────────────────────── */
.cal-divider {
    display: flex; align-items: center; gap: 12px;
    font-size: 10.5px; font-weight: 700; letter-spacing: 0.08em;
    text-transform: uppercase; color: var(--grey-40, #a1a1aa);
}
.cal-divider::before, .cal-divider::after {
    content: ''; flex: 1; height: 1px; background: var(--grey-10, #ebebed);
}

/* ══════════════════════════════════════════════════════════════════════
   FORMULARIO PREMIUM
   ══════════════════════════════════════════════════════════════════════ */
.cal-premium .cal-field-title {
    width: 100%;
    font-size: 20px; font-weight: 800; letter-spacing: -0.015em;
    border: none; border-bottom: 2px solid var(--grey-10, #ebebed);
    border-radius: 0; padding: 8px 2px;
    color: var(--ink, #0c0c0e); background: transparent;
    transition: border-color 0.18s var(--ease, ease);
}
.cal-premium .cal-field-title:focus {
    outline: none; border-bottom-color: var(--accent, #e8ff47);
}
.cal-premium .cal-field-title::placeholder { color: var(--grey-20, #d4d4d8); font-weight: 700; }

/* Highlight cuando el copiloto rellena un campo */
@keyframes calFilled {
    0%   { background: rgba(232,255,71,0.0); }
    30%  { background: rgba(232,255,71,0.28); }
    100% { background: rgba(232,255,71,0.0); }
}
.cal-premium .cal-just-filled { animation: calFilled 1.1s var(--ease, ease); }

.cal-premium .cal-grid-2 { display: flex; gap: 14px; }
.cal-premium .cal-grid-2 > * { flex: 1; }

.cal-premium .cal-fld { display: flex; flex-direction: column; gap: 6px; }
.cal-premium .cal-fld-label {
    font-size: 11px; font-weight: 700; letter-spacing: 0.04em;
    text-transform: uppercase; color: var(--grey-60, #71717a);
}
.cal-premium .cal-input {
    width: 100%; padding: 10px 12px; border-radius: 10px;
    border: 1px solid var(--grey-20, #d4d4d8);
    background: var(--white, #fff);
    font-family: inherit; font-size: 13.5px; color: var(--ink, #0c0c0e);
    transition: border-color 0.15s var(--ease, ease);
}
.cal-premium .cal-input:focus { outline: none; border-color: var(--accent, #e8ff47); }
.cal-premium textarea.cal-input { resize: vertical; min-height: 70px; line-height: 1.5; }

/* Toggle "todo el día" como switch */
.cal-premium .cal-allday {
    display: flex; align-items: center; justify-content: space-between;
    padding: 11px 14px; border-radius: 10px;
    background: var(--grey-5, #f5f5f7);
}
.cal-premium .cal-allday-text {
    font-size: 13px; font-weight: 600; color: var(--ink, #0c0c0e);
}
.cal-switch { position: relative; width: 44px; height: 26px; flex-shrink: 0; }
.cal-switch input { opacity: 0; width: 0; height: 0; }
.cal-switch .cal-slider {
    position: absolute; cursor: pointer; inset: 0;
    background: var(--grey-20, #d4d4d8); border-radius: 999px;
    transition: background 0.2s var(--ease, ease);
}
.cal-switch .cal-slider::before {
    content: ''; position: absolute; height: 20px; width: 20px;
    left: 3px; bottom: 3px; background: #fff; border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    transition: transform 0.22s var(--ease-spring, cubic-bezier(0.34,1.56,0.64,0.94));
}
.cal-switch input:checked + .cal-slider { background: var(--ink, #0c0c0e); }
.cal-switch input:checked + .cal-slider::before { transform: translateX(18px); }

/* Selector de color como chips */
.cal-color-chips { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.cal-color-chip {
    width: 30px; height: 30px; border-radius: 9px; cursor: pointer;
    border: 2px solid transparent; position: relative;
    transition: transform 0.12s var(--ease, ease);
}
.cal-color-chip:hover { transform: scale(1.1); }
.cal-color-chip.active { border-color: var(--ink, #0c0c0e); }
.cal-color-chip.active::after {
    content: '✓'; position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 13px; font-weight: 800;
    text-shadow: 0 1px 2px rgba(0,0,0,0.4);
}

/* ── Pie con acciones ─────────────────────────────────────────────────── */
.cal-premium .cal-foot {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 26px; border-top: 1px solid var(--grey-10, #ebebed);
    flex-shrink: 0; background: var(--white, #fff);
}
.cal-premium .cal-foot-right { display: flex; gap: 10px; margin-left: auto; }
.cal-btn-delete {
    background: none; border: none; cursor: pointer;
    color: var(--red, #ef4444); font-size: 13px; font-weight: 600;
    padding: 9px 4px;
}
.cal-btn-delete:hover { text-decoration: underline; }
.cal-btn-cancel {
    background: var(--white, #fff); border: 1px solid var(--grey-20, #d4d4d8);
    cursor: pointer; color: var(--grey-60, #71717a);
    padding: 10px 18px; border-radius: 10px; font-size: 13px; font-weight: 600;
    transition: all 0.15s var(--ease, ease);
}
.cal-btn-cancel:hover { background: var(--grey-5, #f5f5f7); border-color: var(--grey-40, #a1a1aa); }
.cal-btn-save {
    background: var(--ink, #0c0c0e); color: var(--white, #fff);
    border: none; cursor: pointer;
    padding: 10px 22px; border-radius: 10px; font-size: 13px; font-weight: 700;
    display: inline-flex; align-items: center; gap: 7px;
    transition: transform 0.12s var(--ease, ease), box-shadow 0.15s var(--ease, ease);
}
.cal-btn-save:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(12,12,14,0.22); }
.cal-btn-save:active { transform: translateY(0); }
.cal-btn-save:disabled { opacity: 0.6; cursor: default; transform: none; box-shadow: none; }

/* ══════════════════════════════════════════════════════════════════════
   BOTÓN "+ CREAR" PREMIUM (el que abre el modal)
   Reemplaza el "+" plano por un chip neón de marca.
   ══════════════════════════════════════════════════════════════════════ */
.cal-create-btn {
    display: inline-flex; align-items: center; gap: 8px;
    background: var(--ink, #0c0c0e); color: var(--accent, #e8ff47);
    border: none; cursor: pointer;
    padding: 10px 18px; border-radius: 11px;
    font-size: 13.5px; font-weight: 700; letter-spacing: 0.01em;
    box-shadow: 0 2px 10px rgba(12,12,14,0.18);
    transition: transform 0.14s var(--ease, ease), box-shadow 0.18s var(--ease, ease);
}
.cal-create-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(12,12,14,0.28), 0 0 0 3px var(--accent-dim, rgba(232,255,71,0.12));
}
.cal-create-btn:active { transform: translateY(0); }
.cal-create-btn .cal-create-plus {
    display: inline-flex; align-items: center; justify-content: center;
    width: 20px; height: 20px; border-radius: 6px;
    background: var(--accent, #e8ff47); color: var(--ink, #0c0c0e);
    font-size: 15px; font-weight: 900; line-height: 1;
}

/* ── Responsivo ───────────────────────────────────────────────────────── */
@media (max-width: 600px) {
    #gcal-event-modal.cal-premium { width: 95vw !important; }
    .cal-copilot-row { flex-direction: column; }
    .cal-copilot-agent { max-width: 100%; }
    .cal-premium .cal-grid-2 { flex-direction: column; gap: 14px; }
}

/* ════════════════════════════════════════════════════════════
   FASE 2B — Aviso de doble-booking
   ════════════════════════════════════════════════════════════ */
#cal-conflict-banner {
    margin: 4px 24px 0;
    background: #fff5f5;
    border: 1.5px solid #fecaca;
    border-radius: 12px;
    padding: 12px 14px;
    animation: cc-pop 0.25s var(--ease-spring, cubic-bezier(0.34,1.56,0.64,0.94));
}
@keyframes cc-pop {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}
#cal-conflict-banner .cc-head {
    font-size: 13px;
    font-weight: 700;
    color: #dc2626;
    margin-bottom: 8px;
    line-height: 1.35;
}
#cal-conflict-banner .cc-head strong { font-weight: 800; }
#cal-conflict-banner .cc-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
#cal-conflict-banner .cc-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #7f1d1d;
}
#cal-conflict-banner .cc-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: #ef4444;
    flex-shrink: 0;
}
#cal-conflict-banner .cc-date {
    font-weight: 700;
    text-transform: capitalize;
    white-space: nowrap;
    min-width: 96px;
}
#cal-conflict-banner .cc-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
#cal-conflict-banner .cc-foot {
    font-size: 11px;
    color: #b91c1c;
    margin-top: 8px;
    opacity: 0.85;
}