/* ===== ESTILOS PERSONALIZADOS PARA SISTEMA DE RESERVAS ===== */

/* Variables CSS personalizadas */
:root {
    --primary-color: #3B82F6;
    --primary-hover: #2563EB;
    --success-color: #10B981;
    --warning-color: #F59E0B;
    --error-color: #EF4444;
    --text-primary: #1F2937;
    --text-secondary: #6B7280;
    --border-color: #E5E7EB;
    --background-light: #F9FAFB;
}

/* ===== COMPONENTES DE BOTONES ===== */

.btn-primary {
    @apply inline-flex items-center px-4 py-2 bg-blue-600 text-white font-medium rounded-lg hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 transition-colors duration-200 disabled:opacity-50 disabled:cursor-not-allowed;
}

.btn-secondary {
    @apply inline-flex items-center px-4 py-2 bg-white text-gray-700 font-medium rounded-lg border border-gray-300 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 transition-colors duration-200;
}

.btn-danger {
    @apply inline-flex items-center px-4 py-2 bg-red-600 text-white font-medium rounded-lg hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-red-500 focus:ring-offset-2 transition-colors duration-200;
}

/* ===== COMPONENTES DE FORMULARIO ===== */

.form-input {
    @apply w-full px-3 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 transition-colors duration-200;
}

.form-select {
    @apply w-full px-3 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 transition-colors duration-200 bg-white;
}

.form-textarea {
    @apply w-full px-3 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 transition-colors duration-200 resize-none;
}

.form-input.error {
    @apply border-red-500 focus:ring-red-500 focus:border-red-500;
}

.form-input.success {
    @apply border-green-500 focus:ring-green-500 focus:border-green-500;
}

/* ===== MENSAJES DE ERROR ===== */

.error-message {
    @apply text-sm text-red-600 mt-1;
}

.error-message.show {
    @apply block;
}

.success-message {
    @apply text-sm text-green-600 mt-1;
}

/* ===== CALENDARIO ===== */

/* Calendar Styles */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background-color: #e5e7eb;
    border-radius: 0.5rem;
    overflow: hidden;
    border: 1px solid #d1d5db;
}

.calendar-header {
    background-color: #f9fafb;
    padding: 0.75rem 0.5rem;
    text-align: center;
    font-weight: 600;
    font-size: 0.875rem;
    color: #374151;
    border-bottom: 1px solid #e5e7eb;
}

.calendar-day {
    background-color: white;
    padding: 0.75rem 0.5rem;
    text-align: center;
    font-size: 0.875rem;
    color: #374151;
    border: 1px solid #f3f4f6;
    transition: all 0.2s ease;
    min-height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.calendar-day:hover {
    background-color: #f3f4f6;
    cursor: pointer;
}

.calendar-day.selected {
    background-color: #3b82f6;
    color: white;
    font-weight: 600;
}

.calendar-day.disabled {
    background-color: #f3f4f6;
    color: #9ca3af;
    cursor: not-allowed;
}

.calendar-day.other-month {
    background-color: #f9fafb;
    color: #9ca3af;
}

/* ===== SALAS Y DISPONIBILIDAD ===== */

/* Estilos para las opciones de sala */
.room-option {
    transition: all 0.3s ease;
}

.room-option.available {
    cursor: pointer;
}

.room-option.available:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.room-option.selected .border-2 {
    border-color: #3b82f6;
}

.room-option.selected:hover .border-2 {
    border-color: #2563eb;
    /* Mantener el fondo oscuro original */
}

.room-option.disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.room-option.disabled .border-2 {
    border-color: #d1d5db;
    background-color: #f9fafb;
}

.room-option.disabled:hover {
    transform: none;
    box-shadow: none;
}

/* Estado de disponibilidad de las salas */
.room-status {
    transition: all 0.3s ease;
}

.room-status .bg-green-200 {
    background-color: #dcfce7;
    color: #166534;
}

.room-status .bg-red-200 {
    background-color: #fecaca;
    color: #991b1b;
}

.room-status .bg-orange-200 {
    background-color: #fed7aa;
    color: #9a3412;
}

/* Información de disponibilidad */
.availability-info {
    background-color: #f8fafc;
    border-radius: 0.5rem;
    padding: 0.75rem;
    margin-top: 0.75rem;
    border: 1px solid #e2e8f0;
}

.availability-info .text-green-600 {
    color: #059669;
}

.availability-info .text-red-600 {
    color: #dc2626;
}

.availability-info .text-orange-600 {
    color: #ea580c;
}

/* ===== ESTADOS DE CARGA ===== */

.loading-spinner {
    @apply animate-spin rounded-full h-6 w-6 border-b-2 border-blue-600;
}

/* ===== BARRA DE PROGRESO ===== */

.progress-container {
    @apply mb-8 p-4 bg-elevated rounded-lg border border-border-primary;
}

.progress-text {
    @apply text-sm text-secondary;
}

.progress-steps {
    @apply text-xs text-secondary;
}

.progress-bar {
    @apply bg-primary h-2 rounded-full transition-all duration-300 ease-in-out;
}

/* ===== PASOS ===== */

.step-content {
    @apply space-y-6;
}

.navigation-buttons {
    @apply flex justify-between items-center pt-6;
}

/* ===== INFORMACIÓN DE DISPONIBILIDAD ===== */

.availability-status {
    @apply bg-elevated p-4 rounded-lg border border-border-primary;
}

.availability-status ul {
    @apply space-y-2;
}

.availability-status li {
    @apply flex items-center text-sm;
}

.availability-status i {
    @apply text-accent mr-2;
}

/* ===== MENSAJE DE NO DISPONIBILIDAD ===== */

.no-availability {
    @apply text-center py-12;
}

.no-availability i {
    @apply text-error mb-4;
}

/* ===== RESUMEN DE CONFIRMACIÓN ===== */

.confirmation-summary {
    @apply bg-elevated p-6 rounded-lg border border-border-primary;
}

.summary-item {
    @apply flex justify-between items-center py-2 border-b border-border-primary last:border-b-0;
}

.summary-label {
    @apply text-secondary;
}

.summary-value {
    @apply font-semibold text-primary;
}

/* ===== SECCIÓN DE QR ===== */

.qr-section {
    @apply bg-elevated p-6 rounded-lg border border-border-primary;
}

#qr-code-preview {
    @apply shadow-lg;
}

