/**
 * Concrete Decor - Google Maps Styles
 * Version: 1.0.0
 */

/* Map Wrapper */
.concrete-map-wrapper {
    position: relative;
    width: 100%;
    margin: 20px 0;
    font-family: 'Kanit', sans-serif;
}

/* Map Controls */
.concrete-map-controls {
    margin-bottom: 15px;
}

/* Search Container */
.search-container {
    position: relative;
    margin-bottom: 15px;
}

/* Search Input Wrapper */
.search-input-wrapper {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 30px;
    padding: 0;
}

/* Custom Dropdown */
.custom-dropdown {
    flex-shrink: 0;
    position: relative;
    min-width: 250px;
    -webkit-user-select: none;
    user-select: none;
}

.custom-dropdown-selected {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    font-size: 20px;
    font-family: 'Kanit', sans-serif;
    font-weight: 500;
    border: 1px solid #000;
    border-radius: 64px;
    background-color: #ffffff;
    color: #000;
    cursor: pointer;
    transition: all 0.3s ease;
}

.custom-dropdown-selected:hover {
    border-color: #2c5530;
}

.custom-dropdown.open .custom-dropdown-selected {
    border-color: #2c5530;
    box-shadow: 0 0 0 3px rgba(44, 85, 48, 0.1);
}

.dropdown-arrow {
    font-size: 12px;
    color: #666;
    transition: transform 0.3s ease;
}

.custom-dropdown.open .dropdown-arrow {
    transform: rotate(180deg);
}

