/**
 * RJdev API - Park Locator Styles
 * Version: 0.982 - Aug 2 2025
 */

/* ===============================================
   BREAKDANCE DESIGN RECREATION
   =============================================== */

/* Main Grid - 3 Columns */
.breakdance-parks-grid {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 20px !important;
    margin: 40px auto 0 !important;
    max-width: 1280px !important;
    padding: 0 0px !important;
    width: 100% !important;
    align-items: start !important;
}

/* Card Link Wrapper */
.park-card-link-breakdance {
    display: block !important;
    text-decoration: none !important;
    color: inherit !important;
    transition: transform 0.3s ease !important;
    width: 100% !important;
    height: 100% !important;
}

.park-card-link-breakdance:hover {
    transform: translateY(-4px) !important;
    text-decoration: none !important;
    color: inherit !important;
}

/* Main Card - FIXED HEIGHT FOR UNIFORMITY */
.breakdance-park-card {
    background: white !important;
    border-radius: 12px !important;
    overflow: hidden !important;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1) !important;
    transition: all 0.3s ease !important;
    width: 100% !important;
    height: 380px !important; /* FIXED HEIGHT */
    position: relative !important;
    border: 1px solid #e2e8f0 !important;
    display: flex !important;
    flex-direction: column !important;
}

.park-card-link-breakdance:hover .breakdance-park-card {
    box-shadow: 0 8px 25px rgba(0,0,0,0.15) !important;
}

/* Hero Image Section */
.park-hero-section {
    position: relative !important;
    height: 200px !important;
    overflow: hidden !important;
    width: 100% !important;
    flex-shrink: 0 !important; /* Prevent shrinking */
}

.park-hero-image {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    transition: transform 0.3s ease !important;
}

.park-card-link-breakdance:hover .park-hero-image {
    transform: scale(1.05) !important;
}

/* Carousel Styles */
.park-hero-carousel {
    position: relative !important;
    width: 100% !important;
    height: 100% !important;
    overflow: hidden !important;
}

.carousel-images {
    position: relative !important;
    width: 100% !important;
    height: 100% !important;
}

.carousel-images .park-hero-image {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    opacity: 0 !important;
    transition: opacity 0.3s ease !important;
}

.carousel-images .park-hero-image.active {
    opacity: 1 !important;
}

/* Navigation Arrows */
.carousel-nav {
    position: absolute !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    background: rgba(255, 255, 255, 0.9) !important;
    border: none !important;
    border-radius: 50% !important;
    width: 40px !important;
    height: 40px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    opacity: 0 !important;
    transition: opacity 0.3s ease, background-color 0.3s ease !important;
    z-index: 4 !important;
    color: #1a365d !important;
    font-size: 16px !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15) !important;
}

.carousel-nav:hover {
    background: rgba(255, 255, 255, 1) !important;
    color: #1a365d !important;
}

.carousel-prev {
    left: 12px !important;
}

.carousel-next {
    right: 12px !important;
}

/* Show arrows on hover */
.park-hero-carousel:hover .carousel-nav {
    opacity: 1 !important;
}

/* Pagination Dots */
.carousel-dots {
    position: absolute !important;
    bottom: 12px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    display: flex !important;
    gap: 6px !important;
    z-index: 4 !important;
}

.carousel-dot {
    width: 8px !important;
    height: 8px !important;
    border-radius: 50% !important;
    border: none !important;
    background: rgba(255, 255, 255, 0.6) !important;
    cursor: pointer !important;
    transition: background-color 0.3s ease !important;
    padding: 0 !important;
}

.carousel-dot.active {
    background: rgba(255, 255, 255, 1) !important;
}

.carousel-dot:hover {
    background: rgba(255, 255, 255, 0.8) !important;
}

/* Overlay Icons - Top Left - HIDE WHEN EMPTY */
.park-overlay-icons {
    position: absolute !important;
    top: 12px !important;
    left: 12px !important;
    display: flex !important;
    gap: 6px !important;
    z-index: 3 !important;
}

.overlay-icon {
    background: rgba(255, 255, 255, 0.95) !important;
    color: #1a365d !important;
    padding: 6px !important;
    border-radius: 6px !important;
    font-size: 16px !important;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15) !important;
    backdrop-filter: blur(5px) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 32px !important;
    height: 32px !important;
    line-height: 1 !important;
}

