/**
 * Estilos del Calendario de Reservas - Saby Eventos
 * Diseño elegante y profesional para servicios de bodas
 */

/* ========== VARIABLES CSS ========== */
:root {
    --saby-primary: #667eea;
    --saby-secondary: #764ba2;
    --saby-accent: #f093fb;
    --saby-success: #4ecdc4;
    --saby-warning: #ffe066;
    --saby-error: #ff6b6b;
    --saby-text-dark: #2c3e50;
    --saby-text-light: #7f8c8d;
    --saby-border: #e1e8ed;
    --saby-background: #f8f9fa;
    --saby-white: #ffffff;
    --saby-shadow: 0 4px 20px rgba(102, 126, 234, 0.15);
    --saby-shadow-hover: 0 8px 30px rgba(102, 126, 234, 0.25);
    --saby-radius: 12px;
    --saby-radius-small: 6px;
    --saby-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ========== CONTENEDOR PRINCIPAL ========== */
.saby-calendar-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--saby-background) 0%, var(--saby-white) 100%);
    min-height: 100vh;
}

.saby-calendar-header {
    text-align: center;
    margin-bottom: 3rem;
    padding: 2rem;
    background: linear-gradient(135deg, var(--saby-primary) 0%, var(--saby-secondary) 100%);
    color: var(--saby-white);
    border-radius: var(--saby-radius);
    box-shadow: var(--saby-shadow);
}

.saby-calendar-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.saby-calendar-subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    font-weight: 300;
}

/* ========== LAYOUT PRINCIPAL ========== */
.saby-calendar-layout {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 2rem;
    align-items: start;
}

@media (max-width: 968px) {
    .saby-calendar-layout {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

/* ========== CALENDARIO ========== */
.saby-calendar-widget {
    background: var(--saby-white);
    border-radius: var(--saby-radius);
    box-shadow: var(--saby-shadow);
    overflow: hidden;
    transition: var(--saby-transition);
}

.saby-calendar-widget:hover {
    box-shadow: var(--saby-shadow-hover);
}

.saby-calendar-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    background: linear-gradient(90deg, var(--saby-primary) 0%, var(--saby-secondary) 100%);
    color: var(--saby-white);
}

.saby-calendar-nav-button {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: var(--saby-white);
    padding: 0.75rem 1rem;
    border-radius: var(--saby-radius-small);
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: var(--saby-transition);
}

.saby-calendar-nav-button:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.saby-calendar-nav-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.saby-calendar-month-year {
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.saby-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: var(--saby-white);
}

.saby-calendar-header-day {
    padding: 1rem 0.5rem;
    text-align: center;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--saby-text-light);
    background: var(--saby-background);
    border-bottom: 1px solid var(--saby-border);
}

.saby-calendar-day {
    position: relative;
    padding: 1rem 0.5rem;
    text-align: center;
    border-bottom: 1px solid var(--saby-border);
    border-right: 1px solid var(--saby-border);
    min-height: 80px;
    cursor: pointer;
    transition: var(--saby-transition);
    background: var(--saby-white);
}

.saby-calendar-day:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
}

.saby-calendar-day.other-month {
    color: var(--saby-text-light);
    background: var(--saby-background);
    opacity: 0.5;
}

.saby-calendar-day.today {
    background: linear-gradient(135deg, var(--saby-primary) 0%, var(--saby-secondary) 100%);
    color: var(--saby-white);
    font-weight: 600;
}

.saby-calendar-day.selected {
    background: linear-gradient(135deg, var(--saby-accent) 0%, var(--saby-primary) 100%);
    color: var(--saby-white);
    font-weight: 600;
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.3);
}

.saby-calendar-day.has-bookings {
    background: linear-gradient(135deg, var(--saby-warning) 0%, #f39c12 100%);
    color: var(--saby-white);
}

.saby-calendar-day.unavailable {
    background: repeating-linear-gradient(
        45deg,
        var(--saby-error),
        var(--saby-error) 10px,
        rgba(255, 107, 107, 0.7) 10px,
        rgba(255, 107, 107, 0.7) 20px
    );
    color: var(--saby-white);
    cursor: not-allowed;
}

.saby-calendar-day-number {
    font-size: 1.125rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.saby-calendar-day-indicator {
    position: absolute;
    bottom: 0.5rem;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--saby-success);
}

/* ========== PANEL DE HORARIOS ========== */
.saby-time-slots-panel {
    background: var(--saby-white);
    border-radius: var(--saby-radius);
    box-shadow: var(--saby-shadow);
    overflow: hidden;
    position: sticky;
    top: 2rem;
}

.saby-time-slots-header {
    padding: 1.5rem;
    background: linear-gradient(135deg, var(--saby-secondary) 0%, var(--saby-primary) 100%);
    color: var(--saby-white);
    text-align: center;
}

.saby-time-slots-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.saby-selected-date {
    font-size: 0.95rem;
    opacity: 0.9;
}

.saby-time-slots-content {
    padding: 1.5rem;
    max-height: 500px;
    overflow-y: auto;
}

.saby-time-section {
    margin-bottom: 2rem;
}

.saby-time-section:last-child {
    margin-bottom: 0;
}

.saby-time-section-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--saby-text-dark);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--saby-border);
    display: flex;
    align-items: center;
}

