/* Fix horizontal scroll */
body, html { overflow-x: hidden; max-width: 100vw; }

/**
 * Dilaal - Real Estate Broker Platform
 * Main Stylesheet - Modern & Beautiful Design
 */

/* ============================================
   CSS Variables
============================================ */
:root {
    --primary-color: #0066FF;
    --primary-dark: #0052CC;
    --primary-light: #E6F0FF;
    --secondary-color: #6B7280;
    --success-color: #10B981;
    --success-light: #D1FAE5;
    --warning-color: #F59E0B;
    --warning-light: #FEF3C7;
    --danger-color: #EF4444;
    --danger-light: #FEE2E2;
    --dark-color: #111827;
    --light-color: #F9FAFB;
    --white: #FFFFFF;
    --border-color: #E5E7EB;
    --text-color: #374151;
    --text-muted: #9CA3AF;
    --text-light: #6B7280;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    
    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
    
    /* Transitions */
    --transition: all 0.3s ease;
    --transition-fast: all 0.15s ease;
}

/* ============================================
   Base Styles
============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--text-color);
    background-color: var(--light-color);
    line-height: 1.6;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--primary-dark);
}

img {
    max-width: 100%;
    height: auto;
}

/* ============================================
   Typography
============================================ */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

.section-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 60px;
    height: 4px;
    background: var(--primary-color);
    border-radius: 2px;
}

.section-title.text-center::after {
    left: 50%;
    transform: translateX(-50%);
}

/* ============================================
   Navigation
============================================ */
.navbar {
    padding: 0.75rem 0;
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
}

.nav-link {
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    color: var(--text-color) !important;
    transition: color 0.2s ease;
}

.nav-link:hover {
    color: var(--primary-color) !important;
}

.dropdown-menu {
    border: none;
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius);
    padding: 0.5rem;
}

.dropdown-item {
    border-radius: var(--radius);
    padding: 0.5rem 1rem;
}

.dropdown-item:hover {
    background-color: var(--light-color);
}

/* ============================================
   Hero Section
============================================ */
.hero-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 4rem 0;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="50" cy="50" r="40" fill="rgba(255,255,255,0.05)"/></svg>');
    background-size: 200px;
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.hero-subtitle {
    font-size: 1.25rem;
    opacity: 0.9;
    margin-bottom: 2rem;
}

/* ============================================
   Search Box
============================================ */
.search-box {
    background: white;
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-lg);
}

.search-box .form-control,
.search-box .form-select {
    border: 2px solid var(--border-color);
    padding: 0.75rem 1rem;
    font-size: 1rem;
}

.search-box .form-control:focus,
.search-box .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.search-box .btn-primary {
    padding: 0.75rem 2rem;
    font-weight: 600;
}

/* ============================================
   Property Cards
============================================ */
.property-card {
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
}

.property-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.property-card .card-img-wrapper {
    position: relative;
    height: 220px;
    overflow: hidden;
}

.property-card .card-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.property-card:hover .card-img-wrapper img {
    transform: scale(1.05);
}

.property-card .listing-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.property-card .listing-badge.sale {
    background: var(--success-color);
    color: white;
}

.property-card .listing-badge.rent {
    background: var(--primary-color);
    color: white;
}

.property-card .featured-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--warning-color);
    color: white;
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius);
    font-size: 0.75rem;
    font-weight: 600;
}

.property-card .favorite-btn {
    position: absolute;
    bottom: 15px;
    right: 15px;
    width: 36px;
    height: 36px;
    background: white;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--shadow);
}

.property-card .favorite-btn:hover {
    background: var(--danger-color);
    color: white;
}

.property-card .favorite-btn.active {
    background: var(--danger-color);
    color: white;
}

.property-card .compare-btn {
    position: absolute;
    bottom: 15px;
    right: 55px;
    width: 36px;
    height: 36px;
    background: white;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--shadow);
    color: var(--text-muted);
    text-decoration: none;
}