/* Distance Badge - Top Right - Enhanced for v0.982 */
.distance-badge-overlay {
    position: absolute !important;
    top: 12px !important;
    right: 12px !important;
    background: rgba(37, 49, 75, 1) !important;
    color: white !important;
    padding: 6px 12px !important;
    border-radius: 12px !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2) !important;
    backdrop-filter: blur(5px) !important;
    z-index: 3 !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
}

/* Content Overlay - White Section - FLEXIBLE HEIGHT */
.park-content-overlay {
    background: white !important;
    padding: 20px !important;
    position: relative !important;
    z-index: 2 !important;
    flex: 1 !important; /* Fill remaining space */
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important; /* Distribute content evenly */
    height: 220px !important; /* Fixed height for content area */
}

/* Park Title */
.park-title-main {
    font-size: 20px !important;
    font-weight: 700 !important;
    color: #1a365d !important;
    margin: 0 0 6px 0 !important;
    line-height: 1.2 !important;
    text-transform: capitalize !important;
    letter-spacing: 0.5px !important;
    flex-shrink: 0 !important; /* Don't shrink */
}

/* Location Text */
.park-location-text {
    font-size: 14px !important;
    color: #666 !important;
    margin: 0 0 12px 0 !important;
    font-weight: 500 !important;
    line-height: 1.3 !important;
    flex-shrink: 0 !important; /* Don't shrink */
}

/* Info Row - Rating, Reviews, Pricing in one line */
.park-info-row {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    margin-bottom: 12px !important;
    font-size: 13px !important;
    gap: 10px !important;
    flex-shrink: 0 !important; /* Don't shrink */
}

.rating-section {
    display: flex !important;
    align-items: center !important;
    gap: 4px !important; /* Increased gap for reviews */
    flex-shrink: 0 !important;
}

.rating-number {
    font-weight: 700 !important;
    color: #1a365d !important;
    font-size: 14px !important;
}

.star-icon {
    color: #fbbf24 !important;
    font-size: 14px !important;
    line-height: 1 !important;
}

.reviews-section {
    flex: 1 !important;
    text-align: center !important;
    min-width: 0 !important;
}

.reviews-count {
    color: #666 !important;
    font-size: 12px !important;
    font-weight: 500 !important;
}

.pricing-section {
    text-align: right !important;
    flex-shrink: 0 !important;
}

.price-text {
    font-weight: 700 !important;
    color: #1a365d !important;
    font-size: 14px !important;
    white-space: nowrap !important;
}

/* Amenity Tags - ALWAYS RESERVE SPACE */
.amenity-tags-section {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
    margin-top: 5px !important; /* Push to bottom */
    min-height: 25px !important; /* Reserve space even when empty */
    align-items: flex-start !important;
    align-content: flex-start !important;
}

.amenity-tag {
    background: #f1f5f9 !important;
    color: #25314B !important;
    padding: 4px 10px !important;
    border-radius: 12px !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    border: 1px solid #e2e8f0 !important;
    text-transform: capitalize !important;
    line-height: 1 !important;
    height: 20px !important; /* Fixed height */
    display: flex !important;
    align-items: center !important;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .breakdance-parks-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 25px !important;
        max-width: 800px !important;
    }
}

@media (max-width: 768px) {
    .breakdance-parks-grid {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
        padding: 0 15px !important;
        max-width: 400px !important;
    }
    
    .breakdance-park-card {
        height: auto !important; /* Allow natural height on mobile */
        min-height: 380px !important;
    }
    
    .park-content-overlay {
        height: auto !important; /* Allow natural height on mobile */
    }
    
    .park-hero-section {
        height: 200px !important;
    }
    
    .park-title-main {
        font-size: 18px !important;
    }
    
    .park-content-overlay {
        padding: 16px !important;
    }
    
    .park-info-row {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 6px !important;
        margin-bottom: 10px !important;
    }
    
    .rating-section,
    .reviews-section,
    .pricing-section {
        text-align: left !important;
        width: 100% !important;
    }
    
    .reviews-section {
        text-align: left !important;
    }
    
    .amenity-tags-section {
        min-height: 24px !important;
    }
}

