/* CALENDARIO COMPACTO - DISEÑO LIMPIO Y LEGIBLE */

.calendario-container {
    max-width: 100%;
    margin: 1rem auto;
    padding: 1.5rem;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    border: 1px solid #e5e7eb;
}

.calendario-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.calendario-nav {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #64748b;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.calendario-nav:hover {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.calendario-titulo-container {
    text-align: center;
    flex: 1;
}

.calendario-titulo-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.calendario-titulo {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
    letter-spacing: -0.025em;
}

.calendario-contador-eventos {
    font-size: 0.9rem;
    color: #64748b;
    margin: 0;
    font-weight: 500;
}

.btn-agregar-calendario {
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    margin-left: 0.5rem;
    transition: all 0.2s ease;
}

.btn-agregar-calendario:hover {
    background: #2563eb;
}

.calendario-grid {
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
}

.calendario-dias-semana {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 1px solid #e2e8f0;
}

.dia-semana {
    padding: 1rem 0.5rem;
    text-align: center;
    font-size: 0.8rem;
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.75px;
}

.calendario-dias {
    display: grid !important;
    grid-template-columns: repeat(7, 1fr) !important;
    grid-auto-rows: 80px !important;
    gap: 0;
    background: transparent;
    padding: 0;
    width: 100%;
    box-sizing: border-box;
    contain: layout style;
}

.calendario-dia {
    background: #ffffff;
    height: 80px !important;
    max-height: 80px !important;
    min-height: 80px !important;
    padding: 0.4rem 0.3rem;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex !important;
    flex-direction: column !important;
    align-items: center;
    justify-content: space-between;
    border-radius: 0;
    border-right: 1px solid #e5e7eb;
    border-bottom: 1px solid #e5e7eb;
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: none !important;
    overflow: hidden !important;
    contain: layout style size;
}

.calendario-dia:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.calendario-dia.vacio {
    background: #fafbfc;
    cursor: default;
    opacity: 0.4;
    border-color: transparent;
}

.calendario-dia.vacio:hover {
    background: #fafbfc;
    border-color: transparent;
    transform: none;
    box-shadow: none;
}

/* Estilos del día actual ELIMINADOS - Ya no se usa la clase .hoy */

.calendario-dia.con-eventos {
    background: #ffffff;
    border: 2px solid #e5e7eb;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    height: 80px !important;
    max-height: 80px !important;
    min-height: 80px !important;
    overflow: hidden !important;
}

.calendario-dia.con-eventos:hover {
    background: #f8fafc;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: #cbd5e1;
}

.numero-dia {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    margin-top: 0.5rem;
    color: #374151;
    line-height: 1;
    min-height: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    position: relative;
    z-index: 2;
}

.punto-hoy {
    width: 5px;
    height: 5px;
    background: #000 !important;
    border-radius: 50%;
    display: inline-block;
}

/* Eliminado */

.calendario-dia.vacio .numero-dia {
    color: #9ca3af;
}

.calendario-dia.con-eventos .numero-dia {
    color: #374151;
    font-weight: 600;
}

/* EVENTOS EN EL CALENDARIO - DISEÑO MINIMALISTA */
.eventos-del-dia {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1px;
    max-height: 35px;
    overflow: hidden;
    margin-top: auto;
    padding: 0 2px 2px 2px;
    flex-shrink: 0;
    position: relative;
    z-index: 2;
}

/* DISEÑO LIMPIO SIN BARRAS LINEALES */

.evento-calendario {
    display: flex;
    align-items: center;
    gap: 0.2rem;
    padding: 0.1rem 0.25rem;
    border-radius: 4px;
    font-size: 0.6rem;
    line-height: 1.1;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(59, 130, 246, 0.08);
    color: #1e40af;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    font-weight: 600;
    border: 1px solid rgba(59, 130, 246, 0.15);
    height: 16px;
    max-height: 16px;
    flex-shrink: 0;
}

.evento-calendario:hover {
    background: rgba(59, 130, 246, 0.15);
    transform: scale(1.02);
    border-color: rgba(59, 130, 246, 0.3);
}

.evento-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #3b82f6;
    flex-shrink: 0;
}

