/* Real Estate Map - Frontend Styles */

/* Variables */
:root {
    --rem-primary: #2563eb;
    --rem-primary-dark: #1d4ed8;
    --rem-secondary: #10b981;
    --rem-dark: #1f2937;
    --rem-light: #f3f4f6;
    --rem-border: #e5e7eb;
    --rem-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --rem-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Container */
.rem-map-container {
    position: relative;
    width: 100%;
    margin: 20px 0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--rem-shadow-lg);
}

/* Filter Panel */
.rem-filter-panel {
    background: linear-gradient(135deg, var(--rem-primary) 0%, var(--rem-primary-dark) 100%);
    padding: 20px;
    color: white;
}

.rem-filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.rem-filter-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.rem-toggle-filter {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.rem-toggle-filter:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.rem-filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.rem-filter-group {
    display: flex;
    flex-direction: column;
}

.rem-filter-group label {
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 14px;
}

.rem-filter-group input,
.rem-filter-group select {
    padding: 10px 12px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    background: white;
    transition: all 0.3s ease;
}

.rem-filter-group input:focus,
.rem-filter-group select:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.3);
}

.rem-filter-actions {
    grid-column: 1 / -1;
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.rem-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    flex: 1;
}

.rem-btn-primary {
    background: white;
    color: var(--rem-primary);
}

.rem-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.rem-btn-secondary {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.rem-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Map */
.rem-map {
    width: 100%;
    z-index: 1;
}

/* Custom Marker Popup */
.leaflet-popup-content-wrapper {
    border-radius: 12px;
    box-shadow: var(--rem-shadow-lg);
    padding: 0;
    overflow: hidden;
}

.leaflet-popup-content {
    margin: 0;
    min-width: 250px;
}

.rem-popup {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.rem-popup-image {
    width: 100%;
    height: 150px;
    object-fit: cover;
}

.rem-popup-content {
    padding: 15px;
}

.rem-popup-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--rem-dark);
    margin: 0 0 10px 0;
}

.rem-popup-price {
    font-size: 18px;
    font-weight: 700;
    color: var(--rem-primary);
    margin-bottom: 8px;
}

.rem-popup-details {
    display: flex;
    gap: 15px;
    margin-bottom: 10px;
    font-size: 13px;
    color: #6b7280;
}

.rem-popup-detail {
    display: flex;
    align-items: center;
    gap: 5px;
}

.rem-popup-address {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 12px;
}

.rem-popup-link {
    display: inline-block;
    background: var(--rem-primary);
    color: white;
    padding: 8px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.rem-popup-link:hover {
    background: var(--rem-primary-dark);
    transform: translateY(-2px);
}

/* Loading */
.rem-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: var(--rem-shadow-lg);
    text-align: center;
    z-index: 1000;
    display: none;
}

.rem-loading.active {
    display: block;
}

.rem-spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto 15px;
    border: 4px solid var(--rem-light);
    border-top: 4px solid var(--rem-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Custom Marker Icon Colors */
.rem-marker-apartment {
    background-color: #3b82f6;
}

.rem-marker-house {
    background-color: #10b981;
}

.rem-marker-villa {
    background-color: #8b5cf6;
}

.rem-marker-land {
    background-color: #f59e0b;
}

.rem-marker-office {
    background-color: #ef4444;
}

/* Responsive */
@media (max-width: 768px) {
    .rem-filters {
        grid-template-columns: 1fr;
    }
    
    .rem-filter-actions {
        flex-direction: column;
    }
    
    .rem-popup-content {
        min-width: 200px;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.rem-filter-panel {
    animation: fadeIn 0.5s ease;
}
