/* Unified Address Sync CSS */
/* Ensures consistent styling across the unified system */

/* Address list styling */
.address-item {
    padding: 0.75rem;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    transition: background-color 0.2s ease;
}

.address-item:hover {
    background-color: #f8f9fa;
}

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

.address-item.selected {
    background-color: #e3f2fd;
    border-left: 4px solid #2196f3;
}

.address-info {
    flex: 1;
    padding-right: 0.5rem;
}

.address-name {
    font-weight: bold;
    margin-bottom: 0.25rem;
    color: #333;
}

.address-details {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
    flex-wrap: wrap;
}

.address-type {
    display: inline-block;
    padding: 0.1rem 0.4rem;
    border-radius: 12px;
    font-size: 0.7em;
    text-transform: uppercase;
    font-weight: bold;
}

.address-type.clinic { background: #d4edda; color: #155724; }
.address-type.pharmacy { background: #d1ecf1; color: #0c5460; }
.address-type.hospital { background: #f8d7da; color: #721c24; }
.address-type.office { background: #fff3cd; color: #856404; }
.address-type.unknown { background: #e2e3e5; color: #495057; }

.geocoding-status {
    display: inline-block;
    padding: 0.1rem 0.4rem;
    border-radius: 12px;
    font-size: 0.7em;
    text-transform: uppercase;
    font-weight: bold;
}

.geocoding-status.success { background: #d4edda; color: #155724; }
.geocoding-status.manual { background: #d1ecf1; color: #0c5460; }
.geocoding-status.failed { background: #f8d7da; color: #721c24; }
.geocoding-status.pending { background: #fff3cd; color: #856404; }
.geocoding-status.unknown { background: #e2e3e5; color: #495057; }

.address-line {
    font-size: 0.9em;
    color: #666;
    line-height: 1.4;
}

.coordinates {
    font-size: 0.8em;
    color: #888;
    font-family: 'Courier New', monospace;
    margin-top: 0.25rem;
}

.address-actions {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    align-items: flex-end;
}

.address-actions input[type="checkbox"] {
    margin-bottom: 0.5rem;
    transform: scale(1.2);
}

.btn-small {
    padding: 0.25rem 0.5rem;
    font-size: 0.8em;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-small:hover {
    background: #f8f9fa;
    border-color: #ccc;
}

.btn-danger {
    color: #dc3545;
    border-color: #dc3545;
}

.btn-danger:hover {
    background: #dc3545;
    color: white;
}

/* Bulk operations styling */
#bulk-operations {
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 0.75rem;
    margin-bottom: 1rem;
    display: none;
}

.selection-count {
    font-weight: bold;
    color: #2196f3;
    margin-right: 1rem;
}

/* Pagination styling */
#address-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    border-top: 1px solid #eee;
    margin-top: 1rem;
}

#address-pagination button {
    padding: 0.5rem 1rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
}

#address-pagination button:hover:not(:disabled) {
    background: #f8f9fa;
    border-color: #2196f3;
}

#address-pagination button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Loading states */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #2196f3;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Infinite scroll indicator */
.infinite-scroll-indicator {
    text-align: center;
    padding: 1rem;
    color: #666;
    font-style: italic;
}

/* Error states */
.error-message {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    padding: 1rem;
    margin: 1rem 0;
    text-align: center;
}

.success-message {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    border-radius: 4px;
    padding: 1rem;
    margin: 1rem 0;
    text-align: center;
}

/* Enhanced marker popup styling */
.marker-popup {
    min-width: 200px;
}

.marker-popup h4 {
    margin: 0 0 0.5rem 0;
    color: #333;
}

.marker-popup p {
    margin: 0.25rem 0;
    font-size: 0.9em;
    color: #666;
}

/* Search and filter controls */
.search-filters {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.search-filters input,
.search-filters select {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9em;
}

.search-filters input {
    flex: 1;
    min-width: 200px;
}

.search-filters select {
    min-width: 120px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .address-item {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .address-actions {
        flex-direction: row;
        align-items: center;
        align-self: stretch;
    }
    
    .search-filters {
        flex-direction: column;
    }
    
    .search-filters input,
    .search-filters select {
        width: 100%;
    }
}

/* Debug info styling */
.debug-info {
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 0.5rem;
    font-family: 'Courier New', monospace;
    font-size: 0.8em;
    color: #666;
    margin: 0.5rem 0;
}

.debug-info.hidden {
    display: none;
}