.evento-titulo-mini {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

/* CONTADOR DE EVENTOS ADICIONALES */
.contador-eventos-adicionales {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #6b7280;
    color: white;
    border-radius: 8px;
    padding: 2px 5px;
    font-size: 0.65rem;
    font-weight: 600;
    margin-top: 2px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    min-width: fit-content;
    flex-shrink: 0;
}

.contador-eventos-adicionales:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    transform: scale(1.15);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

/* Removido el + automático para evitar duplicación */

/* TOOLTIP PARA EVENTOS ADICIONALES */
.tooltip-eventos {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #1e293b;
    color: white;
    padding: 0.5rem;
    border-radius: 6px;
    font-size: 0.7rem;
    white-space: nowrap;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    margin-bottom: 0.3rem;
}

.tooltip-eventos::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: #1e293b;
}

.contador-eventos-adicionales:hover .tooltip-eventos {
    opacity: 1;
    visibility: visible;
}

/* COLORES POR CATEGORÍA */
.evento-calendario.musical .evento-dot {
    background: #f59e0b;
}

.evento-calendario.cultural .evento-dot {
    background: #8b5cf6;
}

.evento-calendario.deportivo .evento-dot {
    background: #10b981;
}

.evento-calendario.educativo .evento-dot {
    background: #3b82f6;
}

.evento-calendario.gastronomico .evento-dot {
    background: #ef4444;
}

.evento-calendario.religioso .evento-dot {
    background: #6366f1;
}

.evento-calendario.comercial .evento-dot {
    background: #f97316;
}

.evento-calendario.musical {
    background: rgba(245, 158, 11, 0.1);
    color: #d97706;
}

.evento-calendario.cultural {
    background: rgba(139, 92, 246, 0.1);
    color: #7c3aed;
}

.evento-calendario.deportivo {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
}

.evento-calendario.educativo {
    background: rgba(59, 130, 246, 0.1);
    color: #2563eb;
}

