/**
 * Layout Fixes - Psicóloga Rocío De Luna
 * Soluciona problemas de responsividad y traslape mapa/formulario
 */

/* ==========================================================================
   1. NAVBAR FIJO - Padding para evitar que tape contenido
   ========================================================================== */

/* Compensar altura del navbar cuando está fijo */
body {
    padding-top: 0;
}

/* Cuando el navbar está en modo scrolled (fijo) */
.ftco-navbar-light.scrolled.awake {
    margin-top: 0 !important;
}

/* Agregar espacio en secciones para navbar fijo */
section[id] {
    scroll-margin-top: 100px;
}

/* Padding extra para la primera sección después del hero */
.ftco-section:first-of-type {
    padding-top: 80px;
}

/* ==========================================================================
   2. SECCIÓN DE CONTACTO - Arreglo de layout mapa/formulario
   ========================================================================== */

/* Contenedor principal del formulario de contacto */
#contácto .wrapper {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

#contácto .wrapper .row {
    margin: 0;
}

/* Formulario */
#contácto .contact-wrap {
    padding: 30px !important;
}

@media (min-width: 768px) {
    #contácto .contact-wrap {
        padding: 40px !important;
    }
}

/* Contenedor del mapa */
#contácto .col-md-5 {
    padding: 0 !important;
    min-height: 400px;
    position: relative;
}

/* Iframe del mapa - responsive */
#contácto iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    min-height: 400px;
    border: 0 !important;
}

/* ==========================================================================
   3. MOBILE RESPONSIVE - 1 columna para formulario y mapa
   ========================================================================== */

@media (max-width: 767.98px) {
    /* Sección de contacto en móvil */
    #contácto .wrapper .row {
        flex-direction: column;
    }
    
    /* Formulario primero */
    #contácto .col-md-7 {
        order: 1;
        width: 100%;
        max-width: 100%;
        flex: 0 0 100%;
    }
    
    /* Mapa después */
    #contácto .col-md-5 {
        order: 2;
        width: 100%;
        max-width: 100%;
        flex: 0 0 100%;
        min-height: 300px;
        position: relative;
    }
    
    /* Mapa en móvil */
    #contácto iframe {
        position: relative;
        height: 300px !important;
        min-height: 300px;
    }
    
    /* Padding reducido en formulario móvil */
    #contácto .contact-wrap {
        padding: 20px !important;
    }
    
    /* Títulos del formulario */
    #contácto h3.mb-4 {
        font-size: 1.3rem;
        margin-bottom: 15px !important;
    }
    
    #contácto h4.mb-4 {
        font-size: 1.1rem;
    }
    
    /* Campos del formulario */
    #contácto .form-control {
        font-size: 16px; /* Evita zoom en iOS */
    }
}

/* ==========================================================================
   4. FORMULARIO - Espaciado consistente
   ========================================================================== */

/* Grupos de formulario */
#contácto .form-group {
    margin-bottom: 20px;
}

/* Labels */
#contácto .form-group .label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

/* Inputs */
#contácto .form-control {
    height: 48px !important;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    transition: border-color 0.3s ease;
}

#contácto .form-control:focus {
    border-color: #B68384;
    box-shadow: 0 0 0 3px rgba(182, 131, 132, 0.1);
}

/* Textarea */
#contácto textarea.form-control {
    height: auto !important;
    min-height: 100px;
    resize: vertical;
}

/* Botón enviar */
#contácto .btn-primary {
    background: #B68384;
    border-color: #B68384;
    padding: 12px 30px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
}

#contácto .btn-primary:hover {
    background: #9e2a2a;
    border-color: #9e2a2a;
    transform: translateY(-2px);
}

/* ==========================================================================
   5. DESKTOP - Mejoras adicionales
   ========================================================================== */

@media (min-width: 992px) {
    /* Asegurar que no haya traslape en desktop */
    #contácto .col-md-7 {
        flex: 0 0 58.333333%;
        max-width: 58.333333%;
    }
    
    #contácto .col-md-5 {
        flex: 0 0 41.666667%;
        max-width: 41.666667%;
        min-height: 500px;
    }
    
    /* Mapa altura completa en desktop */
    #contácto iframe {
        min-height: 100%;
    }
}

/* ==========================================================================
   6. TABLET - Ajustes intermedios
   ========================================================================== */

@media (min-width: 768px) and (max-width: 991.98px) {
    #contácto .col-md-7,
    #contácto .col-md-5 {
        flex: 0 0 100%;
        max-width: 100%;
    }
    
    #contácto .col-md-5 {
        min-height: 350px;
    }
    
    #contácto iframe {
        position: relative;
        height: 350px !important;
    }
}