/* ===============================================
   FILTER INTERFACE - Enhanced for v0.982
   =============================================== */

.rj-locator-filters {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 30px;
    position: relative;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.rj-locator-filters h3 {
    margin: 0 0 20px 0;
    color: #1a365d;
    font-size: 22px;
    font-weight: 600;
}

.rj-locator-form {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    align-items: end;
}

.filter-group {
    display: flex;
    flex-direction: column;
}

.filter-group label {
    font-weight: 600;
    color: #2d3748;
    font-size: 14px;
    margin-bottom: 8px;
    display: block;
}

.locator-filter {
    padding: 12px 14px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 16px;
    background: white;
    transition: all 0.2s ease;
    width: 100%;
    box-sizing: border-box;
}

.locator-filter:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    outline: none;
    transform: translateY(-1px);
}

.locator-filter:hover {
    border-color: #cbd5e0;
}

select.locator-filter {
    cursor: pointer;
    appearance: none;
    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='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-size: 16px;
    padding-right: 40px;
}

.proximity-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.proximity-group label {
    display: flex;
    align-items: center;
    margin-bottom: 0;
    font-size: 14px;
    cursor: pointer;
}

/* Enhanced checkbox styling for v0.982 */
.proximity-group input[type="checkbox"] {
    margin-right: 8px;
    width: auto;
    transform: scale(1.1);
    accent-color: #667eea;
}

.proximity-group small {
    color: #718096;
    font-size: 12px;
    margin-top: 4px;
}

.clear-filters {
    background: #6c757d;
    color: white;
    text-decoration: none;
    padding: 10px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    transition: all 0.2s ease;
    margin-top: 8px;
    display: inline-block;
}

.clear-filters:hover {
    background: #5a6268;
    transform: translateY(-1px);
    color: white;
    text-decoration: none;
}

/* ===============================================
   MOBILE RESPONSIVE FOR FILTERS
   =============================================== */

@media (max-width: 768px) {
    .rj-locator-form {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .proximity-group {
        flex-direction: row;
        justify-content: space-between;
        align-items: flex-end;
    }
    
    .proximity-group .clear-filters {
        margin-top: 0;
        margin-left: 12px;
        flex-shrink: 0;
    }
    
    .rj-locator-filters {
        padding: 20px;
        margin-bottom: 20px;
    }
    
    .locator-filter {
        padding: 10px 12px;
        font-size: 16px;
    }
    
    .rj-locator-filters h3 {
        font-size: 18px;
    }
}

/* ===============================================
   FALLBACK GRID (when not using global_block)
   =============================================== */

.rj-locator-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
    margin: 20px 0;
    transition: opacity 0.3s ease;
}

.rj-locator-grid.loading {
    opacity: 0.6;
    pointer-events: none;
}

.rj-locator-grid[data-columns="2"] {
    grid-template-columns: repeat(2, 1fr);
}

.rj-locator-grid[data-columns="4"] {
    grid-template-columns: repeat(4, 1fr);
}

.rj-locator-grid[data-columns="5"] {
    grid-template-columns: repeat(5, 1fr);
}

.park-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    border: 1px solid #e2e8f0;
}

.park-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.park-image {
    width: 100%;
    height: 220px;
    background-size: cover;
    background-position: center;
    position: relative;
}

.distance-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(102, 126, 234, 0.9);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    backdrop-filter: blur(4px);
}

.park-content {
    padding: 24px;
}

.park-content h3 {
    margin: 0 0 8px 0;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.3;
}

.park-content h3 a {
    color: #1a365d;
    text-decoration: none;
    transition: color 0.2s ease;
}

.park-content h3 a:hover {
    color: #667eea;
}

