/**
 * Public styles for Franchise Directory
 */

/* ==========================================
   Location Search & Map Styles
   DESIGNER CUSTOMIZATION GUIDE
   ==========================================
   
   To customize colors, edit the CSS variables below.
   Default theme: Dark Navy Blue with Red Accents
   
   COLOR VARIABLES:
   --ld-bg-primary: Main background (dark navy)
   --ld-bg-secondary: Secondary background (lighter navy)
   --ld-bg-input: Input field background
   --ld-border: Border color
   --ld-accent: Primary accent/button color (red)
   --ld-accent-hover: Button hover state
   --ld-text-primary: Main text color
   --ld-text-secondary: Secondary/muted text
   --ld-text-link: Link color
   ========================================== */

.ld-location-search,
.ld-search-results,
.ld-location-map-wrapper {
    /* CUSTOMIZE COLORS HERE - Change these hex values */
    --ld-bg-primary: #0a1929;      /* Dark navy background */
    --ld-bg-secondary: #0d2137;    /* Slightly lighter navy */
    --ld-bg-input: #0d2137;        /* Input field background */
    --ld-border: #1e3a5f;          /* Border color */
    --ld-accent: #c41e3a;          /* Red accent/buttons */
    --ld-accent-hover: #e0284a;    /* Button hover */
    --ld-accent-rgb: 196, 30, 58;  /* RGB values for shadows */
    --ld-service-area: #3b82f6;    /* Blue for service area markers */
    --ld-user-location: #22c55e;   /* Green for user GPS marker */
    --ld-text-primary: #ffffff;    /* White text */
    --ld-text-secondary: #a0c4d9;  /* Light blue-gray text */
    --ld-text-muted: #6b8fa3;      /* Muted text */
    --ld-text-link: #c41e3a;       /* Link color */
}

/* Search Form Styles */
.ld-location-search {
    max-width: 800px;
    margin: 20px 0;
    background: var(--ld-bg-primary);
    padding: 30px;
    border-radius: 8px;
    color: var(--ld-text-primary);
}

.ld-search-form {
    position: relative;
}