/* ===== SECCIÓN DE PRECIOS ===== */

.pricing-section {
    @apply bg-elevated p-6 rounded-lg border border-border-primary;
}

/* ===== RESPONSIVE ===== */

@media (max-width: 768px) {
    .calendar-grid {
        gap: 0.5px;
    }
    
    .calendar-day {
        padding: 0.5rem 0.25rem;
        font-size: 0.75rem;
        min-height: 2rem;
    }
    
    .room-option {
        margin-bottom: 1rem;
    }
    
    .navigation-buttons {
        @apply flex-col space-y-4;
    }
    
    .navigation-buttons > div:first-child {
        @apply order-2;
    }
    
    .navigation-buttons > div:last-child {
        @apply order-1;
    }
}

/* ===== ANIMACIONES ===== */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.animate-fadeIn {
    animation: fadeIn 0.3s ease-out;
}

.animate-slideIn {
    animation: slideIn 0.3s ease-out;
}

.animate-scaleIn {
    animation: scaleIn 0.3s ease-out;
}

/* ===== ESTADOS ESPECIALES ===== */

/* Sala seleccionada */
.room-option.selected .border-2 {
    border-color: #3b82f6;
    /* Mantener el fondo oscuro original */
}

/* El color de texto se mantiene por defecto */

/* Sala con disponibilidad limitada */
.room-option.limited .border-2 {
    border-color: #f59e0b;
}

.room-option.limited .availability-info {
    background-color: #fffbeb;
    border-color: #fbbf24;
}

/* ===== MEJORAS DE ACCESIBILIDAD ===== */

.room-option:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

.room-option.disabled:focus {
    outline: 2px solid #9ca3af;
}

/* ===== ESTADOS DE TRANSICIÓN ===== */

.room-option.transitioning {
    pointer-events: none;
    opacity: 0.7;
}

.room-option.transitioning .border-2 {
    border-color: #9ca3af;
}

/* ===== INDICADORES DE ESTADO ===== */

.status-indicator {
    @apply inline-flex items-center px-2 py-1 rounded-full text-xs font-medium;
}

.status-indicator.available {
    @apply bg-green-100 text-green-800;
}

.status-indicator.unavailable {
    @apply bg-red-100 text-red-800;
}

.status-indicator.limited {
    @apply bg-yellow-100 text-yellow-800;
}

/* ===== TOOLTIPS ===== */

.tooltip {
    @apply relative;
}

.tooltip:hover .tooltip-text {
    @apply visible opacity-100;
}

.tooltip-text {
    @apply invisible absolute z-10 px-3 py-2 text-sm text-white bg-gray-900 rounded-lg opacity-0 transition-opacity duration-300;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
}

.tooltip-text::after {
    content: "";
    @apply absolute top-full left-1/2 transform -translate-x-1/2;
    border: 5px solid transparent;
    border-top-color: #111827;
}

/* ===== MODAL DE CARGA ===== */

#reservation-loading-modal {
    transition: opacity 0.3s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
}

#reservation-loading-modal.hidden {
    display: none !important;
}

#reservation-loading-modal:not(.hidden) {
    display: flex !important;
}

/* Animación de entrada del modal */
@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes modalFadeOut {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.95);
    }
}

/* Aplicar animaciones */
#reservation-loading-modal.opacity-100 {
    animation: modalFadeIn 0.3s ease-out;
}

#reservation-loading-modal.opacity-0 {
    animation: modalFadeOut 0.3s ease-in;
}

/* Estilos para el contenido del modal */
#reservation-loading-modal .bg-white {
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin: 1rem;
    max-width: 28rem;
    width: calc(100% - 2rem);
}

/* Asegurar centrado perfecto */
#reservation-loading-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
}

/* Animación del spinner personalizada */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

#reservation-loading-modal .animate-spin {
    animation: spin 1s linear infinite;
}

/* Animación de la barra de progreso */
@keyframes progressPulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

#reservation-loading-modal .animate-pulse {
    animation: progressPulse 2s ease-in-out infinite;
}

/* Efecto de difuminado del fondo */
#reservation-loading-modal .backdrop-blur-sm {
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

/* Responsive para el modal */
@media (max-width: 640px) {
    #reservation-loading-modal .max-w-md {
        max-width: 90%;
        margin: 1rem;
    }
    
    #reservation-loading-modal .p-8 {
        padding: 1.5rem;
    }
    
    #reservation-loading-modal .h-16 {
        height: 3rem;
        width: 3rem;
    }
}