.evento-calendario.gastronomico {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

.evento-calendario.religioso {
    background: rgba(99, 102, 241, 0.1);
    color: #4f46e5;
}

.evento-calendario.comercial {
    background: rgba(249, 115, 22, 0.1);
    color: #ea580c;
}

/* RESPONSIVE MEJORADO */
@media (max-width: 768px) {
    .calendario-container {
        padding: 0.75rem;
        margin: 0.5rem;
        border-radius: 8px;
    }

    .calendario-header {
        padding: 0.75rem 1rem;
        margin-bottom: 0.75rem;
    }

    .calendario-titulo {
        font-size: 1.25rem;
    }

    .calendario-nav {
        width: 36px;
        height: 36px;
    }

    .dia-semana {
        font-size: 0.7rem;
        padding: 0.4rem 0.2rem;
    }

    .calendario-dia {
        height: 55px !important;
        max-height: 55px !important;
        min-height: 55px !important;
        padding: 0.2rem 0.15rem;
        justify-content: flex-start;
        gap: 0.15rem;
    }

    .numero-dia {
        font-size: 0.75rem;
        margin: 0;
        line-height: 1;
        flex-shrink: 0;
    }

    .eventos-del-dia {
        max-height: 32px;
        padding: 0;
        margin-top: 0.1rem;
        flex: 1;
        justify-content: flex-end;
    }

    .evento-calendario {
        height: 13px;
        max-height: 13px;
        font-size: 0.5rem;
        padding: 0.05rem 0.15rem;
        gap: 0.1rem;
    }

    .evento-dot {
        width: 3px;
        height: 3px;
    }

    .contador-eventos-adicionales {
        padding: 1px 4px;
        font-size: 0.5rem;
        margin-top: 1px;
        background: #374151;
        height: 13px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .calendario-container {
        padding: 0.5rem !important;
        margin: 0.25rem !important;
    }

    /* ELIMINAR ESPACIOS COMPLETAMENTE */
    .calendario-grid,
    .calendario-dias,
    div[class*="calendario-dias"],
    .eventos-container .calendario-dias {
        gap: 0 !important;
        padding: 0 !important;
        background: transparent !important;
        row-gap: 0 !important;
        column-gap: 0 !important;
        grid-gap: 0 !important;
        grid-row-gap: 0 !important;
        grid-column-gap: 0 !important;
        grid-auto-rows: 48px !important;
    }

    /* PUNTO NEGRO FORZADO */
    .calendario-dias .numero-dia .punto-hoy,
    .numero-dia .punto-hoy,
    .punto-hoy,
    span.punto-hoy {
        width: 4px !important;
        height: 4px !important;
        background: #000000 !important;
        background-color: #000000 !important;
        border-radius: 50% !important;
        display: inline-block !important;
        opacity: 1 !important;
    }

    .calendario-header {
        padding: 0.5rem 0.75rem !important;
        margin-bottom: 0.5rem !important;
    }

    .calendario-nav {
        width: 32px !important;
        height: 32px !important;
        font-size: 0.875rem !important;
    }

    .calendario-titulo {
        font-size: 1.1rem !important;
    }

    .dia-semana {
        font-size: 0.65rem !important;
        padding: 0.3rem 0.1rem !important;
    }

    .calendario-dias .calendario-dia,
    .calendario-dias .calendario-dia.con-eventos {
        height: 48px !important;
        max-height: 48px !important;
        min-height: 48px !important;
        padding: 0.15rem 0.1rem !important;
        justify-content: flex-start !important;
        gap: 0.1rem !important;
        background: #ffffff !important;
        border-right: 1px solid #e5e7eb !important;
        border-bottom: 1px solid #e5e7eb !important;
        border-radius: 0 !important;
        margin: 0 !important;
    }

    .calendario-dias .calendario-dia .numero-dia {
        font-size: 0.7rem !important;
        margin: 0 !important;
        line-height: 1 !important;
        flex-shrink: 0 !important;
        height: auto !important;
        min-height: auto !important;
    }

    .calendario-dias .calendario-dia .eventos-del-dia {
        max-height: 26px !important;
        gap: 1px !important;
        padding: 0 1px !important;
        margin-top: 0.1rem !important;
        width: 100% !important;
        flex: 1 !important;
        justify-content: flex-end !important;
    }

    .calendario-dias .calendario-dia .evento-calendario {
        height: 11px !important;
        max-height: 11px !important;
        font-size: 0.5rem !important;
        padding: 0.05rem 0.15rem !important;
        gap: 0.1rem !important;
        border-radius: 3px !important;
        font-weight: 500 !important;
    }

    .calendario-dias .calendario-dia .evento-dot {
        width: 2px !important;
        height: 2px !important;
    }

    .calendario-dias .calendario-dia .contador-eventos-adicionales {
        padding: 1px 4px !important;
        font-size: 0.55rem !important;
        border-radius: 4px !important;
        margin-top: 1px !important;
        background: #1f2937 !important;
        min-width: 18px !important;
        height: 12px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        font-weight: 600 !important;
        line-height: 1 !important;
    }

    .calendario-dias .calendario-dia .evento-titulo-mini {
        line-height: 1 !important;
        max-width: 100% !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }
}

/* FORZAR ESTRUCTURA DE GRID - REGLAS CRÍTICAS */
.calendario-dias>* {
    height: 80px !important;
    max-height: 80px !important;
    min-height: 80px !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
}

.calendario-dias .calendario-dia * {
    max-width: 100% !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

/* ANIMACIONES */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.calendario-container {
    animation: fadeInUp 0.3s ease-out;
}

.evento-calendario {
    animation: fadeInUp 0.2s ease-out;
}

.contador-eventos-adicionales {
    animation: fadeInUp 0.3s ease-out;
}

/* OVER
RIDE BRUTAL FINAL - MOBILE */
@media (max-width: 480px) {

    /* ELIMINAR AZUL - ÚLTIMA PALABRA */
    body .calendario-dia.hoy,
    body div.hoy,
    body [class*="hoy"] {
        background: #ffffff !important;
        background-color: #ffffff !important;
        background-image: none !important;
        border: 0.5px solid #e5e7eb !important;
        box-shadow: none !important;
    }

    /* ELIMINAR ESPACIOS - ÚLTIMA PALABRA */
    body .calendario-dias,
    body [class*="calendario-dias"] {
        gap: 0 !important;
        grid-gap: 0 !important;
        padding: 0 !important;
    }
}