/* Alpine.js Enhanced Search Styles */
/* File: css/search-alpine.css */

/* ===== ALPINE.JS SPECIFIC TRANSITIONS ===== */
[x-cloak] {
    display: none !important;
}

/* Loading states */
.alpine-loading {
    opacity: 0.6;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

/* ===== SEARCH HERO ALPINE ENHANCEMENTS ===== */
.search-hero-content {
    transition: all 0.3s ease;
}

.search-hero-content[x-data] {
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== SEARCH INPUT ALPINE STATES ===== */
.search-input:focus {
    outline: none;
    border-color: var(--primary-gold);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

.search-btn-main:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.search-btn-main:disabled .search-btn-icon {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ===== QUICK FILTERS ALPINE STATES ===== */
.quick-filter {
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.quick-filter::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.2), transparent);
    transition: left 0.3s ease;
}

.quick-filter:hover::before {
    left: 100%;
}

.quick-filter.active {
    background: var(--primary-gold);
    color: var(--dark-primary);
    border-color: var(--primary-gold);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.3);
}

/* ===== SEARCH STATS ALPINE ANIMATION ===== */
.search-stats {
    animation: slideInUp 0.8s ease-out 0.3s both;
}

.stats-number {
    transition: all 0.3s ease;
    display: inline-block;
}

.stats-number:hover {
    transform: scale(1.1);
    color: var(--primary-gold);
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== FILTER SIDEBAR ALPINE ENHANCEMENTS ===== */
.filter-group {
    animation: fadeInLeft 0.5s ease-out;
}

.filter-group:nth-child(2) { animation-delay: 0.1s; }
.filter-group:nth-child(3) { animation-delay: 0.2s; }
.filter-group:nth-child(4) { animation-delay: 0.3s; }
.filter-group:nth-child(5) { animation-delay: 0.4s; }
.filter-group:nth-child(6) { animation-delay: 0.5s; }

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.filter-badge {
    background: var(--primary-gold);
    color: var(--dark-primary);
    font-size: 0.75rem;
    padding: 0.2rem 0.4rem;
    border-radius: 50%;
    font-weight: 600;
    animation: pulse 0.3s ease;
}

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

/* ===== RANGE SLIDERS ALPINE STYLING ===== */
.range-input {
    appearance: none;
    height: 6px;
    border-radius: 3px;
    background: var(--border-color);
    outline: none;
    transition: all 0.3s ease;
}

.range-input::-webkit-slider-thumb {
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-gold);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.range-input::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.5);
}

.range-input::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-gold);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.range-input::-moz-range-thumb:hover {
    transform: scale(1.2);
}

/* ===== GYM CARDS ALPINE ANIMATIONS ===== */
.gym-grid {
    animation: fadeIn 0.6s ease-out;
}

.gym-card {
    animation: slideInUp 0.5s ease-out;
    animation-fill-mode: both;
}

.gym-card:nth-child(1) { animation-delay: 0.1s; }
.gym-card:nth-child(2) { animation-delay: 0.2s; }
.gym-card:nth-child(3) { animation-delay: 0.3s; }
.gym-card:nth-child(4) { animation-delay: 0.4s; }
.gym-card:nth-child(5) { animation-delay: 0.5s; }
.gym-card:nth-child(6) { animation-delay: 0.6s; }

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.clickable-card {
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.clickable-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

/* ===== FAVORITE & COMPARE BUTTONS ===== */
.gym-favorite,
.gym-compare {
    transition: all 0.3s ease;
    transform: scale(1);
}

.gym-favorite:hover,
.gym-compare:hover {
    transform: scale(1.1);
    background: rgba(212, 175, 55, 0.2);
}

.gym-favorite:active,
.gym-compare:active {
    transform: scale(0.95);
}

.gym-compare.active {
    background: var(--primary-gold);
    color: var(--dark-primary);
}

/* ===== PAGINATION ALPINE STATES ===== */
.pagination-btn {
    transition: all 0.3s ease;
}

/* Ensure all pagination elements align to the same baseline */
.pagination-numbers {
    align-items: baseline;
}

.pagination-numbers > * {
    display: flex;
    align-items: center;
    align-self: center;
}

.pagination-btn:hover:not(.disabled) {
    background: var(--primary-gold);
    color: var(--dark-primary);
    /* Removed transform to prevent alignment issues */
}

.pagination-btn.active {
    background: var(--primary-gold);
    color: var(--dark-primary);
    border-color: var(--primary-gold);
}

.pagination-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

/* ===== COMPARE MODAL ALPINE STYLES ===== */
.compare-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

/* Removed .compare-modal.hidden as it conflicts with Alpine.js x-show */

.compare-modal-content {
    background: var(--surface-dark);
    border-radius: 12px;
    max-width: 800px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    animation: scaleIn 0.3s ease;
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.compare-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.compare-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.compare-close:hover {
    background: var(--hover-bg);
    color: var(--white);
}


/* ===== LOADING STATES ===== */
.loading-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 300px;
    animation: fadeIn 0.3s ease;
}

.loading-spinner {
    text-align: center;
    color: var(--text-secondary);
}

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

/* ===== NO RESULTS STATE ===== */
.no-results {
    text-align: center;
    padding: 3rem 2rem;
    animation: fadeIn 0.5s ease;
}

.no-results-icon {
    margin-bottom: 1.5rem;
    opacity: 0.6;
}

.no-results-title {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
}

.no-results-text {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

/* ===== RESPONSIVE MOBILE ADJUSTMENTS ===== */
@media (max-width: 768px) {
    .search-hero-content[x-data] {
        animation-duration: 0.4s;
    }

    .filter-group {
        animation: none; /* Disable complex animations on mobile */
    }

    .gym-card {
        animation-delay: 0s !important;
    }
}

/* ===== ACCESSIBILITY ENHANCEMENTS ===== */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus styles for keyboard navigation */
.search-input:focus,
.quick-filter:focus,
.filter-checkbox input:focus + .checkmark,
.filter-radio input:focus + .radiomark,
.range-input:focus {
    outline: 2px solid var(--primary-gold);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .gym-card {
        border: 2px solid var(--white);
    }

    .quick-filter.active {
        border: 3px solid var(--primary-gold);
    }
}