/* ============================================
   SISTEMA DE CITAS v3.2 - STYLE.CSS OPTIMIZADO
   Estilos mínimos necesarios para Tailwind CSS
   ============================================ */

/* ============================================
   MODALES FLOTANTES
   ============================================ */

/* Modal Overlay - Fondo oscuro y posición fija */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 1rem;
    overflow-y: auto;
}

/* Cuando el modal está visible */
.modal-overlay[style*="display: flex"] {
    display: flex !important;
}

/* Contenedor del modal */
.modal-content {
    position: relative;
    background-color: white;
    border-radius: 1rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    max-width: 600px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    padding: 1.5rem;
    animation: modalSlideIn 0.3s ease-out;
}

/* Animación de entrada */
@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Scroll suave en modales */
.modal-content::-webkit-scrollbar {
    width: 8px;
}

.modal-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
}

.modal-content::-webkit-scrollbar-thumb {
    background: rgba(8, 145, 178, 0.5);
    border-radius: 10px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: rgba(8, 145, 178, 0.8);
}

/* Responsive para móviles */
@media (max-width: 640px) {
    .modal-content {
        max-width: 95%;
        max-height: 90vh;
        padding: 1rem;
        margin: 0.5rem;
    }
    
    .modal-overlay {
        padding: 0.5rem;
    }

    /* Ocultar elementos no críticos en móvil */
    .hide-mobile {
        display: none !important;
    }
}

/* ============================================
   TABLA RESPONSIVE (TRANSFORMACIÓN A TARJETAS)
   ============================================ */
@media (max-width: 768px) {
    /* Escondemos el header de la tabla en móvil */
    .responsive-table thead {
        display: none;
    }

    .responsive-table, 
    .responsive-table tbody, 
    .responsive-table tr, 
    .responsive-table td {
        display: block;
        width: 100%;
    }

    .responsive-table tr {
        margin-bottom: 1rem;
        border: 1px solid #e5e7eb;
        border-radius: 0.75rem;
        padding: 0.5rem;
        background: white;
        box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    }

    .responsive-table td {
        text-align: right;
        padding: 0.5rem 1rem;
        position: relative;
        border-bottom: 1px solid #f3f4f6;
    }

    .responsive-table td:last-child {
        border-bottom: none;
        text-align: center;
        padding-top: 1rem;
    }

    /* Añadimos etiquetas automáticas para saber qué es cada dato */
    .responsive-table td::before {
        content: attr(data-label);
        position: absolute;
        left: 1rem;
        width: 45%;
        text-align: left;
        font-weight: 700;
        color: #6b7280;
        font-size: 0.75rem;
        text-transform: uppercase;
    }
}

/* ============================================
   TARJETAS DE ESTADÍSTICAS
   ============================================ */

/* Texto visible en tarjetas de estadísticas */
.stat-card p {
    color: #6b7280 !important;
}

.stat-card #totalCitas {
    color: #1f2937 !important;
}

.stat-card #citasConfirmadas {
    color: #059669 !important;
}

.stat-card #citasCanceladas {
    color: #dc2626 !important;
}

.stat-card #citasHoy {
    color: #9333ea !important;
}

.stat-card {
    background-color: #ffffff !important;
}

/* ============================================
   BOTONES Y CONTROLES
   ============================================ */

/* Botones de filtro - Contraste mejorado */
.filter-btn {
    color: #374151 !important;
    font-weight: 600 !important;
    transition: all 0.3s ease;
}

.filter-btn.active {
    background-color: #0891b2 !important;
    color: #ffffff !important;
}

.filter-btn:hover {
    background-color: #e5e7eb !important;
    color: #1f2937 !important;
}

/* Select de ordenamiento */
#sortOrder,
select {
    color: #1f2937 !important;
    font-weight: 500 !important;
}

/* Input de búsqueda */
#searchInput,
input[type="text"],
input[type="search"] {
    color: #1f2937 !important;
    font-weight: 500 !important;
}

/* Placeholder visible */
input::placeholder,
select::placeholder {
    color: #9ca3af !important;
    opacity: 1;
}

/* Opciones del select */
select option {
    color: #1f2937 !important;
    background-color: #ffffff !important;
}

