/* Version 1.4 - Floating Location Button + Nearby Search */

/* General layout for the gym locator container */
.gym-locator-container {
    display: flex;
    height: 70vh; 
    overflow: hidden; 
    margin: 0 auto;
}

/* Sidebar styling */
.gym-locator-sidebar {
    width: 40%;
    background-color: #f8f8f8;
    padding: 20px;
    box-shadow: 2px 0 5px rgba(0,0,0,0.1);
    max-width: 500px; 
    overflow-y: scroll;
}

/* Search bar styling */
.gym-locator-sidebar input[type="text"] {
    width: 100%;
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
}

/* Search button styling */
.gym-locator-sidebar button {
    width: 100%;
    padding: 10px;
    background-color: #F6AF32;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
}

.gym-locator-sidebar button:hover {
    background-color: #F6AF32;
}

/* Gym list container */
#gym-list {
    margin-top: 20px;
}

/* Nearest Location Title */
.nearest-location-title {
    background: linear-gradient(135deg, #F6AF32 0%, #f59e0b 100%);
    color: white;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.nearest-location-title h3 {
    margin: 0;
    font-size: 20px;
    font-weight: bold;
}

/* Distance Info */
.distance-info {
    color: #059669;
    font-size: 15px;
    margin: 8px 0 !important;
    padding: 5px 10px;
    background-color: #d1fae5;
    border-radius: 5px;
    display: inline-block;
}

/* Individual gym item in the list */
.gym-item {
    padding: 10px;
    background-color: #ffffff;
    margin-bottom: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: all 0.3s ease;
}

.gym-item:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

.gym-item h4 {
    margin: 0;
    font-size: 18px;
}

.gym-item p {
    margin: 5px 0 10px;
}

/* Buttons inside each gym item */
.gym-buttons {
    display: inline-flex;
    justify-content: space-between;
    margin-top: 10px;
    margin-left: -10px;
}

.view-gym-btn, .get-directions-btn {
    width: 100%;
    padding: 10px;
    background-color: #F6AF32;
    color: white;
    border-radius: 5px;
    font-size: 16px;
    margin: 0px 10px !important;
}

.view-gym-btn:hover, .get-directions-btn:hover {
    background-color: #F6AF32;
    color: #fff !important;
}

/* Active gym item (highlighted) */
.gym-item.active {
    border: 2px solid #F6AF32;
}

/* Map container */
.gym-locator-map {
    flex-grow: 1;  
    height: 100vh; 
    width: 100%; 
    position: relative;
    z-index: 1 !important;
}

/* Custom marker icon */
.gym-marker {
    background-color: #FE0100;
    border-radius: 50%;
    color: white;
    text-align: center;
    line-height: 40px;
    width: 50px !important;
    height: 50px !important;
    border: 5px solid white;
    font-size: 24px !important;
}

/* User Location Marker */
.user-location-marker {
    background-color: transparent;
    border: none;
}

.user-marker-dot {
    width: 20px;
    height: 20px;
    background-color: #3b82f6;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(59, 130, 246, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0);
    }
}

/* ============================================================
   FEATURE 1: Floating "Turn on Location" red button
   ============================================================ */
#turn-on-location-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 99999;
    background-color: #e53e3e;
    color: #ffffff;
    border: none;
    border-radius: 50px;
    padding: 14px 24px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(229, 62, 62, 0.45);
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
    animation: floatIn 0.4s ease-out;
    width: auto !important;
    line-height: normal !important;
}

#turn-on-location-btn:hover {
    background-color: #c53030;
    transform: translateY(-3px);
    box-shadow: 0 10px 28px rgba(229, 62, 62, 0.55);
}

#turn-on-location-btn:active {
    transform: translateY(0);
    box-shadow: 0 4px 12px rgba(229, 62, 62, 0.4);
}

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

/* Location Popup Overlay */
#location-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    animation: fadeIn 0.3s ease-in-out;
}

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

.location-popup-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
}

.location-popup-content {
    background: white;
    padding: 40px;
    border-radius: 15px;
    max-width: 450px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.4s ease-out;
}

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

.location-popup-content h3 {
    margin: 0 0 15px;
    font-size: 26px;
    color: #1f2937;
}

.location-popup-content p {
    margin: 0 0 25px;
    font-size: 16px;
    color: #6b7280;
    line-height: 1.6;
}

.location-popup-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.btn-allow, .btn-deny {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-allow {
    background-color: #F6AF32;
    color: white;
}

.btn-allow:hover {
    background-color: #d99a28;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(246, 175, 50, 0.3);
}

.btn-deny {
    background-color: #e5e7eb;
    color: #4b5563;
}

.btn-deny:hover {
    background-color: #d1d5db;
}

/* Responsive adjustments */

/* For tablets and smaller screens (max-width: 1024px) */
@media (max-width: 1024px) {
    .gym-locator-container {
        flex-direction: column-reverse; 
        height: auto; 
    }

    .gym-locator-sidebar {
        width: 100%;
        height: 100% !important; 
    }

    .gym-locator-map {
        width: 100%; 
        height: 60vh; 
    }
    
    .location-popup-content {
        padding: 30px;
    }

    #turn-on-location-btn {
        bottom: 20px;
        right: 20px;
        font-size: 14px;
        padding: 12px 20px;
    }
}

/* For mobile devices (max-width: 768px) */
@media (max-width: 768px) {
    .gym-locator-container {
        flex-direction: column-reverse;
        height: auto; 
    }

    .gym-locator-sidebar {
        width: 100vw;
        max-width: 96vw;
        height: 40vh;
    }

    .gym-locator-map {
        width: 100%;
        height: 50vh;
    }
    
    .gym-locator-container {
        overflow: hidden !important;
    }
    
    .location-popup-content {
        padding: 25px;
    }
    
    .location-popup-content h3 {
        font-size: 22px;
    }
    
    .location-popup-buttons {
        flex-direction: column;
    }
    
    .btn-allow, .btn-deny {
        width: 100%;
    }

    #turn-on-location-btn {
        bottom: 15px;
        right: 15px;
        font-size: 13px;
        padding: 11px 18px;
    }
}

/* For small mobile devices (max-width: 480px) */
@media (max-width: 480px) {
    .gym-locator-container {
        overflow: hidden !important;
        flex-direction: column-reverse; 
    }

    .gym-locator-sidebar {
        width: 100%;
        height: 40vh;
    }

    .gym-locator-map {
        width: 100%;
        height: 40vh; 
    }
    
    .location-popup-content {
        padding: 20px;
    }

    #turn-on-location-btn {
        bottom: 10px;
        right: 10px;
        font-size: 13px;
        padding: 10px 16px;
    }
}

.sidebar-marker-number {
    display: none;
}

.gym-marker .marker-number {
    color: white;
    font-weight: bold;
}


/* ── ZIP Code Search: Loading & Error States ─────────────────────── */
.zip-search-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 30px 20px;
    color: #888;
    font-size: 14px;
    gap: 12px;
}

.zip-loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #eee;
    border-top-color: #c0392b;
    border-radius: 50%;
    animation: zip-spin 0.7s linear infinite;
}

@keyframes zip-spin {
    to { transform: rotate(360deg); }
}

.zip-not-found {
    padding: 20px;
    margin-top: 10px;
    background: #fff3f3;
    border: 1px solid #f5c6c6;
    border-radius: 6px;
    color: #c0392b;
    font-size: 14px;
    line-height: 1.5;
}

.zip-not-found p {
    margin: 4px 0;
}