.saby-time-section-title::before {
    content: '';
    width: 4px;
    height: 20px;
    background: linear-gradient(to bottom, var(--saby-primary), var(--saby-secondary));
    margin-right: 0.75rem;
    border-radius: 2px;
}

.saby-time-slots-grid {
    display: grid;
    gap: 0.75rem;
}

.saby-time-slot {
    padding: 1rem 1.25rem;
    border: 2px solid var(--saby-border);
    border-radius: var(--saby-radius-small);
    text-align: center;
    cursor: pointer;
    transition: var(--saby-transition);
    font-weight: 500;
    position: relative;
    overflow: hidden;
}

.saby-time-slot::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(102, 126, 234, 0.1), transparent);
    transition: left 0.5s ease;
}

.saby-time-slot:hover::before {
    left: 100%;
}

.saby-time-slot:hover {
    border-color: var(--saby-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.2);
}

.saby-time-slot.available {
    border-color: var(--saby-success);
    color: var(--saby-success);
    background: rgba(78, 205, 196, 0.05);
}

.saby-time-slot.available:hover {
    background: var(--saby-success);
    color: var(--saby-white);
    border-color: var(--saby-success);
}

.saby-time-slot.selected {
    background: linear-gradient(135deg, var(--saby-primary) 0%, var(--saby-secondary) 100%);
    color: var(--saby-white);
    border-color: var(--saby-primary);
    transform: scale(1.02);
}

.saby-time-slot.unavailable {
    border-color: var(--saby-error);
    color: var(--saby-error);
    background: rgba(255, 107, 107, 0.05);
    cursor: not-allowed;
    opacity: 0.6;
}

.saby-time-slot.unavailable:hover {
    transform: none;
    box-shadow: none;
}

/* ========== FORMULARIO DE RESERVA ========== */
.saby-booking-form {
    background: var(--saby-white);
    border-radius: var(--saby-radius);
    box-shadow: var(--saby-shadow);
    padding: 2rem;
    margin-top: 1.5rem;
    opacity: 0;
    transform: translateY(20px);
    transition: var(--saby-transition);
}

.saby-booking-form.visible {
    opacity: 1;
    transform: translateY(0);
}

.saby-booking-form-header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--saby-border);
}

.saby-booking-form-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--saby-text-dark);
    margin-bottom: 0.5rem;
}

.saby-booking-form-subtitle {
    color: var(--saby-text-light);
    font-size: 0.95rem;
}

.saby-form-group {
    margin-bottom: 1.5rem;
}

.saby-form-label {
    display: block;
    font-weight: 600;
    color: var(--saby-text-dark);
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.saby-form-label.required::after {
    content: ' *';
    color: var(--saby-error);
}

.saby-form-input,
.saby-form-select,
.saby-form-textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid var(--saby-border);
    border-radius: var(--saby-radius-small);
    font-size: 1rem;
    transition: var(--saby-transition);
    background: var(--saby-white);
}

.saby-form-input:focus,
.saby-form-select:focus,
.saby-form-textarea:focus {
    outline: none;
    border-color: var(--saby-primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.saby-form-textarea {
    resize: vertical;
    min-height: 100px;
}

.saby-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 768px) {
    .saby-form-row {
        grid-template-columns: 1fr;
    }
}

/* ========== BOTONES ========== */
.saby-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.875rem 2rem;
    border: none;
    border-radius: var(--saby-radius-small);
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: var(--saby-transition);
    position: relative;
    overflow: hidden;
}

.saby-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.saby-btn:hover::before {
    width: 300px;
    height: 300px;
}

.saby-btn-primary {
    background: linear-gradient(135deg, var(--saby-primary) 0%, var(--saby-secondary) 100%);
    color: var(--saby-white);
}