/* ==========================================================================
   7. PREVENIR SCROLL HORIZONTAL
   ========================================================================== */

html, body {
    overflow-x: hidden;
    max-width: 100%;
}

.container, .container-fluid {
    overflow-x: hidden;
}

/* ==========================================================================
   8. ESTILOS PARA PÁGINA DE AGENDAR CITA
   ========================================================================== */

/* Contenedor del calendario */
.booking-calendar-container {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.1);
    padding: 30px;
    margin-bottom: 30px;
}

/* Leyenda del calendario */
.calendar-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 4px;
}

.calendar-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.legend-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
}

.legend-dot.available {
    background: #28a745;
}

.legend-dot.occupied {
    background: #dc3545;
}

.legend-dot.pending {
    background: #ffc107;
}

.legend-dot.blocked {
    background: #6c757d;
}

/* Modal de reserva */
.booking-modal .modal-header {
    background: #B68384;
    color: #fff;
}

.booking-modal .modal-header .close {
    color: #fff;
    opacity: 1;
}

.booking-modal .btn-primary {
    background: #B68384;
    border-color: #B68384;
}

.booking-modal .btn-primary:hover {
    background: #9e2a2a;
    border-color: #9e2a2a;
}

/* Estados del slot en el calendario */
.fc-event.slot-available {
    background-color: #28a745 !important;
    border-color: #28a745 !important;
    cursor: pointer;
}

.fc-event.slot-occupied {
    background-color: #dc3545 !important;
    border-color: #dc3545 !important;
    cursor: not-allowed;
}

.fc-event.slot-pending {
    background-color: #ffc107 !important;
    border-color: #ffc107 !important;
    color: #333 !important;
    cursor: not-allowed;
}

.fc-event.slot-blocked {
    background-color: #6c757d !important;
    border-color: #6c757d !important;
    cursor: not-allowed;
}

/* Responsive del calendario */
@media (max-width: 767.98px) {
    .booking-calendar-container {
        padding: 15px;
    }
    
    .fc .fc-toolbar {
        flex-direction: column;
        gap: 10px;
    }
    
    .fc .fc-toolbar-title {
        font-size: 1.2rem;
    }
    
    .calendar-legend {
        flex-direction: column;
        gap: 10px;
    }
}

/* ==========================================================================
   9. ADMIN PANEL STYLES
   ========================================================================== */

.admin-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.admin-header {
    background: #B68384;
    color: #fff;
    padding: 20px;
    margin-bottom: 30px;
    border-radius: 8px;
}

.admin-header h1 {
    margin: 0;
    font-size: 1.5rem;
}

.admin-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    padding: 20px;
    margin-bottom: 20px;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th,
.admin-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.admin-table th {
    background: #f8f9fa;
    font-weight: 600;
}

.admin-table tr:hover {
    background: #f8f9fa;
}

/* Status badges */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-pendiente {
    background: #fff3cd;
    color: #856404;
}

.status-confirmada {
    background: #d4edda;
    color: #155724;
}

.status-cancelada {
    background: #f8d7da;
    color: #721c24;
}

.status-bloqueada {
    background: #e2e3e5;
    color: #383d41;
}

/* Admin buttons */
.btn-admin {
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    border: none;
    cursor: pointer;
    margin-right: 5px;
    transition: opacity 0.3s ease;
}

.btn-admin:hover {
    opacity: 0.8;
}

.btn-confirm {
    background: #28a745;
    color: #fff;
}

.btn-cancel {
    background: #dc3545;
    color: #fff;
}

.btn-view {
    background: #17a2b8;
    color: #fff;
}

/* Login form */
.login-container {
    max-width: 400px;
    margin: 100px auto;
    padding: 40px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.1);
}

.login-container h2 {
    text-align: center;
    color: #B68384;
    margin-bottom: 30px;
}

.login-container .form-group {
    margin-bottom: 20px;
}

.login-container .btn-primary {
    width: 100%;
    background: #B68384;
    border-color: #B68384;
}

.login-container .btn-primary:hover {
    background: #9e2a2a;
    border-color: #9e2a2a;
}

/* Responsive admin */
@media (max-width: 767.98px) {
    .admin-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
    
    .admin-container {
        padding: 10px;
    }
}

/* ==========================================================================
   10. HONEYPOT ANTI-SPAM (oculto)
   ========================================================================== */

.hp-field {
    opacity: 0;
    position: absolute;
    top: 0;
    left: 0;
    height: 0;
    width: 0;
    z-index: -1;
    overflow: hidden;
}
