/* ============================================================
   1. PERSONALIZACIÓN DE FULLCALENDAR (Estilos del Calendario)
   ============================================================ */

/* Variables CSS para facilitar cambios de color */
.fc {
    /* --- Botones de navegación (Hoy, Mes, Semana) --- */
    --fc-button-bg-color: #8ebb1f;
    --fc-button-border-color: #8ebb1f;
    --fc-button-hover-bg-color: #18375C;
    --fc-button-hover-border-color: #18375C;
    --fc-button-active-bg-color: #18375C;
    --fc-button-active-border-color: #18375C;

    /* --- Tabla y Días --- */
    --fc-today-bg-color: #eff9dc;     /* Color de fondo del día actual */
    --fc-border-color: #ddd;          /* Color de las líneas de la cuadrícula */
    --fc-page-bg-color: #ffffff;      /* Fondo general */

    /* --- Eventos por defecto --- */
    --fc-event-bg-color: #18375C;
    --fc-event-border-color: #3788d8;
}

/* Forzar estilos de los eventos (Items dentro del calendario) */
.fc-event {
    border: 1px solid transparent !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    font-size: 0.85em;
    cursor: pointer;
    transition: transform 0.1s;
}

.fc-event:hover {
    transform: scale(1.02); /* Efecto zoom leve al pasar mouse */
}

/* Título del mes (Ej: ENERO 2026) */
.fc .fc-toolbar-title {
    color: #18375C !important;
    font-size: 1.75em !important;
    text-transform: uppercase;
    font-weight: 800;
    letter-spacing: 1px;
}

/* Cabecera de los días (DOM, LUN, MAR...) */
.fc .fc-col-header-cell-cushion {
    color: #555;
    text-decoration: none;
    text-transform: uppercase;
    font-size: 0.9em;
    padding: 10px 0;
    font-weight: 700;
}

/* Números de los días */
.fc .fc-daygrid-day-number {
    color: #18375C;
    text-decoration: none;
    padding: 8px;
    font-weight: 600;
}

/* Color del texto de botones primarios a blanco */
.fc .fc-button-primary {
    color: #fff !important;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ============================================================
   2. FORMULARIO DE CREACIÓN DE EVENTOS (Estilo Unificado)
   ============================================================ */

.company-calendar-form {
    background: #ffffff;
    padding: 30px;
    border-radius: 12px;
    
    /* Configuración de tamaño y centrado */
    margin: 20px auto; 
    max-width: 600px; /* Ancho máximo para que parezca una tarjeta */
    width: 100%;
    
    /* Sombra y Borde */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08); 
    border: 1px solid #e1e1e1;
    
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    box-sizing: border-box;
}

/* Título del Formulario */
.company-calendar-form h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #18375C;
    text-align: center;
    font-weight: 700;
    font-size: 1.5em;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 15px;
}

/* Grupos de inputs */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #34495e;
    font-size: 0.95em;
}

/* Estilos de Inputs y Textareas */
.company-calendar-form input[type="text"],
.company-calendar-form input[type="datetime-local"],
.company-calendar-form input[type="password"],
.company-calendar-form textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #dfe6e9;
    border-radius: 6px;
    background: #fdfdfd;
    box-sizing: border-box; /* Importante para no romper el ancho */
    font-size: 14px;
    color: #333;
    transition: border 0.3s, box-shadow 0.3s;
}

.company-calendar-form input:focus,
.company-calendar-form textarea:focus {
    border-color: #8EBB1F;
    box-shadow: 0 0 0 3px rgba(142, 187, 31, 0.2);
    outline: none;
    background: #fff;
}

/* Caja especial para el Video Beam */
.video-beam-group {
    background: #e3f2fd;
    padding: 15px;
    border-left: 4px solid #2196F3;
    border-radius: 4px;
    margin-top: 10px;
}

.video-beam-group label {
    display: flex !important;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    color: #0d47a1;
    margin: 0 !important;
}

/* Caja de Autenticación (PIN) */
.auth-box {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px dashed #ccc;
}

/* Botón de Enviar */
.submit-btn {
    width: 100%;
    background: #8EBB1F !important;
    color: white;
    padding: 14px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    text-transform: uppercase;
    margin-top: 20px;
    transition: background 0.3s, transform 0.1s;
}

.submit-btn:hover {
    background: #7ba11b !important;
}

.submit-btn:disabled {
    background: #ccc !important;
    cursor: not-allowed;
}

/* Mensajes de error/éxito */
#form-message {
    text-align: center;
    padding: 10px;
    border-radius: 4px;
    font-size: 0.9em;
}

/* ============================================================
   3. VENTANAS MODALES (Pop-ups de detalle y PIN)
   ============================================================ */

.custom-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6); /* Fondo oscuro semitransparente */
    display: none; /* Oculto por defecto */
    justify-content: center;
    align-items: center;
    z-index: 99999; /* Por encima de todo, incluido menú de WP */
    backdrop-filter: blur(2px); /* Efecto borroso de fondo moderno */
}

.modal-box {
    background: white;
    padding: 30px;
    width: 400px;
    max-width: 90%;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    font-family: sans-serif;
    position: relative;
    animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

.modal-box h2, 
.modal-box h3 {
    margin-top: 0;
    color: #2c3e50;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

/* Inputs dentro del modal */
.modal-input {
    width: 100%;
    padding: 10px;
    margin-top: 15px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    font-size: 16px;
    text-align: center;
    letter-spacing: 2px;
}

/* Botones del Modal */
.modal-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 25px;
}

.modal-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    color: white;
    font-weight: bold;
    font-size: 14px;
    transition: background 0.2s;
}

/* Clases de utilidad para colores de botones */
.gray { background: #95a5a6; }
.gray:hover { background: #7f8c8d; }

.red { background: #e74c3c; }
.red:hover { background: #c0392b; }

.blue { background: #3498db; }
.blue:hover { background: #2980b9; }

/* ============================================================
   4. LAYOUT RESPONSIVO (Opcional para columnas)
   ============================================================ */

/* Usar estas clases si quieres poner Calendario y Formulario lado a lado */
.calendar-layout-container {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
    align-items: flex-start;
}

.calendar-column {
    flex: 1;
    min-width: 300px;
}

.form-column {
    flex: 0 0 450px; /* Ancho fijo para la columna del formulario */
    max-width: 100%;
}

@media (max-width: 900px) {
    .calendar-layout-container {
        flex-direction: column;
    }
    .form-column {
        flex: 1;
        width: 100%;
        max-width: 100%;
    }
}