/* Custom CSS para Coworkings Santiago Theme */

/* Reset de enlaces globales */
a {
    text-decoration: none !important;
}

/* Tipografías */
.font-roboto {
    font-family: 'Roboto', sans-serif;
}

.font-open-sans {
    font-family: 'Open Sans', sans-serif;
}

/* Colores personalizados */
.text-primary {
    color: #1E40AF;
}

.text-secondary {
    color: #0D9488;
}

.text-accent {
    color: #DC2626;
}

.bg-primary {
    background-color: #1E40AF;
}

.bg-secondary {
    background-color: #0D9488;
}

.bg-accent {
    background-color: #DC2626;
}

/* Transiciones suaves */
.transition-all {
    transition: all 0.3s ease;
}

.transition-700 {
    transition: all 0.7s ease;
}

/* Efectos hover personalizados */
.hover-scale:hover {
    transform: scale(1.05);
}

.hover-shadow:hover {
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* Animaciones personalizadas */
@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-20px);
    }
}

.animate-float {
    animation: float 6s ease-in-out infinite;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fadeInUp {
    animation: fadeInUp 0.6s ease-out forwards;
}

/* Scroll suave */
html {
    scroll-behavior: smooth;
}

/* Text clamp personalizado */
.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Backdrop blur personalizado */
.backdrop-blur-custom {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Shadows personalizadas */
.shadow-custom {
    box-shadow: 0 10px 25px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.shadow-custom-lg {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Badge destacado animado */
.badge-destacado {
    position: relative;
    overflow: hidden;
}

.badge-destacado::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    transition: left 0.5s;
}

.badge-destacado:hover::before {
    left: 100%;
}

/* Responsive utilities */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
        line-height: 1.2;
    }
    
    .hero-subtitle {
        font-size: 1.125rem;
    }
}

/* Loading spinner */
.loading-spinner {
    border: 2px solid #f3f3f3;
    border-top: 2px solid #1E40AF;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Cards hover effects */
.card-hover {
    transition: all 0.7s ease;
    transform: translateY(0);
}

.card-hover:hover {
    transform: translateY(-8px);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* Gradients personalizados */
.gradient-primary {
    background: linear-gradient(135deg, #1E40AF 0%, #0D9488 100%);
}

.gradient-hero {
    background: linear-gradient(135deg, #1E293B 0%, #0F172A 50%, #0D9488 100%);
}

/* Buttons personalizados */
.btn-primary {
    background: linear-gradient(135deg, #1E40AF 0%, #1D4ED8 100%);
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #1D4ED8 0%, #2563EB 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 15px -3px rgba(0, 0, 0, 0.2);
}

.btn-secondary {
    background: linear-gradient(135deg, #0D9488 0%, #0F766E 100%);
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #0F766E 0%, #115E59 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 15px -3px rgba(0, 0, 0, 0.2);
}

/* Stars rating */
.stars-container {
    display: flex;
    align-items: center;
    gap: 2px;
}

.star {
    width: 16px;
    height: 16px;
    transition: all 0.2s ease;
}

.star.filled {
    color: #FCD34D;
}

.star.empty {
    color: #D1D5DB;
}

/* Mobile menu toggle */
#mobile-menu {
    transition: all 0.3s ease;
}

/* Lazy loading images */
img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.3s;
}

img[loading="lazy"].loaded {
    opacity: 1;
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    .print-block {
        display: block !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .bg-white {
        background-color: #ffffff;
        border: 1px solid #000000;
    }
    
    .text-gray-600 {
        color: #000000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .animate-bounce,
    .animate-float,
    .animate-fadeInUp {
        animation: none;
    }
}

/* === MEJORAS ADICIONALES === */

/* Loading states mejorados */
.loading-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Animaciones mejoradas */
@keyframes slideInFromRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.animate-slideInFromRight {
    animation: slideInFromRight 0.5s ease-out forwards;
}

/* Hover effects mejorados para tarjetas */
.coworking-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.coworking-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* Mejoras de accesibilidad */
.focus\:ring-2:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgb(59 130 246);
}

.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;
}

/* Optimizaciones de scroll */
html {
    scroll-behavior: smooth;
}

/* Mejoras tipográficas */
.text-balance {
    text-wrap: balance;
}

/* Notificaciones */
.notification {
    backdrop-filter: blur(8px);
}

/* Estados de carga para el grid */
.coworkings-grid-loading {
    pointer-events: none;
    opacity: 0.5;
    transition: opacity 0.3s ease;
    position: relative;
}

.coworkings-grid-loading::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 1000;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Estilos para mapas Leaflet */
.leaflet-container {
    font-family: 'Open Sans', sans-serif !important;
    border-radius: 0.5rem;
    overflow: hidden;
}

.leaflet-popup-content-wrapper {
    border-radius: 0.5rem;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.leaflet-popup-content {
    margin: 0.75rem 1rem;
    font-size: 0.875rem;
    line-height: 1.25rem;
}

.leaflet-popup-tip {
    background: white;
    border: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
}

.custom-marker {
    background: none !important;
    border: none !important;
}

.custom-marker div {
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0) translateX(-50%);
    }
    40% {
        transform: translateY(-10px) translateX(-50%);
    }
    60% {
        transform: translateY(-5px) translateX(-50%);
    }
}

/* Controles del mapa */
.leaflet-control-zoom {
    border: none !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06) !important;
}

.leaflet-control-zoom a {
    border: none !important;
    background-color: white !important;
    color: #374151 !important;
    font-size: 18px !important;
    width: 32px !important;
    height: 32px !important;
    line-height: 30px !important;
    transition: all 0.2s ease !important;
}

.leaflet-control-zoom a:hover {
    background-color: #F3F4F6 !important;
    color: #111827 !important;
}

.leaflet-control-zoom a:first-child {
    border-top-left-radius: 0.375rem !important;
    border-top-right-radius: 0.375rem !important;
}

.leaflet-control-zoom a:last-child {
    border-bottom-left-radius: 0.375rem !important;
    border-bottom-right-radius: 0.375rem !important;
}

/* Attribution */
.leaflet-control-attribution {
    background-color: rgba(255, 255, 255, 0.8) !important;
    font-size: 0.75rem !important;
    padding: 0.25rem 0.5rem !important;
    border-radius: 0.25rem !important;
    backdrop-filter: blur(4px);
}

/* Responsive para mapas */
@media (max-width: 768px) {
    .leaflet-control-zoom {
        margin: 0.5rem !important;
    }
    
    .leaflet-popup-content-wrapper {
        max-width: 250px !important;
    }
    
    .leaflet-popup-content {
        margin: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }
}

/* Loading spinner para mapas */
.loading-spinner {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: .5;
    }
}

/* Estilos específicos para el contenedor del mapa */
#coworking-map {
    min-height: 400px;
    background-color: #f3f4f6;
    position: relative;
}

#coworking-map .loading-spinner {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
}

/* Asegurar que el mapa se muestre correctamente */
.leaflet-container {
    height: 100% !important;
    width: 100% !important;
}

/* Mejorar la apariencia del estado de error */
.map-error-state {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    border: 1px solid #fca5a5;
}

.map-unavailable-state {
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
    border: 1px solid #d1d5db;
}
