/* Address Map Styles */

#addressMap {
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #e0e0e0;
}

#addressMap .leaflet-control {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border-radius: 12px;
}

#addressMap .leaflet-marker-draggable {
    cursor: move;
}

.coordinates-display {
    background: linear-gradient(135deg, #f5f7fa 0%, #e8f0f5 100%);
    border-left: 3px solid #667eea;
    padding: 12px;
    border-radius: 12px;
    font-size: 12px;
    margin-top: 10px;
}

.coordinates-display p {
    margin: 5px 0;
}

.coordinates-display strong {
    color: #333;
    font-weight: 600;
}

.coordinates-display .value {
    color: #667eea;
    font-weight: 600;
    font-family: 'Courier New', monospace;
}

.map-instruction {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #666;
    margin-bottom: 10px;
    padding: 10px;
    background: #f0f4f8;
    border-radius: 12px;
}

.map-instruction::before {
    content: '🗺️';
    font-size: 16px;
}

/* RTL Support */
[dir="rtl"] .coordinates-display {
    border-left: none;
    border-right: 3px solid #667eea;
}

[dir="rtl"] .map-instruction {
    direction: rtl;
}

/* Map Theme Panel */
#mapThemePanel {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

#mapThemePanel label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    border-radius: 12px;
    transition: background 0.2s;
    cursor: pointer;
}

#mapThemePanel label:hover {
    background: #f0f0f0;
}

#mapThemePanel label input[type="radio"] {
    margin: 0;
    cursor: pointer;
}

#mapThemePanel label input[type="radio"]:checked + span {
    font-weight: bold;
    color: #007bff;
}

#showThemePanel {
    transition: all 0.2s;
}

#showThemePanel:hover {
    background: #f0f0f0 !important;
    transform: scale(1.05);
}

#toggleThemePanel {
    transition: all 0.2s;
}

#toggleThemePanel:hover {
    background: #0056b3 !important;
}

/* Fullscreen Map Container */
.map-fullscreen-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: white;
    z-index: 9999;
    display: flex;
    flex-direction: column;
}

.map-fullscreen-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    font-weight: bold;
    font-size: 16px;
}

.btn-close-map {
    background: #dc3545;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}

.btn-close-map:hover {
    background: #c82333;
}

.map-fullscreen-btn {
    transition: all 0.2s;
    display: none; /* Hidden by default, shown on mobile via media query */
}

.map-fullscreen-btn:hover {
    background: #f0f0f0 !important;
    transform: scale(1.05);
}

/* Mobile: map smaller so "fields below" is visible + hint strip */
.address-map-mobile-hint {
    display: none;
    padding: 10px 14px;
    background: linear-gradient(180deg, #f0f4f8 0%, #e8eef5 100%);
    border-radius: 12px;
    font-size: 13px;
    color: #555;
    text-align: center;
    border: 1px solid #e0e0e0;
    border-top: none;
    margin-top: -15px;
    margin-bottom: 15px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}
.address-map-mobile-hint::before {
    content: '↓ ';
    font-size: 14px;
    color: #ED582E;
}
[dir="rtl"] .address-map-mobile-hint::before {
    content: ' ↑';
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    .address-map-container {
        height: 220px !important;
        min-height: 200px;
        max-height: 38vh;
    }

    .address-map-mobile-hint {
        display: block;
    }

    .map-wrapper {
        margin-bottom: 8px;
    }
    
    #mapThemePanel {
        max-width: 150px !important;
        font-size: 10px;
    }
    
    #mapThemePanel label {
        font-size: 10px !important;
        padding: 4px !important;
    }
    
    .map-fullscreen-btn {
        display: block !important;
        font-size: 11px;
        padding: 6px 10px;
    }
}

@media (max-width: 480px) {
    .address-map-container {
        height: 200px !important;
        min-height: 180px;
        max-height: 35vh;
    }

    .coordinates-display {
        font-size: 11px;
    }
    
    .map-fullscreen-btn {
        font-size: 10px;
        padding: 5px 8px;
    }
    
    .map-fullscreen-header {
        padding: 10px;
        font-size: 14px;
    }
    
    .btn-close-map {
        padding: 6px 12px;
        font-size: 12px;
    }
}

.modal.address-confirm-modal,
.modal.address-confirm-modal.show {
    z-index: 9999 !important;
}
.modal-backdrop.address-confirm-backdrop {
    z-index: 9998 !important;
}
