/**
 * Longdoo Map Cluster CSS
 * สไตล์สำหรับแผนที่ Longdoo พร้อม cluster marker จากตำแหน่งตัวแทนจำหน่าย
 */

/* สีหลักที่ใช้ในเว็บไซต์ */
:root {
    --rosso-corsa: #d40000;
    --rosso-corsa-dark: #a80000;
    --rosso-corsa-light: #ff3333;
    --rosso-corsa-transparent: rgba(212, 0, 0, 0.1);
    --text-color: #333;
    --light-gray: #f5f5f5;
    --medium-gray: #e0e0e0;
    --dark-gray: #666;
    --teal: #00998e;
    --teal-dark: #00766c;
}

/* Map wrapper */
.longdoo-map-wrapper {
    max-width: 1200px;
    margin: 30px auto;
    font-family: 'Prompt', 'Kanit', sans-serif;
    color: #333;
}

/* Search bar */
.longdoo-search-bar {
    display: flex;
    margin-bottom: 15px;
    width: 100%;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

#longdoo-map-search {
    flex-grow: 1;
    padding: 12px 15px;
    border: 1px solid #e0e0e0;
    border-right: none;
    border-radius: 8px 0 0 8px;
    font-size: 16px;
    outline: none;
    transition: border-color 0.2s;
}

#longdoo-map-search:focus {
    border-color: var(--rosso-corsa);
}

#longdoo-map-search-btn {
    background-color: var(--rosso-corsa);
    color: white;
    border: none;
    padding: 12px 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

#longdoo-map-search-btn:hover {
    background-color: var(--rosso-corsa-dark);
}

/* Dealer count display */
.longdoo-map-count {
    margin-bottom: 15px;
    font-size: 14px;
    color: #666;
    text-align: right;
}

/* Map container */
#longdoo-map-container {
    position: relative;
    width: 100%;
    height: 600px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 15px;
}

/* The map itself */
#longdoo-map {
    width: 100%;
    height: 100%;
}

/* Loading indicator */
#longdoo-map-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10;
}

#longdoo-map-loading p {
    margin-top: 15px;
    color: #666;
    font-size: 16px;
}

/* Spinner animation */
.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(208, 0, 0, 0.2);
    border-radius: 50%;
    border-top-color: var(--rosso-corsa);
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Info below map */
.longdoo-map-info {
    margin-top: 15px;
    text-align: center;
    color: #666;
    font-size: 14px;
}

/* Custom dealer popup styling */
.dealer-popup {
    padding: 15px;
    max-width: 300px;
    font-family: 'Prompt', 'Kanit', sans-serif;
}

.dealer-popup h3 {
    margin: 0 0 10px 0;
    color: var(--rosso-corsa);
    font-size: 18px;
    font-weight: bold;
    border-bottom: 2px solid var(--rosso-corsa);
    padding-bottom: 5px;
}

.dealer-popup p {
    margin: 5px 0;
    font-size: 14px;
    color: var(--text-color);
    line-height: 1.5;
}

.dealer-popup p strong {
    color: #444;
    font-weight: bold;
}

/* ปุ่มดูเพิ่มเติม */
.dealer-more-btn {
    display: inline-block;
    width: 100%;
    padding: 8px 15px;
    margin-top: 10px;
    background-color: var(--rosso-corsa);
    color: white !important;
    text-decoration: none !important;
    border-radius: 4px;
    font-size: 14px;
    font-weight: bold;
    text-align: center;
    transition: background-color 0.2s;
    border: none;
    cursor: pointer;
}

.dealer-more-btn:hover {
    background-color: var(--rosso-corsa-dark);
    text-decoration: none !important;
}

/* ปุ่มย้ายหมุด */
.dealer-move-pin-btn {
    display: block;
    margin-top: 10px;
    padding: 5px 10px;
    background-color: var(--teal);
    color: white;
    text-decoration: none;
    border: none;
    border-radius: 3px;
    font-size: 12px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.dealer-move-pin-btn:hover {
    background-color: var(--teal-dark);
}

/* Pin Movement Controls */
.pin-move-controls {
    display: none;
    position: absolute;
    top: 15px;
    left: 15px;
    right: 15px;
    background-color: rgba(255, 255, 255, 0.9);
    border: 2px solid var(--teal);
    border-radius: 4px;
    padding: 15px;
    z-index: 1000;
}

.pin-move-controls.active {
    display: block;
}

.pin-move-message {
    margin-bottom: 15px;
    font-weight: bold;
    color: var(--teal);
    text-align: center;
    font-size: 14px;
}

.pin-move-buttons {
    display: flex;
    justify-content: space-between;
}

.pin-move-save {
    background-color: var(--teal);
    margin-top: 0;
    flex: 1;
    margin-right: 10px;
}

.pin-move-save:hover {
    background-color: var(--teal-dark);
}

.pin-move-cancel {
    background-color: var(--rosso-corsa);
    margin-top: 0;
    flex: 1;
}

.pin-move-cancel:hover {
    background-color: var(--rosso-corsa-dark);
}

.longdoo-map-btn {
    display: inline-block;
    padding: 8px 15px;
    color: white;
    text-decoration: none;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s;
}

/* Longdo Map popup customization */
.ldmap-popup .ldmap-popup-content {
    padding: 0 !important;
    overflow: hidden;
    border-radius: 8px;
    max-width: 300px !important;
}

.ldmap-popup .ldmap-popup-close-button {
    color: var(--rosso-corsa);
    top: 10px;
    right: 10px;
    font-size: 20px;
    opacity: 0.8;
    z-index: 100;
}

.ldmap-popup .ldmap-popup-close-button:hover {
    opacity: 1;
}

.ldmap-popup-content {
    overflow-y: auto !important;
    max-height: 400px !important;
}

/* Map cluster custom styling */
.ldmap-cluster-marker {
    background-color: var(--rosso-corsa) !important;
    color: white !important;
    border-radius: 50%;
    text-align: center;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    #longdoo-map-container {
        height: 400px;
    }
    
    .longdoo-search-bar {
        flex-direction: column;
        box-shadow: none;
    }
    
    #longdoo-map-search {
        border-radius: 8px;
        border: 1px solid #e0e0e0;
        margin-bottom: 10px;
    }
    
    #longdoo-map-search-btn {
        border-radius: 8px;
        width: 100%;
    }
    
    .longdoo-map-count {
        text-align: center;
    }
    
    .pin-move-controls {
        top: 10px;
        left: 10px;
        right: 10px;
        padding: 10px;
    }
    
    .pin-move-message {
        font-size: 12px;
    }
    
    .longdoo-map-btn {
        font-size: 12px;
        padding: 8px 12px;
    }
}

@media (max-width: 480px) {
    #longdoo-map-container {
        height: 350px;
    }
    
    .longdoo-map-wrapper {
        margin: 15px auto;
    }
    
    .dealer-popup {
        max-width: 250px;
    }
}