/* Ultra-modern styles for premium gym map app */

/* Enhanced scrollbar styling */
.custom-scrollbar::-webkit-scrollbar {
    width: 8px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: rgba(99, 102, 241, 0.1);
    border-radius: 8px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #6366f1, #d946ef);
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #4f46e5, #c026d3);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* Global scrollbar fallback */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: #ffffff;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* Premium animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes slideIn {
    from { transform: translateX(-100%) scale(0.95); opacity: 0; }
    to { transform: translateX(0) scale(1); opacity: 1; }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes glow {
    0%, 100% { box-shadow: 0 0 20px rgba(99, 102, 241, 0.3); }
    50% { box-shadow: 0 0 30px rgba(217, 70, 239, 0.5), 0 0 40px rgba(99, 102, 241, 0.3); }
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.animate-fadeIn {
    animation: fadeIn 0.5s ease-out;
}

.animate-slideIn {
    animation: slideIn 0.4s ease-out;
}

.animate-pulse-custom {
    animation: pulse 2s infinite;
}

.animate-glow {
    animation: glow 3s ease-in-out infinite;
}

.animate-float {
    animation: float 3s ease-in-out infinite;
}

.animate-shimmer {
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

/* Custom focus styles */
input:focus, select:focus, button:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

/* Button focus styles - removes black border on focus */
button:focus,
a[class*="bg-"]:focus,
.btn-focus:focus {
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2), 0 4px 12px rgba(99, 102, 241, 0.15);
    border: none !important;
}

/* Purple button specific focus */
.bg-purple-400:focus,
.bg-purple-500:focus {
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.3), 0 4px 12px rgba(168, 85, 247, 0.2);
    border: none !important;
}

/* Google Maps InfoWindow styles - remove black borders */
.gm-style .gm-style-iw,
.gm-style .gm-style-iw-c,
.gm-style .gm-style-iw-d,
.gm-style .gm-style-iw-t {
    outline: none !important;
    border: none !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15) !important;
}

/* Remove focus outlines from InfoWindow contents */
.gm-style-iw * {
    outline: none !important;
}

.gm-style-iw *:focus {
    outline: none !important;
}

/* InfoWindow buttons */
.gm-style-iw button,
.gm-style-iw a {
    outline: none !important;
}

.gm-style-iw button:focus,
.gm-style-iw a:focus {
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.3) !important;
}

/* InfoWindow container */
.gm-style-iw-chr {
    outline: none !important;
    border: none !important;
}

/* Hover effects */
.hover-lift {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hover-lift:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

/* Custom gradient backgrounds */
.gradient-primary {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
}

.gradient-secondary {
    background: linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%);
}

/* Custom button styles */
.btn-primary {
    @apply bg-primary hover:bg-purple-700 text-white font-semibold py-2 px-6 rounded-lg transition-colors duration-200;
}

.btn-secondary {
    @apply bg-gray-200 hover:bg-gray-300 text-gray-800 font-semibold py-2 px-6 rounded-lg transition-colors duration-200;
}

.btn-outline {
    @apply border-2 border-primary text-primary hover:bg-primary hover:text-white font-semibold py-2 px-6 rounded-lg transition-all duration-200;
}

/* Custom card styles */
.card {
    @apply bg-white rounded-2xl shadow-sm border border-gray-200 overflow-hidden;
}

.card-hover {
    @apply hover:shadow-md hover:border-gray-300 transition-all duration-200;
}

/* Premium range slider styling */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    height: 12px;
    border-radius: 8px;
    background: linear-gradient(to right, rgba(99, 102, 241, 0.2), rgba(217, 70, 239, 0.2));
    outline: none;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #d946ef);
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4), 0 2px 4px rgba(0, 0, 0, 0.2);
    border: 2px solid white;
    transition: all 0.3s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.6), 0 4px 8px rgba(0, 0, 0, 0.3);
}

input[type="range"]::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #d946ef);
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4), 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

input[type="range"]::-moz-range-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.6), 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* Premium loading spinner */
.spinner {
    border: 3px solid rgba(99, 102, 241, 0.2);
    border-top: 3px solid #6366f1;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.premium-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid transparent;
    border-top: 4px solid #6366f1;
    border-right: 4px solid #d946ef;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    filter: drop-shadow(0 4px 8px rgba(99, 102, 241, 0.3));
}

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