.custom-dropdown-options {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    right: 0;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 43px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.custom-dropdown.open .custom-dropdown-options {
    display: block;
    padding: 20px 45px;
}

.custom-dropdown-option {
    font-size: 20px;
    font-family: 'Kanit', sans-serif;
    color: #333;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 10px;
}

.custom-dropdown-option:hover {
    background: transparent !important;
    color: #C82029 !important;
}

.custom-dropdown-option.selected {
    background: transparent !important;
    color: #C82029;
    font-weight: 500;
}

/* Legacy dropdown (hidden) */
.country-dropdown-inline {
    flex-shrink: 0;
    padding: 14px 20px;
    font-size: 20px;
    font-family: 'Kanit', sans-serif;
    font-weight: 500;
    border: 1px solid #000;
    border-radius: 64px;
    background-color: #fff;
    color: #000;
    cursor: pointer;
    outline: none;
    min-width: 180px;
    appearance: none;
    background-image: url('data:image/svg+xml;charset=UTF-8,%3csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"%3e%3cpolyline points="6 9 12 15 18 9"%3e%3c/polyline%3e%3c/svg%3e');
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 16px;
    padding-right: 35px;
    transition: border-color 0.3s ease;
}

.country-dropdown-inline > option {
    padding: 20px;
    background: #ffffff;
    color: #333;
}

/* Firefox only - hover effect on options */
.country-dropdown-inline > option:hover {
    background: transparent !important;
    color: #C82029 !important;
}

/* Selected option */
.country-dropdown-inline > option:checked {
    background: transparent !important;
    color: #C82029;
    font-weight: 500;
}

/* Search Input Container with Icon */
.search-input-container {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    border: 1px solid #000;
    border-radius: 64px;
    background: #fff;
}

.search-icon {
    position: absolute;
    left: 15px;
    color: #999;
    font-size: 16px;
    pointer-events: none;
}

/* Search Input Inline */
.branch-search-input-inline {
    flex: 1;
    padding: 14px 15px 14px 45px;
    font-size: 20px;
    font-family: 'Kanit', sans-serif;
    border: none;
    outline: none;
    width: 100%;
    background: transparent;
    border-radius: 64px;;
}

.branch-search-input-inline::placeholder {
    color: #999;
}

/* Clear Search Button */
.clear-search-btn {
    flex-shrink: 0;
    padding: 0 15px;
    background: none;
    border: none;
    color: #999;
    font-size: 18px;
    cursor: pointer;
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.clear-search-btn:hover {
    color: #000;
}

/* Search Results Dropdown */
.search-results-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    left: 280px;
    right: 0;
    background: #ffffff;
    border-radius: 64px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
    padding: 20px 45px;
}

.results-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.result-category-header {
    color: #000;
    font-size: 20px;
    font-weight: bold;
    position: sticky;
    top: 0;
    z-index: 10;
    margin: 20px 0px 5px;
}

.result-item {
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 10px;
}

.result-item:last-child {
    border-bottom: none;
}

.result-item:hover,
.result-item.active {
    color:#C82029;
}

.result-item-name {
    font-weight: 500;
    color: #1a1a1a;
    font-size: 15px;
    line-height: 1.4;
}

.result-item-details {
    font-size: 13px;
    color: #666;
    line-height: 1.4;
}

.result-item-type {
    display: inline-block;
    padding: 3px 10px;
    background: #e8f5e9;
    color: #C82029;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    margin-right: 8px;
}

.no-results {
    padding: 20px;
    text-align: center;
    color: #999;
    font-size: 14px;
}

/* Search Bar Container (Legacy - Hidden) */
.search-bar-container {
    display: none;
}

/* Country Selector (Legacy - Hidden) */
.country-selector {
    display: none;
}

/* Location Selector */
.location-selector {
    margin-bottom: 15px;
}

.location-selector label {
    display: block;
    font-weight: 500;
    color: #C82029;
    margin-bottom: 8px;
    font-size: 16px;
}

.location-selector i {
    margin-right: 8px;
    color: #C82029;
}

.branch-count {
    font-weight: 400;
    color: #666;
    font-size: 14px;
}

.branch-dropdown {
    width: 100%;
    padding: 12px 15px;
    font-size: 16px;
    font-family: 'Kanit', sans-serif;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    background-color: #ffffff;
    cursor: pointer;
    transition: all 0.3s ease;
}

.branch-dropdown:hover {
    border-color: #2c5530;
}

.branch-dropdown:focus {
    outline: none;
    border-color: #2c5530;
    box-shadow: 0 0 0 3px rgba(44, 85, 48, 0.1);
}

/* Location Filter */
.location-filter {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.location-filter label {
    font-weight: 500;
    color: #2c5530;
    font-size: 16px;
    margin-right: 10px;
}

.location-filter i {
    margin-right: 8px;
}

.filter-btn {
    padding: 8px 16px;
    background: #f5f5f5;
    border: 2px solid #e0e0e0;
    border-radius: 20px;
    font-family: 'Kanit', sans-serif;
    font-size: 14px;
    font-weight: 400;
    color: #666;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    background: #e8f5e9;
    border-color: #6b9a6e;
    color: #2c5530;
}

.filter-btn.active {
    background: #2c5530;
    border-color: #2c5530;
    color: #ffffff;
    font-weight: 500;
}

/* Google Map */
.concrete-google-map {
    width: 100%;
    min-height: 400px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Google Map Info Window Styles */
.gmap-info-window {
    font-family: 'Kanit', sans-serif;
    min-width: 280px;
    max-width: 320px;
}

.gmap-info-header {
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e0e0e0;
}

.gmap-info-title {
    margin: 0 0 6px 0;
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
    line-height: 1.4;
}

.gmap-info-badge {
    display: inline-block;
    padding: 4px 10px;
    background: #e8f5e9;
    color: #2c5530;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.gmap-info-body {
    margin-bottom: 12px;
}

.gmap-info-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 8px;
    font-size: 14px;
    color: #666;
    line-height: 1.5;
}

.gmap-info-row:last-child {
    margin-bottom: 0;
}

.gmap-info-row i {
    flex-shrink: 0;
    width: 16px;
    color: #2c5530;
    font-size: 14px;
    margin-top: 2px;
}

.gmap-info-row a {
    color: #1a73e8;
    text-decoration: none;
}

.gmap-info-row a:hover {
    text-decoration: underline;
}

.gmap-info-footer {
    padding-top: 12px;
    border-top: 1px solid #e0e0e0;
}

.gmap-directions-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #1a73e8;
    color: #ffffff;
    border-radius: 20px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.3s ease;
}

.gmap-directions-btn:hover {
    background: #1557b0;
}

.gmap-directions-btn i {
    font-size: 14px;
}

/* Override Google Maps default info window styles */
.gm-style .gm-style-iw-c {
    padding: 16px !important;
    border-radius: 8px !important;
    box-shadow: 0 2px 7px 1px rgba(0,0,0,0.3) !important;
}

.gm-style .gm-style-iw-d {
    overflow: auto !important;
    max-height: none !important;
}

.gm-style .gm-style-iw-t::after {
    background: linear-gradient(45deg,rgba(255,255,255,1) 50%,rgba(255,255,255,0) 51%,rgba(255,255,255,0) 100%) !important;
}

/* Close button styling */
.gm-style button.gm-ui-hover-effect {
    top: 8px !important;
    right: 8px !important;
    width: 28px !important;
    height: 28px !important;
}

/* Info Window Custom Styles (Legacy - kept for compatibility) */
.map-info-window h3 {
    font-family: 'Kanit', sans-serif !important;
}

.map-info-window p {
    font-family: 'Kanit', sans-serif !important;
}

.map-info-window .directions-link:hover {
    text-decoration: underline !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    .concrete-map-controls {
        padding: 15px;
    }

    .search-bar-container {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .country-selector,
    .branch-search {
        width: 100%;
    }

    .location-filter {
        flex-direction: column;
        align-items: flex-start;
    }

    .filter-btn {
        font-size: 13px;
        padding: 6px 12px;
    }

    .location-info-panel {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        max-width: 100%;
        border-radius: 12px 12px 0 0;
        animation: slideInUp 0.3s ease;
    }

    @keyframes slideInUp {
        from {
            opacity: 0;
            transform: translateY(20px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .concrete-google-map {
        min-height: 350px;
    }
}

@media (max-width: 480px) {
    .search-bar-container {
        padding-bottom: 15px;
    }

    .country-dropdown,
    .branch-search-input,
    .branch-dropdown {
        font-size: 14px;
        padding: 10px 12px;
    }

    .branch-search-input {
        padding-left: 38px;
        background-size: 16px;
        background-position: 10px center;
    }

    .location-selector label,
    .location-filter label,
    .country-selector label,
    .branch-search label {
        font-size: 14px;
    }

    .concrete-google-map {
        min-height: 300px;
    }
}