.ld-search-input-wrap {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.ld-search-input {
    flex: 1;
    min-width: 200px;
    padding: 14px 18px;
    font-size: 16px;
    border: 2px solid var(--ld-border);
    border-radius: 6px;
    background: var(--ld-bg-secondary);
    color: var(--ld-text-primary);
    transition: all 0.2s;
}

.ld-search-input::placeholder {
    color: var(--ld-text-muted);
}

.ld-search-input:focus {
    outline: none;
    border-color: var(--ld-accent);
    background: var(--ld-bg-secondary);
}

.ld-search-radius {
    padding: 14px 18px;
    font-size: 16px;
    border: 2px solid var(--ld-border);
    border-radius: 6px;
    background: var(--ld-bg-secondary);
    color: var(--ld-text-primary);
    cursor: pointer;
    transition: all 0.2s;
}

.ld-search-radius:focus {
    outline: none;
    border-color: var(--ld-accent);
}

.ld-search-button {
    padding: 14px 32px;
    background: var(--ld-accent);
    color: var(--ld-text-primary);
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ld-search-button:hover {
    background: var(--ld-accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(196, 30, 58, 0.3);
}

.ld-search-button:disabled {
    background: var(--ld-border);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.ld-search-error {
    margin-top: 15px;
    padding: 12px 18px;
    background: rgba(196, 30, 58, 0.15);
    border: 1px solid var(--ld-accent);
    color: var(--ld-accent-hover);
    border-radius: 6px;
}

/* Search Results - Dark Navy Blue Theme */
.ld-search-results {
    margin-top: 30px;
    background: var(--ld-bg-secondary);
    border-radius: 8px;
    border: 1px solid var(--ld-border);
    color: var(--ld-text-primary);
    display: flex;
    flex-direction: column;
    max-height: 600px; /* Total max height for the entire results container */
}

.ld-search-results h3 {
    margin: 0;
    padding: 20px 25px;
    color: var(--ld-text-primary);
    font-size: 1.4em;
    font-weight: 600;
    border-bottom: 2px solid var(--ld-accent);
    flex-shrink: 0; /* Keep header fixed */
}

/* Scrollable container for the location list */
.ld-search-results-scrollable {
    overflow-y: auto;
    max-height: 500px; /* Scrollable area max height */
    padding: 20px 25px;
}

/* Custom scrollbar styling for webkit browsers */
.ld-search-results-scrollable::-webkit-scrollbar {
    width: 8px;
}

.ld-search-results-scrollable::-webkit-scrollbar-track {
    background: var(--ld-bg-primary);
    border-radius: 4px;
}

.ld-search-results-scrollable::-webkit-scrollbar-thumb {
    background: var(--ld-border);
    border-radius: 4px;
}

.ld-search-results-scrollable::-webkit-scrollbar-thumb:hover {
    background: var(--ld-accent);
}

.ld-location-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.ld-location-item {
    padding: 20px;
    margin-bottom: 20px;
    background: var(--ld-bg-primary);
    border: 1px solid var(--ld-border);
    border-radius: 8px;
    transition: all 0.2s;
    cursor: pointer;
    position: relative;
}

.ld-location-item:hover {
    border-color: var(--ld-accent);
    box-shadow: 0 4px 12px rgba(196, 30, 58, 0.15);
    transform: translateY(-2px);
}

.ld-location-arrow {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.5em;
    color: var(--ld-accent);
    opacity: 0;
    transition: all 0.2s;
}

.ld-location-item:hover .ld-location-arrow {
    opacity: 1;
    right: 15px;
}

.ld-location-item h4 {
    margin: 0 0 12px;
    font-size: 1.3em;
}

.ld-location-item h4 a {
    color: var(--ld-text-primary);
    text-decoration: none;
    transition: color 0.2s;
}

.ld-location-item h4 a:hover {
    color: var(--ld-accent);
}

.ld-location-distance {
    font-size: 1em;
    color: var(--ld-accent);
    font-weight: 600;
    margin: 0 0 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ld-location-distance::before {
    content: '📍';
    font-size: 0.9em;
}

/* GPS distance - from user's current location */
.ld-location-gps-distance {
    font-size: 0.9em;
    color: var(--ld-text-muted);
    margin: 4px 0 10px;
    font-style: italic;
}

.ld-location-gps-distance .ld-gps-icon {
    margin-right: 4px;
}

.ld-location-address,
.ld-location-phone {
    margin: 0 0 8px;
    color: var(--ld-text-secondary);
    font-size: 1em;
}

.ld-location-phone a {
    color: var(--ld-accent);
    text-decoration: none;
    font-weight: 500;
}

.ld-location-phone a:hover {
    text-decoration: underline;
}

.ld-location-cities {
    margin: 15px 0 0;
    padding-top: 15px;
    border-top: 1px solid var(--ld-border);
    font-size: 0.95em;
    color: var(--ld-text-muted);
}

.ld-location-cities strong {
    color: var(--ld-accent);
}

.ld-no-results {
    padding: 25px;
    background: rgba(196, 30, 58, 0.1);
    border: 1px solid var(--ld-accent);
    color: var(--ld-text-primary);
    border-radius: 8px;
    text-align: center;
}

/* ==========================================
   Google Maps Styles - Dark Navy Blue Theme
   ========================================== */

.fd-location-map-wrapper {
    margin: 20px 0;
    position: relative;
    z-index: 1;
}

.ld-location-map {
    min-height: 450px;
    background: var(--ld-bg-primary);
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
    border: 2px solid var(--ld-border);
}

/* Toggle border and shadow via admin settings */
.ld-location-map.ld-map-no-border {
    border: none !important;
}

.ld-location-map.ld-map-no-shadow {
    box-shadow: none !important;
}

.ld-map-search {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    background: var(--ld-bg-primary);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid var(--ld-border);
}

.ld-map-search-input {
    flex: 1;
    padding: 12px 18px;
    font-size: 16px;
    border: 2px solid var(--ld-border);
    border-radius: 6px;
    background: var(--ld-bg-secondary);
    color: var(--ld-text-primary);
}

.ld-map-search-input::placeholder {
    color: var(--ld-text-muted);
}

.ld-map-search-input:focus {
    outline: none;
    border-color: var(--ld-accent);
}

.ld-map-search-btn {
    padding: 12px 24px;
    background: var(--ld-accent);
    color: var(--ld-text-primary);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.2s;
}

.ld-map-search-btn:hover {
    background: var(--ld-accent-hover);
    box-shadow: 0 4px 12px rgba(196, 30, 58, 0.3);
}

.ld-map-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(10, 25, 41, 0.95);
    color: var(--ld-text-primary);
    padding: 25px 35px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
    z-index: 10;
    border: 1px solid var(--ld-border);
}

.ld-map-error {
    padding: 25px;
    background: rgba(196, 30, 58, 0.15);
    border: 1px solid var(--ld-accent);
    color: var(--ld-text-primary);
    border-radius: 8px;
    text-align: center;
}

.ld-map-no-locations {
    padding: 40px 25px;
    background: var(--ld-bg-secondary);
    border: 2px dashed var(--ld-border);
    color: var(--ld-text-secondary);
    text-align: center;
    border-radius: 8px;
}

/* Custom Map Pins */
.ld-map-pin {
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translate(-50%, -100%);
    transition: transform 0.2s ease;
    user-select: none;
}

.ld-map-pin:hover {
    transform: translate(-50%, -100%) scale(1.2);
}

/* Location marker (RED) */
.ld-map-pin-red {
    color: var(--ld-accent);
}

/* Service area marker (BLUE circle) */
.ld-map-pin-blue,
.ld-map-pin-service {
    color: var(--ld-service-area);
}

/* Search center marker (RED accent) */
.ld-map-pin-center {
    color: var(--ld-accent-hover);
}

/* User location marker (GREEN) */
.ld-map-pin-user {
    color: var(--ld-user-location);
}

/* ==========================================
   Google Maps Info Window Styling
   ========================================== */

/* Main container (bounding box) - red to match header */
.gm-style .gm-style-iw-c {
    padding: 0 !important;
    border-radius: 12px !important;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5) !important;
    max-width: 360px !important;
    background: var(--ld-accent) !important;
    overflow: visible !important;
}

/* Inner container - transparent to show red background */
.gm-style .gm-style-iw-c > div {
    background: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* Content area - transparent */
.gm-style .gm-style-iw-d {
    overflow: visible !important;
    padding: 0 !important;
    background: transparent !important;
}

/* Remove the tail/arrow */
.gm-style .gm-style-iw-t::after {
    display: none !important;
}

/* Close button - simple white X, no circle */
.gm-style .gm-style-iw-c button.gm-ui-hover-effect {
    background: transparent !important;
    top: 8px !important;
    right: 8px !important;
    width: 24px !important;
    height: 24px !important;
    opacity: 1 !important;
    cursor: pointer !important;
    z-index: 99999 !important;
    position: absolute !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.gm-style .gm-style-iw-c button.gm-ui-hover-effect:hover {
    opacity: 0.8 !important;
}

/* White X icon using ::before */
.gm-style .gm-style-iw-c button.gm-ui-hover-effect::before {
    content: '×' !important;
    color: #fff !important;
    font-size: 20px !important;
    font-weight: bold !important;
    line-height: 1 !important;
    display: block !important;
}

/* Hide the default Google X image */
.gm-style .gm-style-iw-c button.gm-ui-hover-effect img {
    display: none !important;
}

/* Ensure links in info window are clickable */
.ld-map-info-window a {
    position: relative;
    z-index: 10;
}

.ld-map-info-window .ld-map-actions {
    position: relative;
    z-index: 20;
}

/* Muted text style for info window */
.ld-map-info-window .ld-text-muted {
    color: var(--ld-text-muted);
    font-size: 0.85em;
    font-style: italic;
    margin-top: 10px;
}

/* Info Window Styles - Fancy Dark Theme */
.ld-map-info-window {
    max-width: 340px;
    min-width: 280px;
    padding: 0;
    background: transparent;
    color: var(--ld-text-primary);
    border-radius: 12px;
    overflow: hidden;
    margin: 0;
}

/* Header - minimal padding since container is red */
.ld-map-info-window .ld-info-header {
    background: transparent;
    padding: 12px 40px 12px 16px;
    position: relative;
}

.ld-map-info-window h4 {
    margin: 0;
    font-size: 1.1em;
    color: #fff;
    font-weight: 600;
    line-height: 1.3;
}

.ld-map-info-window h4 a {
    color: #fff;
    text-decoration: none;
}

.ld-map-info-window h4 a:hover {
    text-decoration: underline;
}

/* Body - dark background */
.ld-map-info-window .ld-info-body {
    background: var(--ld-bg-primary);
    padding: 16px;
}

.ld-map-info-window p {
    margin: 0 0 10px;
    font-size: 0.95em;
    color: var(--ld-text-secondary);
    line-height: 1.4;
}

.ld-map-info-window p:last-child {
    margin-bottom: 0;
}

.ld-map-info-window .ld-map-address {
    color: var(--ld-text-secondary);
}

.ld-map-info-window .ld-map-phone {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ld-map-info-window .ld-map-phone a {
    color: var(--ld-accent);
    text-decoration: none;
    font-weight: 600;
}

.ld-map-info-window .ld-map-phone a:hover {
    text-decoration: underline;
}

.ld-map-info-window .ld-map-service-areas {
    margin: 12px 0;
    padding: 10px 12px;
    background: var(--ld-bg-secondary);
    border-radius: 6px;
    font-size: 0.85em;
    color: var(--ld-text-secondary);
    border: 1px solid var(--ld-border);
}

.ld-map-info-window .ld-map-actions {
    margin-top: 15px;
    padding-top: 12px;
    border-top: 1px solid var(--ld-border);
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.ld-map-info-window .ld-map-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--ld-accent);
    color: #fff;
    font-weight: 600;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.2s;
    flex: 1;
    justify-content: center;
    min-width: 100px;
}

.ld-map-info-window .ld-map-link:hover {
    background: var(--ld-accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(196, 30, 58, 0.3);
    text-decoration: none;
}

.ld-map-info-window .ld-map-visit::before {
    content: '→';
    font-size: 1.1em;
}

/* Map Center Pin Styles */
.ld-map-center-info {
    background: var(--ld-bg-secondary);
    border-left: 4px solid var(--ld-accent);
    color: var(--ld-text-primary);
}

.ld-map-center-info h4 {
    color: var(--ld-accent);
    margin: 0 0 8px;
}

.ld-map-center-info p {
    margin: 4px 0;
    color: var(--ld-text-secondary);
}

/* ============================================
   TESTIMONIALS
   ============================================ */

.ld-testimonials {
    margin: 20px 0;
}

.ld-testimonial {
    display: flex;
    gap: 20px;
    padding: 20px;
    background: #f6f7f7;
    border-radius: 4px;
    margin-bottom: 20px;
}

.ld-testimonial-image img {
    border-radius: 50%;
    width: 100px;
    height: 100px;
    object-fit: cover;
}

.ld-testimonial-content h4 {
    margin-top: 0;
    margin-bottom: 10px;
}

/* ============================================
   VENDORS
   ============================================ */

.ld-vendors {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.ld-vendor {
    padding: 20px;
    background: #f6f7f7;
    border-radius: 4px;
    border: 1px solid #c3c4c7;
}

.ld-vendor h4 {
    margin-top: 0;
    margin-bottom: 10px;
}

/* ============================================
   SERVICES
   ============================================ */

.ld-services {
    margin: 20px 0;
}

.ld-service {
    padding: 20px;
    border-bottom: 1px solid #f0f0f1;
}

.ld-service:last-child {
    border-bottom: none;
}

.ld-service h4 {
    margin-top: 0;
}

.ld-service h4 a {
    color: #2271b1;
    text-decoration: none;
}

.ld-service h4 a:hover {
    text-decoration: underline;
}

/* ============================================
   CITIES
   ============================================ */

.ld-cities ul {
    list-style: none;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
}

.ld-cities li {
    padding: 5px 0;
}

.ld-cities a {
    color: #2271b1;
    text-decoration: none;
}

.ld-cities a:hover {
    text-decoration: underline;
}

/* ============================================
   VIRTUAL PAGE TEMPLATES
   ============================================ */

.ld-city-page,
.ld-service-page,
.ld-contact-page {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.ld-city-header,
.ld-service-header,
.ld-contact-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f1;
}

.ld-city-title,
.ld-service-title,
.ld-contact-title {
    font-size: 32px;
    margin-bottom: 10px;
}

.ld-city-content,
.ld-service-content {
    line-height: 1.6;
}

.ld-city-section {
    margin: 30px 0;
}

.ld-service-cta {
    margin: 30px 0;
    padding: 20px;
    background: #f6f7f7;
    text-align: center;
    border-radius: 4px;
}

.ld-contact-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.ld-contact-item {
    padding: 15px;
    background: #f6f7f7;
    border-radius: 4px;
}

.ld-contact-item h3 {
    margin-top: 0;
    font-size: 16px;
    color: #646970;
}

.ld-back-link {
    display: inline-block;
    margin-top: 20px;
    color: #2271b1;
    text-decoration: none;
}

.ld-back-link:hover {
    text-decoration: underline;
}

/* ============================================
   RESPONSIVE STYLES
   ============================================ */

@media (max-width: 768px) {
    .ld-search-input-wrap {
        flex-direction: column;
    }
    
    .ld-search-input,
    .ld-search-radius,
    .ld-search-button {
        width: 100%;
    }
    
    .ld-location-item {
        padding: 16px;
    }
    
    .ld-location-arrow {
        display: none;
    }

    .ld-map-search {
        flex-direction: column;
    }
    
    .ld-map-search-btn {
        width: 100%;
    }
}