.property-card .compare-btn:hover {
    background: var(--primary-color);
    color: white;
}

.property-card .card-body {
    padding: 1.25rem;
}

.property-card .property-type {
    color: var(--primary-color);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.property-card .property-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--dark-color);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.property-card .property-location {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.property-card .property-location i {
    color: var(--primary-color);
}

.property-card .property-features {
    display: flex;
    gap: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    margin-bottom: 1rem;
}

.property-card .property-features span {
    font-size: 0.85rem;
    color: var(--secondary-color);
}

.property-card .property-features i {
    color: var(--primary-color);
    margin-right: 0.25rem;
}

.property-card .property-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
}

.property-card .property-price small {
    font-size: 0.8rem;
    font-weight: 400;
    color: var(--text-muted);
}

/* ============================================
   Vehicle Cards
============================================ */
.vehicle-card {
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.vehicle-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.vehicle-card .card-img-wrapper {
    height: 200px;
    overflow: hidden;
}

.vehicle-card .card-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.vehicle-card .vehicle-info {
    padding: 1rem;
}

.vehicle-card .vehicle-title {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.vehicle-card .vehicle-details {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.vehicle-card .vehicle-details span {
    background: var(--light-color);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius);
    font-size: 0.8rem;
    color: var(--secondary-color);
}

.vehicle-card .vehicle-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-color);
}

/* ============================================
   Category Cards
============================================ */
.category-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 2rem 1.5rem;
    text-align: center;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    cursor: pointer;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    background: var(--primary-color);
    color: white;
}

.category-card .icon {
    width: 60px;
    height: 60px;
    background: var(--light-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 1.5rem;
    color: var(--primary-color);
    transition: all 0.3s ease;
}

.category-card:hover .icon {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.category-card h5 {
    font-weight: 600;
    margin-bottom: 0.25rem;
    transition: color 0.3s ease;
}

.category-card:hover h5 {
    color: white;
}

.category-card p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin: 0;
    transition: color 0.3s ease;
}

.category-card:hover p {
    color: rgba(255, 255, 255, 0.8);
}

/* ============================================
   Broker Cards
============================================ */
.broker-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    text-align: center;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.broker-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.broker-card .broker-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 1rem;
    border: 3px solid var(--primary-color);
}

.broker-card .broker-name {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.broker-card .broker-company {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.broker-card .broker-listings {
    color: var(--primary-color);
    font-weight: 500;
    font-size: 0.9rem;
}

/* ============================================
   Stats Section
============================================ */
.stats-section {
    background: var(--dark-color);
    color: white;
    padding: 3rem 0;
}

.stat-item {
    text-align: center;
    padding: 1rem;
}

.stat-item .stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.stat-item .stat-label {
    font-size: 1rem;
    opacity: 0.8;
}

/* ============================================
   Forms
============================================ */
.form-control,
.form-select {
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
    transition: all 0.2s ease;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-label {
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--dark-color);
}

/* ============================================
   Buttons
============================================ */
.btn {
    font-weight: 500;
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius);
    transition: all 0.2s ease;
}

.btn-primary {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-outline-primary:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-success {
    background: var(--success-color);
    border-color: var(--success-color);
}

.btn-lg {
    padding: 0.875rem 1.75rem;
    font-size: 1.1rem;
}

/* ============================================
   Pagination
============================================ */
.pagination {
    gap: 0.25rem;
}

.page-link {
    border: none;
    border-radius: var(--radius) !important;
    padding: 0.5rem 1rem;
    color: var(--text-color);
}

.page-link:hover {
    background: var(--light-color);
    color: var(--primary-color);
}

.page-item.active .page-link {
    background: var(--primary-color);
    color: white;
}

/* ============================================
   Sidebar Filters
============================================ */
.filter-sidebar {
    background: white;
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.filter-sidebar h5 {
    font-weight: 600;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--border-color);
}

.filter-group {
    margin-bottom: 1.5rem;
}

.filter-group label {
    font-weight: 500;
    margin-bottom: 0.5rem;
    display: block;
}

/* ============================================
   Property Detail Page
============================================ */
.property-gallery {
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.property-gallery .main-image {
    height: 400px;
    object-fit: cover;
    width: 100%;
}

.property-gallery .thumbnail-list {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.property-gallery .thumbnail {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: var(--radius);
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.property-gallery .thumbnail:hover,
.property-gallery .thumbnail.active {
    opacity: 1;
}

.property-info-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
}

.property-info-card h4 {
    font-weight: 600;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--border-color);
}

.broker-contact-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    position: sticky;
    top: 100px;
}

.broker-contact-card .broker-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.broker-contact-card .broker-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
}

/* ============================================
   Dashboard
============================================ */
.dashboard-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    height: 100%;
}