.saby-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.saby-btn-secondary {
    background: var(--saby-border);
    color: var(--saby-text-dark);
}

.saby-btn-secondary:hover {
    background: var(--saby-text-light);
    color: var(--saby-white);
}

.saby-btn-success {
    background: linear-gradient(135deg, var(--saby-success) 0%, #26d0ce 100%);
    color: var(--saby-white);
}

.saby-btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(78, 205, 196, 0.3);
}

.saby-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.saby-btn-full {
    width: 100%;
}

/* ========== LOADING STATES ========== */
.saby-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: var(--saby-text-light);
}

.saby-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--saby-border);
    border-top: 4px solid var(--saby-primary);
    border-radius: 50%;
    animation: saby-spin 1s linear infinite;
    margin-right: 1rem;
}

@keyframes saby-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ========== MENSAJES ========== */
.saby-message {
    padding: 1rem 1.25rem;
    border-radius: var(--saby-radius-small);
    margin-bottom: 1rem;
    font-weight: 500;
    display: flex;
    align-items: center;
}

.saby-message::before {
    content: '';
    width: 20px;
    height: 20px;
    border-radius: 50%;
    margin-right: 0.75rem;
    flex-shrink: 0;
}

.saby-message-success {
    background: rgba(78, 205, 196, 0.1);
    color: var(--saby-success);
    border: 1px solid rgba(78, 205, 196, 0.3);
}

.saby-message-success::before {
    background: var(--saby-success);
}

.saby-message-error {
    background: rgba(255, 107, 107, 0.1);
    color: var(--saby-error);
    border: 1px solid rgba(255, 107, 107, 0.3);
}

.saby-message-error::before {
    background: var(--saby-error);
}

.saby-message-warning {
    background: rgba(255, 224, 102, 0.1);
    color: var(--saby-warning);
    border: 1px solid rgba(255, 224, 102, 0.3);
}

.saby-message-warning::before {
    background: var(--saby-warning);
}

/* ========== LEYENDA ========== */
.saby-calendar-legend {
    background: var(--saby-white);
    border-radius: var(--saby-radius);
    box-shadow: var(--saby-shadow);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.saby-legend-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--saby-text-dark);
    margin-bottom: 1rem;
}

.saby-legend-items {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.saby-legend-item {
    display: flex;
    align-items: center;
    font-size: 0.9rem;
}

.saby-legend-color {
    width: 20px;
    height: 20px;
    border-radius: var(--saby-radius-small);
    margin-right: 0.75rem;
    flex-shrink: 0;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    .saby-calendar-container {
        padding: 1rem;
    }
    
    .saby-calendar-title {
        font-size: 2rem;
    }
    
    .saby-calendar-header {
        padding: 1.5rem 1rem;
        margin-bottom: 2rem;
    }
    
    .saby-calendar-nav {
        padding: 1rem;
    }
    
    .saby-calendar-day {
        min-height: 60px;
        padding: 0.75rem 0.25rem;
    }
    
    .saby-time-slots-panel {
        position: static;
    }
    
    .saby-booking-form {
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .saby-calendar-day-number {
        font-size: 1rem;
    }
    
    .saby-time-slot {
        padding: 0.75rem;
    }
    
    .saby-btn {
        padding: 0.75rem 1.5rem;
        font-size: 0.95rem;
    }
}

/* ========== ANIMACIONES ========== */
@keyframes saby-fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes saby-slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.saby-fade-in {
    animation: saby-fadeIn 0.5s ease-out;
}

.saby-slide-in {
    animation: saby-slideIn 0.5s ease-out;
}

/* ========== ACCESIBILIDAD ========== */
.saby-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus visible para navegación por teclado */
.saby-calendar-day:focus-visible,
.saby-time-slot:focus-visible,
.saby-btn:focus-visible {
    outline: 3px solid var(--saby-primary);
    outline-offset: 2px;
}

/* ========== TEMA OSCURO ========== */
@media (prefers-color-scheme: dark) {
    :root {
        --saby-text-dark: #e2e8f0;
        --saby-text-light: #a0aec0;
        --saby-border: #2d3748;
        --saby-background: #1a202c;
        --saby-white: #2d3748;
    }
    
    .saby-calendar-container {
        background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%);
    }
}

/* ========== IMPRESIÓN ========== */
@media print {
    .saby-calendar-container {
        background: white;
        box-shadow: none;
    }
    
    .saby-booking-form,
    .saby-time-slots-panel {
        display: none;
    }
    
    .saby-calendar-widget {
        box-shadow: none;
        border: 1px solid #000;
    }
}