/* =====================================================
   ADDRESS MAP MODAL STYLES
   ===================================================== */

/* Address Modal */
.address-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
}

.address-modal.active {
    display: flex;
}

.address-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.address-modal-content {
    position: relative;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    margin: auto;
    background: white;
    border-radius: 16px;
    overflow-y: auto;
    z-index: 1;
}

.address-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    color: #374151;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 10;
}

.address-modal-close:hover {
    background: rgba(0, 0, 0, 0.2);
    transform: rotate(90deg);
}

.address-modal-title {
    font-size: 20px;
    font-weight: 700;
    color: #1F2937;
    padding: 24px 24px 16px;
    margin: 0;
    border-bottom: 1px solid #E5E7EB;
}

.address-modal-body {
    padding: 24px;
}

/* Map container */
#address-map {
    height: 300px;
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    margin-top: 16px;
    border: 2px solid #E5E7EB;
}

/* Location Search */
.location-search-group {
    margin-bottom: 16px;
}

.location-search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    background: #F9FAFB;
    border: 2px solid #E5E7EB;
    border-radius: 12px;
    padding: 4px 4px 4px 16px;
    transition: all 0.2s;
}

.location-search-input-wrapper:focus-within {
    border-color: #3B5998;
    background: white;
}

.location-search-input-wrapper > i {
    color: #9CA3AF;
    font-size: 14px;
}

.location-search-input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 10px 8px;
    font-size: 14px;
    color: #1F2937;
    outline: none;
}

.location-search-input::placeholder {
    color: #9CA3AF;
}

.btn-search-location {
    padding: 10px 16px;
    background: linear-gradient(135deg, #3B5998 0%, #4A69A8 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
}

.btn-search-location:hover:not(:disabled) {
    background: linear-gradient(135deg, #2D4373 0%, #3B5998 100%);
}

.btn-search-location:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Search Results */
.search-results {
    margin-top: 12px;
    background: white;
    border: 2px solid #E5E7EB;
    border-radius: 12px;
    overflow: hidden;
    max-height: 240px;
    overflow-y: auto;
}

.search-result-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid #F3F4F6;
    transition: all 0.2s;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background: #F9FAFB;
}

.search-result-item i {
    color: #3B5998;
    font-size: 16px;
    margin-top: 2px;
}

.search-result-text {
    flex: 1;
    min-width: 0;
}

.search-result-name {
    font-size: 13px;
    color: #1F2937;
    line-height: 1.5;
}

/* Current location button */
.btn-current-location {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.2);
    margin-bottom: 16px;
}

.btn-current-location:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
}

.btn-current-location:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-current-location i {
    font-size: 16px;
}

/* Selected address display */
.selected-address-display {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    background: #F0F4FF;
    border: 1px solid #3B5998;
    border-radius: 8px;
    margin-top: 12px;
    font-size: 13px;
    color: #1F2937;
    line-height: 1.5;
}

.selected-address-display i {
    color: #3B5998;
    margin-top: 2px;
    flex-shrink: 0;
}

/* Form elements */
.form-group {
    margin-top: 16px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
}

.form-input,
.form-textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #E5E7EB;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.2s;
}

.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: #3B5998;
    box-shadow: 0 0 0 4px rgba(59, 89, 152, 0.1);
}

.form-textarea {
    resize: vertical;
    min-height: 60px;
}

/* Address type toggle */
.address-type-buttons {
    display: flex;
    gap: 12px;
}

.address-type-btn {
    flex: 1;
    padding: 14px 16px;
    border: 2px solid #E5E7EB;
    background: white;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.address-type-btn input[type="radio"] {
    display: none;
}

.address-type-btn i {
    font-size: 24px;
    color: #9CA3AF;
    transition: all 0.2s;
}

.address-type-btn span {
    font-size: 13px;
    font-weight: 600;
    color: #6B7280;
    transition: all 0.2s;
}

.address-type-btn:hover {
    border-color: #D1D5DB;
    background: #F9FAFB;
}

.address-type-btn.active {
    border-color: #3B5998;
    background: #F0F4FF;
}

.address-type-btn.active i {
    color: #3B5998;
}

.address-type-btn.active span {
    color: #3B5998;
}

/* Checkbox */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 8px 0;
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: #3B5998;
    cursor: pointer;
}

.checkbox-text {
    font-size: 14px;
    color: #374151;
    flex: 1;
}

/* Save button */
.btn-save-address {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #3B5998 0%, #4A69A8 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.2s;
    margin-top: 24px;
    box-shadow: 0 4px 12px rgba(59, 89, 152, 0.3);
}

.btn-save-address:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(59, 89, 152, 0.4);
}

.btn-save-address:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-save-address i {
    font-size: 16px;
}

/* Error/Success messages */
.address-error-message {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 13px;
    margin-top: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.address-error-message.error {
    background: #FEE2E2;
    color: #991B1B;
    border: 1px solid #FCA5A5;
}

.address-error-message.success {
    background: #D1FAE5;
    color: #065F46;
    border: 1px solid #6EE7B7;
}

/* Leaflet overrides */
.leaflet-container {
    font-family: inherit;
}

.leaflet-popup-content-wrapper {
    border-radius: 8px;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .address-modal-content {
        width: 95%;
        max-height: 95vh;
    }
    
    .address-modal-title {
        font-size: 18px;
        padding: 20px 20px 14px;
    }
    
    .address-modal-body {
        padding: 20px;
    }
    
    #address-map {
        height: 250px;
    }
    
    .btn-current-location {
        padding: 12px;
        font-size: 13px;
    }
    
    .address-type-btn {
        padding: 12px;
    }
    
    .address-type-btn i {
        font-size: 20px;
    }
    
    .address-type-btn span {
        font-size: 12px;
    }
}

