/* ============================================================
   CALENDARIO — Distrito Uno
   ============================================================ */

/* ── Leyenda de categorías ──────────────────────────────────── */
.cal-leyenda {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
    padding: 0 1rem 2.5rem;
}

.cal-leyenda-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: transparent;
    border: 1px solid rgba(255,255,255,0.2);
    color: rgba(255,255,255,0.5);
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 0.4rem 0.9rem;
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cal-leyenda-btn.filtro-activo {
    border-color: var(--cat-color);
    color: #fff;
}

.cal-leyenda-btn:hover,
.cal-leyenda-btn:focus {
    border-color: var(--cat-color);
    color: #fff;
    outline: none;
}

.cal-leyenda-btn:not(.filtro-activo):focus {
    border-color: rgba(255,255,255,0.2);
    color: rgba(255,255,255,0.5);
}

.cal-leyenda-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* ── Wrapper del calendario ─────────────────────────────────── */
.cal-wrapper {
    padding: 0 1rem 4rem;
    max-width: 1100px;
    margin: 0 auto;
}

/* ── FullCalendar overrides ─────────────────────────────────── */
#d1-calendar {
    font-family: inherit;
}

/* Toolbar (header) */
.fc .fc-toolbar {
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.fc .fc-toolbar-title {
    font-family: var(--font-condensed, 'Barlow Condensed', sans-serif);
    font-size: 1.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #fff;
    letter-spacing: 0.05em;
}

/* Botones nav (prev/next/today) */
.fc .fc-button {
    background: transparent !important;
    border: 1px solid rgba(255,255,255,0.2) !important;
    color: #fff !important;
    font-family: inherit !important;
    font-size: 0.75rem !important;
    font-weight: 600 !important;
    letter-spacing: 0.05em !important;
    text-transform: uppercase !important;
    padding: 0.4rem 0.9rem !important;
    border-radius: 4px !important;
    transition: all 0.2s ease !important;
    box-shadow: none !important;
}

.fc .fc-button:hover,
.fc .fc-button:focus {
    background: var(--color-primary, #e53d3d) !important;
    border-color: var(--color-primary, #e53d3d) !important;
    outline: none !important;
}

.fc .fc-button-primary:not(:disabled).fc-button-active {
    background: var(--color-primary, #e53d3d) !important;
    border-color: var(--color-primary, #e53d3d) !important;
}

/* Grid */
.fc .fc-scrollgrid {
    border-color: rgba(255,255,255,0.08) !important;
    border-radius: 8px;
    overflow: hidden;
}

.fc .fc-scrollgrid-section > td {
    border-color: rgba(255,255,255,0.08) !important;
}

.fc th {
    background: rgba(255,255,255,0.04) !important;
    border-color: rgba(255,255,255,0.08) !important;
    color: rgba(255,255,255,0.4) !important;
    font-size: 0.7rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.1em !important;
    text-transform: uppercase !important;
    padding: 0.6rem 0 !important;
}

.fc .fc-daygrid-day {
    background: transparent !important;
    border-color: rgba(255,255,255,0.06) !important;
    transition: background 0.15s ease;
}

.fc .fc-daygrid-day:hover {
    background: rgba(255,255,255,0.03) !important;
}

/* Día actual */
.fc .fc-day-today {
    background: rgba(229, 61, 61, 0.08) !important;
}

.fc .fc-day-today .fc-daygrid-day-number {
    background: var(--color-primary, #e53d3d);
    color: #fff !important;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

/* Números de día */
.fc .fc-daygrid-day-number {
    color: rgba(255,255,255,0.5) !important;
    font-size: 0.8rem !important;
    font-weight: 600 !important;
    padding: 0.4rem !important;
    text-decoration: none !important;
}

/* Días fuera del mes */
.fc .fc-day-other .fc-daygrid-day-number {
    color: rgba(255,255,255,0.15) !important;
}

/* Eventos */
.fc .fc-event {
    border-radius: 4px !important;
    border: none !important;
    padding: 2px 6px !important;
    font-size: 0.72rem !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: opacity 0.15s ease, transform 0.15s ease !important;
}

.fc .fc-event:hover {
    opacity: 0.85 !important;
    transform: translateY(-1px) !important;
}

.fc .fc-event-title {
    font-family: inherit !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* "+N más" */
.fc .fc-daygrid-more-link {
    color: rgba(255,255,255,0.5) !important;
    font-size: 0.7rem !important;
    font-weight: 600 !important;
}

.fc .fc-daygrid-more-link:hover {
    color: #fff !important;
}

/* Popover del "+N más" */
.fc .fc-popover {
    background: #1a1a1a !important;
    border: 1px solid rgba(255,255,255,0.1) !important;
    border-radius: 8px !important;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5) !important;
}

.fc .fc-popover-header {
    background: rgba(255,255,255,0.05) !important;
    color: #fff !important;
    font-size: 0.8rem !important;
    font-weight: 700 !important;
    padding: 0.6rem 0.75rem !important;
    border-radius: 8px 8px 0 0 !important;
}

.fc .fc-popover-close {
    color: rgba(255,255,255,0.5) !important;
}

/* Vista lista (móvil) */
.fc .fc-list-day-cushion {
    background: rgba(255,255,255,0.05) !important;
    color: #fff !important;
    font-weight: 700 !important;
    font-size: 0.8rem !important;
    letter-spacing: 0.05em !important;
    text-transform: uppercase !important;
}

.fc .fc-list-event:hover td {
    background: rgba(255,255,255,0.04) !important;
}

.fc .fc-list-event-title a {
    color: #fff !important;
    text-decoration: none !important;
    font-weight: 600 !important;
}

.fc .fc-list-event-time {
    color: rgba(255,255,255,0.4) !important;
    font-size: 0.75rem !important;
}

.fc .fc-list-empty {
    background: transparent !important;
    color: rgba(255,255,255,0.3) !important;
}

.fc .fc-list-empty-cushion {
    font-size: 0.9rem !important;
}

/* ── Modal del evento ───────────────────────────────────────── */
.cal-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.75);
    z-index: 99990;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    overflow-y: auto;
}

.cal-modal-overlay.activo {
    display: flex;
}

.cal-modal-wrapper {
    background: #111;
    border-radius: 12px;
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
    border-top: 4px solid var(--modal-color, #e53d3d);
    flex-shrink: 0;
}

.cal-modal-img-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    overflow: hidden;
}

.cal-modal-img-wrap[style*="display: none"] + .cal-modal-body {
    padding-top: 2.5rem;
}

.cal-modal-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.cal-modal-badge {
    display: inline-block;
    background: var(--modal-color, #e53d3d);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    margin-bottom: 0.75rem;
}

.cal-modal-badge:empty {
    display: none;
}

.cal-modal-body {
    padding: 1.5rem;
    background: #1a1a1a;
}

/* Reutiliza lugar-modal-info pero con más contraste */
.cal-modal-wrapper .lugar-modal-info {
    color: rgba(255,255,255,0.85);
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.cal-modal-meta {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin: 0.75rem 0 1.25rem;
}

.cal-modal-meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: rgba(255,255,255,0.55);
    font-size: 0.82rem;
}

.cal-modal-meta-item svg {
    flex-shrink: 0;
    opacity: 0.6;
}

.cal-modal-wrapper .lugar-modal-titulo {
    color: #fff;
}

.cal-modal-wrapper .lugar-modal-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    z-index: 100;
    background: rgba(0,0,0,0.6);
    border: none;
    color: #fff;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.7rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.cal-modal-wrapper .lugar-modal-close:hover {
    background: var(--color-primary, #e53d3d);
}