/* ============================================
   FULLCALENDAR - PERSONALIZACIÓN
   ============================================ */

/* Título del mes */
.fc .fc-toolbar-title {
    color: #1f2937 !important;
    font-weight: 700 !important;
    font-size: 1.5rem !important;
}

/* Botones del calendario */
.fc .fc-button {
    color: #1f2937 !important;
    font-weight: 600 !important;
}

.fc .fc-button-primary {
    background-color: #0891b2 !important;
    border-color: #0891b2 !important;
    color: #ffffff !important;
}

.fc .fc-button-primary:hover {
    background-color: #0e7490 !important;
    border-color: #0e7490 !important;
}

/* Días de la semana - Degradado Cyan Médico */
.fc .fc-col-header {
    background: linear-gradient(135deg, #0891b2 0%, #0e7490 100%) !important;
    border-radius: 10px 10px 0 0;
    overflow: hidden;
}

.fc .fc-col-header-cell {
    background: transparent !important;
    padding: 12px 0 !important;
}

.fc .fc-col-header-cell-cushion {
    color: #ffffff !important;
    font-weight: 700 !important;
    font-size: 0.95rem !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 8px 0;
}

/* Números de los días */
.fc .fc-daygrid-day-number {
    color: #1f2937 !important;
    font-weight: 600 !important;
    font-size: 0.9rem !important;
}

/* Día actual destacado */
.fc .fc-day-today {
    background-color: rgba(8, 145, 178, 0.1) !important;
}

.fc .fc-day-today .fc-daygrid-day-number {
    color: #0891b2 !important;
    font-weight: 700 !important;
}

/* Bordes suaves */
.fc-theme-standard td,
.fc-theme-standard th {
    border-color: #e5e7eb !important;
}

/* Eventos */
.fc-daygrid-event {
    font-weight: 600 !important;
    padding: 4px 6px !important;
}

/* Contenedor del calendario */
#calendar {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Vista de semana y día */
.fc .fc-timegrid-axis-cushion,
.fc .fc-timegrid-slot-label-cushion {
    color: #1f2937 !important;
    font-weight: 600 !important;
}

/* Vista de lista */
.fc-list-day-cushion {
    background: linear-gradient(135deg, #0891b2 0%, #0e7490 100%) !important;
    color: #ffffff !important;
    font-weight: 700 !important;
}

/* ============================================
   WHATSAPP FLOATING WIDGET (ASSISTANT)
   ============================================ */
.whatsapp-assistant-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.whatsapp-assistant-btn {
    width: 65px;
    height: 65px;
    background: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 32px;
    box-shadow: 0 10px 25px rgba(37, 211, 102, 0.4);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: none;
    outline: none;
    animation: pushUpWidget 0.8s ease-out;
    position: relative;
}

.whatsapp-assistant-btn:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 15px 35px rgba(37, 211, 102, 0.6);
}

.whatsapp-assistant-tooltip {
    background-color: #1f2937;
    color: white;
    padding: 10px 18px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    white-space: nowrap;
    position: relative;
    border: 1px solid rgba(255,255,255,0.1);
}

.whatsapp-assistant-tooltip::after {
    content: '';
    position: absolute;
    bottom: -8px;
    right: 25px;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid #1f2937;
}

.whatsapp-assistant-container:hover .whatsapp-assistant-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.assistant-pulse {
    position: absolute;
    width: 100%;
    height: 100%;
    background-color: #25d366;
    border-radius: 50%;
    z-index: -1;
    opacity: 0.7;
    animation: assistantPulse 2s infinite;
}

@keyframes assistantPulse {
    0% { transform: scale(1); opacity: 0.5; }
    100% { transform: scale(1.5); opacity: 0; }
}

@keyframes pushUpWidget {
    0% { transform: translateY(100px) scale(0); opacity: 0; }
    60% { transform: translateY(-10px) scale(1.1); }
    100% { transform: translateY(0) scale(1); opacity: 1; }
}

/* Efecto 'Live' para el asistente */
.assistant-status-dot {
    position: absolute;
    bottom: 5px;
    right: 5px;
    width: 14px;
    height: 14px;
    background-color: #22c55e;
    border: 2px solid white;
    border-radius: 50%;
}