﻿/* Estilos personalizados para dropdowns y/o selects de formularios */

.custom-select {
    position: relative;
    display: block;
    width: 100%;
}

    .custom-select .custom-select-button {
        border: 2px solid #E9ECEF;
        border-radius: 8px;
        padding: 0.5rem 2rem 0.5rem 1rem;
        background-color: #F8F9FA;
        font-size: 14px;
        font-weight: 500;
        color: #495057;
        cursor: pointer;
        position: relative;
        min-width: 80px;
        width: 100%;
        text-align: left;
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        user-select: none;
        -webkit-tap-highlight-color: transparent;
    }

        .custom-select .custom-select-button:after {
            content: '▼';
            position: absolute;
            right: 8px;
            top: 50%;
            transform: translateY(-50%);
            font-size: 10px;
            color: #495057;
        }

        .custom-select .custom-select-button:hover {
            border-color: #E27AB0 !important;
            box-shadow: 0 0 0 0.2rem rgba(226, 122, 176, 0.25) !important;
        }

    .custom-select .custom-select-menu {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        border: 2px solid #E27AB0;
        border-radius: 8px;
        box-shadow: 0 4px 12px rgba(0,0,0,0.15);
        z-index: 1000;
        display: none;
        max-height: 200px;
        overflow-y: auto;
    }

        .custom-select .custom-select-menu.show {
            display: block;
        }

    .custom-select .custom-select-item {
        padding: 0.5rem 1rem;
        cursor: pointer;
        font-size: 14px;
        font-weight: 500;
        color: #495057;
        border-bottom: 1px solid #F8F9FA;
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        user-select: none;
        -webkit-tap-highlight-color: transparent;
    }

        .custom-select .custom-select-item:last-child {
            border-bottom: none;
        }

        .custom-select .custom-select-item:hover {
            background-color: #F8E5ED;
            color: #E27AB0;
        }

        .custom-select .custom-select-item.active {
            background-color: #E27AB0;
            color: white;
        }

/* Ocultar los selects originales*/
select.form-control.custom-hidden,
select.form-select.custom-hidden {
    opacity: 0 !important;
    position: absolute !important;
    pointer-events: none !important;
    width: 100% !important;
    left: 0;
    top: 0;
}

/* === ESTILOS PARA SELECTORES DE FECHA PERSONALIZADOS === */

/* Contenedor principal del selector */
.custom-datepicker {
    position: relative;
    display: block;
    width: 100%;
}

    /* El botón que simula ser un input */
    .custom-datepicker .datepicker-input {
        border: 2px solid #E9ECEF;
        border-radius: 8px;
        padding: 0.75rem 2rem 0.75rem 1rem;
        background-color: #F8F9FA;
        font-size: 14px;
        font-weight: 500;
        color: #495057;
        cursor: pointer;
        position: relative;
        min-width: 80px;
        width: 100%;
        text-align: left;
        display: flex;
        align-items: center;
        justify-content: space-between;
        transition: all 0.3s ease;
        /* Desactivar selección de texto */
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        user-select: none;
        -webkit-tap-highlight-color: transparent;
    }

        /* Icono del calendario dentro del botón */
        .custom-datepicker .datepicker-input .calendar-icon {
            font-size: 16px;
            color: #495057;
            pointer-events: none;
            transition: color 0.3s ease;
        }

        /* Efecto hover del botón */
        .custom-datepicker .datepicker-input:hover {
            border-color: #E27AB0;
            box-shadow: 0 0 0 0.2rem rgba(226, 122, 176, 0.25);
        }

            .custom-datepicker .datepicker-input:hover .calendar-icon {
                color: #E27AB0;
            }

    /* El calendario flotante */
    .custom-datepicker .datepicker-calendar {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        border: 2px solid #E27AB0;
        border-radius: 8px;
        box-shadow: 0 4px 12px rgba(0,0,0,0.15);
        z-index: 1000;
        display: none !important;
        max-height: 350px;
        overflow-y: auto;
    }

        /* Calendario visible */
        .custom-datepicker .datepicker-calendar.show {
            display: block !important;
        }

/* === ESTILOS DEL CALENDARIO === */

/* Cabecera del calendario (mes y año) */
.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid #F8F9FA;
    background-color: #F8F9FA;
}

/* Contenedor del título (mes y año) */
.calendar-title {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    justify-content: center;
    flex: 1;
}

/* Cada parte del título (mes o año) */
.calendar-title-part {
    font-weight: 600;
    color: #333;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    position: relative;
    transition: all 0.3s ease;
}

    /* Efecto hover en las partes del título */
    .calendar-title-part:hover {
        background-color: #F8E5ED;
        color: #E27AB0;
    }

/* Menús desplegables (dropdowns) */
.calendar-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border: 1px solid #E27AB0;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    z-index: 1001;
    display: none;
    max-height: 200px;
    overflow-y: auto;
    min-width: 120px;
}

    /* Dropdown visible */
    .calendar-dropdown.show {
        display: block;
    }

/* Items dentro de los dropdowns */
.calendar-dropdown-item {
    padding: 0.5rem 1rem;
    cursor: pointer;
    font-size: 14px;
    color: #495057;
    transition: all 0.3s ease;
}

    /* Efecto hover en items del dropdown */
    .calendar-dropdown-item:hover {
        background-color: #F8E5ED;
        color: #E27AB0;
    }

    /* Item seleccionado en el dropdown */
    .calendar-dropdown-item.selected {
        background-color: #E27AB0;
        color: white;
    }

/* Grilla del calendario (7 columnas para los días) */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background-color: #F8F9FA;
    padding: 1px;
}

/* Cabeceras de los días (Lun, Mar, Mié, etc.) */
.calendar-day-header {
    padding: 0.5rem;
    text-align: center;
    font-weight: 600;
    font-size: 12px;
    color: #666;
    background-color: #F8F9FA;
}

/* Cada día del calendario */
.calendar-day {
    padding: 0.5rem;
    text-align: center;
    cursor: pointer;
    background-color: white;
    font-size: 14px;
    min-height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

    /* Efecto hover en los días */
    .calendar-day:hover {
        background-color: #F8E5ED;
        color: #E27AB0;
    }

    /* Días de otros meses (grises) */
    .calendar-day.other-month {
        color: #ccc;
    }

    /* Día seleccionado */
    .calendar-day.selected {
        background-color: #E27AB0;
        color: white;
    }

    /* Día actual */
    .calendar-day.today {
        background-color: #E9ECEF !important;
        color: #333 !important;
        font-weight: 600;
        border: 2px solid #DEE2E6;
        box-shadow: 0 2px 4px rgba(233, 236, 239, 0.5);
    }

/* Responsive */
@media (max-width: 768px) {
    .calendar-grid {
        font-size: 12px;
    }

    .calendar-day {
        min-height: 30px;
        padding: 0.25rem;
    }
}
/* Asegurar que los campos normales mantengan sus estilos originales */
.form-control:not(.custom-datepicker, .datepicker-input) {
    border: 1px solid #ced4da !important;
    transition: none !important;
}

    .form-control:not(.custom-datepicker, .datepicker-input):focus {
        border-color: #80bdff !important;
        box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25) !important;
    }

/* El calendario flotante */
.custom-datepicker .datepicker-calendar {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 2px solid #E27AB0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1000;
    display: none !important;
    max-height: 350px;
    overflow-y: auto;
}

    /* Calendario visible */
    .custom-datepicker .datepicker-calendar.show {
        display: block !important;
    }