/* Premium select dropdown */
select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236366f1' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-size: 20px;
    transition: all 0.3s ease;
}

select:hover {
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.15);
    transform: translateY(-1px);
}

select:focus {
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2), 0 8px 25px rgba(99, 102, 241, 0.15);
    transform: translateY(-1px);
}

/* Enhanced modal and backdrop effects */
.modal-backdrop {
    backdrop-filter: blur(8px) saturate(150%);
    background: rgba(15, 23, 42, 0.6);
}

.glass-morphism {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 25px 45px rgba(0, 0, 0, 0.1);
}

.glass-morphism-dark {
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 25px 45px rgba(0, 0, 0, 0.3);
}

/* Map container styling */
#map {
    border-radius: 0 0 1rem 1rem;
    min-height: 600px;
    width: 100%;
    position: relative;
}

/* Ensure map loads properly */
#map > div {
    height: 100% !important;
    width: 100% !important;
}

/* Premium gym card effects */
.gym-card {
    position: relative;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    background: linear-gradient(135deg, rgba(255,255,255,0.8), rgba(255,255,255,0.9));
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
    cursor: pointer;
}

.gym-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(217, 70, 239, 0.1));
    opacity: 0;
    transition: opacity 0.4s ease;
    border-radius: inherit;
}

.gym-card:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 20px 40px rgba(99, 102, 241, 0.15), 0 10px 20px rgba(0, 0, 0, 0.1);
    border-left: 6px solid transparent;
    border-image: linear-gradient(135deg, #6366f1, #d946ef) 1;
}

.gym-card:hover::before {
    opacity: 1;
}

.gym-card:active {
    transform: translateY(-2px) scale(1.01);
}

/* Price badge styling */
.price-badge {
    @apply inline-flex items-center px-3 py-1 rounded-full text-sm font-medium;
}

.price-badge-green {
    @apply bg-green-100 text-green-800;
}

.price-badge-yellow {
    @apply bg-yellow-100 text-yellow-800;
}

.price-badge-red {
    @apply bg-red-100 text-red-800;
}

/* Search input with icon */
.search-input-container {
    position: relative;
}

.search-input-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
}

/* Custom scrollbar for gym list */
#gym-list {
    scrollbar-width: thin;
    scrollbar-color: #d1d5db #ffffff;
}

/* Hide cursor/caret in search input - ultimate solution */
#location-input {
    caret-color: transparent !important;
    color: white !important;
    background: transparent !important;
    outline: none !important;
    border: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
}

#location-input:focus {
    outline: none !important;
    caret-color: transparent !important;
    color: white !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

/* Force remove focus state completely */
#location-input:focus-visible {
    outline: none !important;
    box-shadow: none !important;
}

/* Remove any default browser styling */
#location-input::-webkit-outer-spin-button,
#location-input::-webkit-inner-spin-button {
    -webkit-appearance: none !important;
    margin: 0 !important;
}

/* Selection styling */
#location-input::selection {
    background: rgba(168, 85, 247, 0.3);
    color: white;
}

/* Placeholder styling */
#location-input::-webkit-input-placeholder {
    color: rgba(156, 163, 175, 1) !important;
}

#location-input::-moz-placeholder {
    color: rgba(156, 163, 175, 1) !important;
    opacity: 1 !important;
}

#location-input::placeholder {
    color: rgba(156, 163, 175, 1) !important;
    opacity: 1 !important;
}

/* Additional webkit-specific caret hiding */
#location-input::-webkit-textfield-decoration-container {
    visibility: hidden !important;
}

/* Mobile-first responsive utilities */
@media (max-width: 1023px) {
    /* Mobile filter bar - remove width constraints */
    .lg\:w-fit {
        width: 100% !important;
    }
    
    .lg\:w-36, .lg\:w-28 {
        width: 100% !important;
    }
}