.dashboard-card .card-icon {
    width: 50px;
    height: 50px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.dashboard-card .card-icon.primary {
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary-color);
}

.dashboard-card .card-icon.success {
    background: rgba(34, 197, 94, 0.1);
    color: var(--success-color);
}

.dashboard-card .card-icon.warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
}

.dashboard-card .card-icon.danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
}

.dashboard-card .card-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--dark-color);
}

.dashboard-card .card-label {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ============================================
   Sidebar Navigation (Dashboard)
============================================ */
.sidebar {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 1rem 0;
}

.sidebar .nav-link {
    padding: 0.75rem 1.5rem !important;
    color: var(--text-color) !important;
    border-left: 3px solid transparent;
    transition: all 0.2s ease;
}

.sidebar .nav-link:hover {
    background: var(--light-color);
    color: var(--primary-color) !important;
}

.sidebar .nav-link.active {
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary-color) !important;
    border-left-color: var(--primary-color);
}

.sidebar .nav-link i {
    width: 24px;
    margin-right: 0.5rem;
}

/* ============================================
   Tables
============================================ */
.table-responsive {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.table {
    margin-bottom: 0;
}

.table thead th {
    background: var(--light-color);
    border-bottom: 2px solid var(--border-color);
    font-weight: 600;
    color: var(--dark-color);
    padding: 1rem;
}

.table tbody td {
    padding: 1rem;
    vertical-align: middle;
}

.table tbody tr:hover {
    background: var(--light-color);
}

/* ============================================
   Badges
============================================ */
.badge {
    font-weight: 500;
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius);
}

.badge.status-active {
    background: rgba(34, 197, 94, 0.1);
    color: var(--success-color);
}

.badge.status-pending {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
}

.badge.status-sold {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
}

/* ============================================
   Responsive
============================================ */
@media (max-width: 991.98px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .search-box {
        padding: 1rem;
    }
    
    .property-card .card-img-wrapper {
        height: 180px;
    }
}

@media (max-width: 767.98px) {
    .hero-section {
        padding: 2.5rem 0;
    }
    
    .hero-title {
        font-size: 1.75rem;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .stat-item .stat-number {
        font-size: 2rem;
    }
    
    .broker-contact-card {
        position: static;
    }
}

/* ============================================
   Utilities
============================================ */
.bg-gradient-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
}

.text-primary {
    color: var(--primary-color) !important;
}

.border-primary {
    border-color: var(--primary-color) !important;
}

.shadow-hover {
    transition: box-shadow 0.3s ease;
}

.shadow-hover:hover {
    box-shadow: var(--shadow-lg);
}

/* Loading Spinner */
.spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* Image Upload Preview */
.image-upload-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1rem;
}

.image-upload-preview .preview-item {
    position: relative;
    width: 120px;
    height: 90px;
    border-radius: var(--radius);
    overflow: hidden;
}

.image-upload-preview .preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-upload-preview .preview-item .remove-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 24px;
    height: 24px;
    background: var(--danger-color);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.75rem;
}

/* WhatsApp Button */
.whatsapp-float {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: #25D366;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    transition: transform 0.3s ease;
}

.whatsapp-float:hover {
    transform: scale(1.1);
    color: white;
}