.park-state {
    color: #718096;
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 12px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.park-excerpt {
    color: #4a5568;
    font-size: 14px;
    line-height: 1.5;
    margin: 0 0 16px 0;
}

.ways-to-stay {
    margin-bottom: 20px;
}

.way-tag {
    display: inline-block;
    background: linear-gradient(135deg, #e3f2fd 0%, #f3e5f5 100%);
    color: #1565c0;
    padding: 4px 10px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 600;
    margin: 2px 4px 2px 0;
    border: 1px solid rgba(21, 101, 192, 0.2);
}

.view-details {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    display: inline-block;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

.view-details:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    color: white;
    text-decoration: none;
}

/* ===============================================
   LOADING STATES - Enhanced for v0.982
   =============================================== */

.rj-locator-loading-indicator {
    position: absolute;
    top: 15px;
    right: 20px;
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    animation: pulse 2s infinite;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(102, 126, 234, 0.2);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Loading state for grids */
.breakdance-parks-grid.loading,
.rj-locator-grid.loading {
    opacity: 0.7;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.breakdance-parks-grid.loading::after,
.rj-locator-grid.loading::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    z-index: 10;
    pointer-events: none;
}

/* ===============================================
   RESULTS AND ERROR STATES
   =============================================== */

.rj-locator-count {
    text-align: center;
    margin: 20px 0;
    font-weight: 600;
    color: #1a365d;
    font-size: 16px;
}

.rj-locator-no-results {
    text-align: center;
    padding: 60px 20px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 2px dashed #e2e8f0;
    grid-column: 1 / -1;
    width: 100%;
    margin: 20px 0;
}

.rj-locator-no-results h3 {
    color: #4a5568;
    margin-bottom: 8px;
}

.rj-locator-no-results p {
    color: #718096;
    margin: 0;
}

.rj-locator-error {
    background: #fed7d7;
    border: 1px solid #feb2b2;
    color: #c53030;
    padding: 16px;
    border-radius: 8px;
    margin: 20px 0;
    font-weight: 500;
}

.rj-locator-error p {
    margin: 0;
}

/* ===============================================
   DEBUG STYLES - Enhanced for v0.982
   =============================================== */

.rj-locator-debug {
    background: #f0f8ff;
    border: 2px solid #667eea;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    position: relative;
}

.rj-locator-debug::before {
    content: "v0.982";
    position: absolute;
    top: 8px;
    right: 12px;
    background: #667eea;
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
}

.rj-locator-debug h3 {
    color: #1a365d;
    margin-top: 0;
}

.rj-locator-debug ul {
    margin: 10px 0;
    padding-left: 20px;
}

/* Debug indicator for proximity issues */
.proximity-debug {
    position: fixed;
    top: 10px;
    left: 10px;
    background: rgba(255, 0, 0, 0.8);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    z-index: 9999;
    display: none;
}

.proximity-debug.show {
    display: block;
}

/* ===============================================
   RESPONSIVE BREAKPOINTS FOR FALLBACK GRID
   =============================================== */

@media (max-width: 1200px) {
    .rj-locator-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    .rj-locator-grid[data-columns="4"],
    .rj-locator-grid[data-columns="5"] {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .rj-locator-grid,
    .rj-locator-grid[data-columns="2"],
    .rj-locator-grid[data-columns="3"],
    .rj-locator-grid[data-columns="4"],
    .rj-locator-grid[data-columns="5"] {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .park-content {
        padding: 20px;
    }
    
    .park-image {
        height: 180px;
    }
    
    .park-card:hover {
        transform: none;
        box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    }
    
    .view-details:hover {
        transform: none;
    }
}

/* ===============================================
   ACCESSIBILITY - Enhanced for v0.982
   =============================================== */

.locator-filter:focus,
.clear-filters:focus,
.view-details:focus,
.park-card-link-breakdance:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .breakdance-park-card {
        border: 2px solid #000;
    }
    
    .distance-badge-overlay {
        background: #000 !important;
        border: 1px solid #fff;
    }
    
    .amenity-tag {
        border: 2px solid #000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .park-card-link-breakdance:hover {
        transform: none;
    }
    
    .park-hero-image,
    .locator-filter,
    .view-details,
    .clear-filters {
        transition: none;
    }
    
    .carousel-images .park-hero-image {
        transition: none;
    }
}

/* ===============================================
   PRINT STYLES
   =============================================== */

@media print {
    .rj-locator-filters,
    .rj-locator-loading-indicator,
    .rj-locator-error {
        display: none;
    }
    
    .breakdance-parks-grid,
    .rj-locator-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    .breakdance-park-card,
    .park-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    .park-hero-section,
    .park-image {
        height: 200px;
    }
    
    .view-details {
        background: #333;
    }
}