@media (max-width: 640px) {
    .mobile-full {
        width: 100vw;
        margin-left: calc(-50vw + 50%);
    }
    
    .mobile-padding {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    /* Touch-friendly button sizes */
    button {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Better mobile text sizing */
    .text-sm {
        font-size: 0.9rem;
    }
    
    /* Improved spacing for mobile */
    .p-4 {
        padding: 1rem;
    }
    
    /* Range input styling for mobile */
    input[type="range"] {
        height: 8px;
        -webkit-appearance: none;
        appearance: none;
        background: #e5e7eb;
        border-radius: 5px;
        outline: none;
        cursor: pointer;
    }
    
    input[type="range"]::-webkit-slider-thumb {
        -webkit-appearance: none;
        appearance: none;
        width: 20px;
        height: 20px;
        background: #a855f7;
        border-radius: 50%;
        cursor: pointer;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    }
    
    input[type="range"]::-moz-range-thumb {
        width: 20px;
        height: 20px;
        background: #a855f7;
        border-radius: 50%;
        cursor: pointer;
        border: none;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    }
}

/* Small mobile devices */
@media (max-width: 480px) {
    /* Reduce padding for very small screens */
    .p-4 {
        padding: 0.75rem;
    }
    
    .px-4 {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
    
    /* Stack form elements more compactly */
    .space-y-4 > * + * {
        margin-top: 0.75rem;
    }
    
    /* Smaller hero text for very small screens */
    .text-2xl {
        font-size: 1.5rem;
    }
    
    /* Mobile-specific height adjustments */
    .h-\[calc\(100vh-280px\)\] {
        height: calc(100vh - 200px);
    }
    
    /* Mobile layout adjustments */
    .grid-cols-1 {
        gap: 0.5rem;
    }
}

/* Tablet and larger screens */
@media (min-width: 768px) {
    /* Enhanced hover effects for non-touch devices */
    .gym-card:hover {
        transform: translateY(-4px);
        box-shadow: 0 20px 40px rgba(99, 102, 241, 0.15);
    }
    
    /* Better desktop range styling */
    input[type="range"]::-webkit-slider-thumb {
        width: 16px;
        height: 16px;
    }
    
    input[type="range"]::-moz-range-thumb {
        width: 16px;
        height: 16px;
    }
}

/* Premium button effects */
.btn-premium {
    position: relative;
    background: linear-gradient(135deg, #6366f1, #d946ef);
    border: none;
    border-radius: 16px;
    padding: 12px 24px;
    color: white;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.3);
}

.btn-premium::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 ease;
}

.btn-premium:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 15px 35px rgba(99, 102, 241, 0.4), 0 5px 15px rgba(0, 0, 0, 0.1);
}

.btn-premium:hover::before {
    left: 100%;
}

.btn-premium:active {
    transform: translateY(0) scale(1.02);
}

/* Dark mode support with premium styling */
@media (prefers-color-scheme: dark) {
    .dark-mode-card {
        background: rgba(15, 23, 42, 0.8);
        border: 1px solid rgba(255, 255, 255, 0.1);
        backdrop-filter: blur(20px);
    }
    
    .dark-mode-text {
        color: rgba(248, 250, 252, 0.9);
    }
}

/* Print styles */
@media print {
    .no-print {
        display: none;
    }
    
    .print-full {
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }
}

/* High contrast mode support with premium styling */
@media (prefers-contrast: high) {
    .high-contrast {
        border: 3px solid;
        box-shadow: 0 0 0 1px currentColor;
    }
    
    .btn-premium {
        border: 2px solid white;
    }
    
    .gym-card {
        border: 2px solid;
    }
}

/* Animation delay utilities */
.animation-delay-2000 {
    animation-delay: 2s;
}

.animation-delay-4000 {
    animation-delay: 4s;
}

/* Premium text effects */
.text-gradient {
    background: linear-gradient(135deg, #6366f1, #d946ef, #06b6d4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    background-size: 200% 200%;
    animation: gradient-shift 3s ease infinite;
}

@keyframes gradient-shift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* Premium focus states */
.focus-premium:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2), 0 8px 25px rgba(99, 102, 241, 0.15);
    transform: translateY(-1px);
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    .animate-blob, .animate-float, .animate-glow {
        animation: none !important;
    }
}