/* ManzelMasr Custom Styles - RTL Arabic */

/* Base Styles */
:root {
    --primary-color: #2563eb;
    --secondary-color: #1e40af;
    --accent-color: #3b82f6;
    --success-color: #22c55e;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --text-color: #1f2937;
    --text-muted: #6b7280;
    --bg-light: #f9fafb;
    --border-color: #e5e7eb;
}

/* Ensure proper box-sizing */
*, *::before, *::after {
    box-sizing: border-box;
}

/* Prevent horizontal overflow */
html, body {
    overflow-x: hidden;
    width: 100%;
}

body {
    font-family: 'Cairo', sans-serif;
    color: var(--text-color);
    background-color: #fff;
    line-height: 1.8;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
}

/* Navbar */
.navbar {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.navbar-brand {
    font-size: 1.5rem;
}

.nav-link {
    font-weight: 500;
    padding: 0.5rem 1rem !important;
}

.notifications-dropdown {
    min-width: 300px;
    max-height: 400px;
    overflow-y: auto;
}

/* Buttons */
.btn {
    font-weight: 600;
    padding: 0.5rem 1.5rem;
    border-radius: 8px;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
}

.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Cards */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.card-img-top {
    border-radius: 12px 12px 0 0;
    height: 200px;
    object-fit: cover;
}

/* Property Cards */
.property-card {
    position: relative;
}

.property-card .badge {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 1;
}

.property-card .favorite-btn {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 1;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.property-card .favorite-btn:hover {
    background: #fff;
    transform: scale(1.1);
}

.property-card .favorite-btn.active {
    color: var(--danger-color);
}

.property-price {
    color: var(--primary-color);
    font-size: 1.25rem;
    font-weight: 700;
}

.property-features {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.property-features .feature {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: #fff;
    padding: 4rem 0;
    margin-bottom: 2rem;
}

.hero-section h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.hero-search {
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

/* Stats Section */
.stats-section {
    padding: 3rem 0;
    background-color: var(--bg-light);
}

.stat-item {
    text-align: center;
    padding: 1.5rem;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.stat-label {
    color: var(--text-muted);
    font-size: 1rem;
}

/* Section Titles */
.section-title {
    position: relative;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 60px;
    height: 3px;
    background-color: var(--primary-color);
    border-radius: 2px;
}

/* Forms */
.form-control, .form-select {
    border-radius: 8px;
    padding: 0.75rem 1rem;
    border-color: var(--border-color);
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.15);
}

.form-label {
    font-weight: 600;
    color: var(--text-color);
}

/* Property Detail */
.property-gallery {
    position: relative;
}

.property-gallery img {
    border-radius: 12px;
    width: 100%;
    height: 400px;
    object-fit: cover;
}

.property-gallery-thumbs {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
    overflow-x: auto;
}

.property-gallery-thumbs img {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.3s;
}

.property-gallery-thumbs img:hover,
.property-gallery-thumbs img.active {
    opacity: 1;
}

.property-info-card {
    background: var(--bg-light);
    border-radius: 12px;
    padding: 1.5rem;
}

.property-info-card .info-item {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
}

.property-info-card .info-item:last-child {
    border-bottom: none;
}

.property-info-card .info-label {
    color: var(--text-muted);
}

.property-info-card .info-value {
    font-weight: 600;
}

/* Contact Box */
.contact-box {
    background: #fff;
    border: 2px solid var(--primary-color);
    border-radius: 12px;
    padding: 1.5rem;
}

.contact-box h5 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

/* Dashboard */
.dashboard-card {
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.dashboard-stat {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.dashboard-stat .icon {
    width: 60px;
    height: 60px;
    background: var(--bg-light);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--primary-color);
}

.dashboard-stat .info h3 {
    margin: 0;
    font-size: 1.75rem;
}

.dashboard-stat .info p {
    margin: 0;
    color: var(--text-muted);
}

/* Sidebar */
.sidebar {
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.sidebar .nav-link {
    color: var(--text-color);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 0.25rem;
}

.sidebar .nav-link:hover {
    background: var(--bg-light);
}

.sidebar .nav-link.active {
    background: var(--primary-color);
    color: #fff;
}

.sidebar .nav-link i {
    margin-left: 0.5rem;
    width: 20px;
}

/* Chat */
.chat-container {
    height: 500px;
    display: flex;
    flex-direction: column;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    background: var(--bg-light);
    border-radius: 12px;
}

.chat-message {
    display: flex;
    margin-bottom: 1rem;
}

.chat-message.own {
    flex-direction: row-reverse;
}

.chat-message .message-content {
    max-width: 70%;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.chat-message.own .message-content {
    background: var(--primary-color);
    color: #fff;
}

.chat-message .message-time {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.chat-message.own .message-time {
    color: rgba(255, 255, 255, 0.8);
}

.chat-input {
    padding: 1rem;
    background: #fff;
    border-top: 1px solid var(--border-color);
}

/* Pagination */
.pagination {
    justify-content: center;
}

.page-link {
    border-radius: 8px;
    margin: 0 0.25rem;
    color: var(--text-color);
}

.page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem;
}

.empty-state .icon {
    font-size: 4rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.empty-state h4 {
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--text-muted);
}

/* Filter Sidebar */
.filter-sidebar {
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.filter-sidebar h5 {
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--primary-color);
}

/* Badges */
.badge.bg-sale {
    background-color: var(--success-color) !important;
}

.badge.bg-rent {
    background-color: var(--warning-color) !important;
}

.badge.bg-pending {
    background-color: var(--warning-color) !important;
}

.badge.bg-approved {
    background-color: var(--success-color) !important;
}

.badge.bg-rejected {
    background-color: var(--danger-color) !important;
}

/* Notifications */
.notification-item {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.3s;
}

.notification-item:hover {
    background: var(--bg-light);
}

.notification-item.unread {
    background: rgba(37, 99, 235, 0.05);
}

.notification-item .title {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.notification-item .message {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.notification-item .time {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Toast */
.toast {
    z-index: 9999;
}

/* Responsive */
@media (max-width: 768px) {
    .hero-section h1 {
        font-size: 1.75rem;
    }

    .stat-number {
        font-size: 2rem;
    }

    .property-gallery img {
        height: 250px;
    }

    .chat-container {
        height: 400px;
    }

    /* Container full width on mobile */
    .container {
        padding-left: 12px;
        padding-right: 12px;
    }
}

/* Small mobile devices */
@media (max-width: 576px) {
    /* Full width content on mobile */
    .container {
        padding-left: 10px;
        padding-right: 10px;
        max-width: 100%;
        width: 100%;
    }

    /* Ensure row takes full width */
    .row {
        margin-left: -10px;
        margin-right: -10px;
        width: calc(100% + 20px);
    }

    /* Ensure columns take full width */
    .row > [class*="col-"] {
        padding-left: 10px;
        padding-right: 10px;
    }

    /* Full width on mobile regardless of lg/md classes */
    .col-12, .col-lg-10, .col-lg-8, .col-md-10, .col-md-8 {
        flex: 0 0 100%;
        max-width: 100%;
        width: 100%;
    }

    /* Cards should be full width with minimal margin */
    .card {
        border-radius: 8px;
        margin-left: 0;
        margin-right: 0;
    }

    .card-body {
        padding: 1rem;
    }

    /* Reduce overall padding */
    .py-5 {
        padding-top: 1rem !important;
        padding-bottom: 1rem !important;
    }

    .py-4 {
        padding-top: 0.75rem !important;
        padding-bottom: 0.75rem !important;
    }

    /* Form sections */
    .form-section {
        padding: 1rem;
        margin-bottom: 1rem;
        border-radius: 8px;
    }

    /* Navbar adjustments */
    .navbar-brand {
        font-size: 1.25rem;
    }

    /* Footer compact on mobile */
    footer.py-5 {
        padding-top: 2rem !important;
        padding-bottom: 2rem !important;
    }

    /* Hero section compact */
    .hero-section {
        padding: 2rem 0;
    }

    .hero-section h1 {
        font-size: 1.5rem;
    }

    .hero-search {
        padding: 1rem;
        border-radius: 8px;
    }

    /* Stat items */
    .stat-number {
        font-size: 1.5rem;
    }

    /* Property cards */
    .property-card .card-body {
        padding: 0.75rem;
    }

    .property-price {
        font-size: 1.1rem;
    }

    /* Dashboard cards */
    .dashboard-card {
        padding: 1rem;
    }

    .dashboard-stat .icon {
        width: 50px;
        height: 50px;
        font-size: 1.25rem;
    }

    .dashboard-stat .info h3 {
        font-size: 1.5rem;
    }

    /* Filter sidebar on mobile */
    .filter-sidebar {
        padding: 1rem;
        margin-bottom: 1rem;
    }

    /* Buttons full width on mobile */
    .btn-lg {
        padding: 0.75rem 1rem;
        font-size: 1rem;
    }

    /* Alerts compact */
    .alert {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
}

/* Print */
@media print {
    .navbar, footer, .btn, .chat-input {
        display: none !important;
    }
}
