/* 1. Global Setup */
body {
    margin: 0;
    padding: 0;
    font-family: 'Vazirmatn', sans-serif;
    background-color: #f5f7fa;
    color: #333;
    overflow: hidden;
}

/* 2. Top Header */
.main-header {
    background: white;
    padding: 15px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    height: 60px;
    box-sizing: border-box;
}

.logo { font-weight: 700; font-size: 1.2rem; color: #00b894; }
.nav-links a { text-decoration: none; color: #666; margin-left: 20px; font-size: 0.95rem; }
.btn-login { border: 1px solid #ddd; padding: 8px 15px; border-radius: 8px; transition: 0.3s; }

/* 3. Dashboard */
.dashboard {
    padding: 30px;
    height: calc(100vh - 60px); 
    box-sizing: border-box;
}

.map-card {
    background: white;
    border-radius: 20px;
    padding: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    height: 100%;
    width: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

/* 4. Controls */
.map-header-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 10px 15px 10px;
}

.toggle-group button {
    background: #f1f2f6;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-family: 'Vazirmatn';
    cursor: pointer;
    color: #666;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.toggle-group button:hover { background: #e1e4ea; }

.toggle-group button.active {
    background: #2d3436; /* Dark active state */
    color: #ffffff;
    font-weight: bold;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.map-title { font-weight: bold; color: #2d3436; }

/* 5. Map Container */
#map {
    flex-grow: 1;
    border-radius: 15px;
    width: 100%;
    position: relative;
}

/* 6. Zoom Controls */
.zoom-controls {
    position: absolute;
    bottom: 30px;
    left: 30px;
    z-index: 10;
    background: white;
    padding: 5px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.zoom-controls button {
    background: white;
    border: 1px solid #eee;
    padding: 10px;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 7. Popup Styling */
.mapboxgl-popup { z-index: 20; max-width: 260px !important; }
.mapboxgl-popup-content { border-radius: 12px; padding: 15px; font-family: 'Vazirmatn'; text-align: right; }
.popup-header { display: flex; justify-content: space-between; border-bottom: 1px solid #eee; padding-bottom: 8px; margin-bottom: 10px; }
.popup-header h3 { margin: 0; font-size: 1rem; }
.badge { padding: 3px 8px; border-radius: 8px; font-size: 0.75rem; color: white; }
.badge.available { background-color: #00b894; }
.badge.sold { background-color: #ff7675; }
.price-tag { font-size: 1.1rem; font-weight: bold; color: #2d3436; margin: 8px 0; }
.buy-btn { width: 100%; padding: 8px; background-color: #00b894; color: white; border: none; border-radius: 8px; cursor: pointer; font-family: 'Vazirmatn'; margin-top: 8px; }

/* 8. Mobile */
@media (max-width: 768px) {
    .main-header { padding: 10px 20px; }
    .nav-links a { display: none; }
    .nav-links .btn-login { display: block; }
    .dashboard { padding: 0; height: calc(100vh - 60px); }
    .map-card, #map { border-radius: 0; padding: 0; }
    .map-header-controls { flex-direction: column-reverse; align-items: flex-start; padding: 10px; gap: 10px; background: white; }
    .zoom-controls { bottom: 40px; left: 20px; }
}