:root {
    --primary: #1a3a6c;
    --primary-light: #2a5298;
    --primary-dark: #0f2548;
    --accent: #c9a227;
    --accent-light: #e0be4a;
    --accent-dark: #a8871e;
    --sky: #4a90c4;
    --sky-light: #6baed6;
    --bg-light: #f5f7fa;
    --bg-card: #ffffff;
    --text-dark: #1a1a2e;
    --text-muted: #6c757d;
    --text-light: #adb5bd;
    --border-light: #e8edf2;
    --gradient-hero: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 40%, var(--sky) 100%);
    --gradient-accent: linear-gradient(135deg, var(--accent-dark) 0%, var(--accent) 50%, var(--accent-light) 100%);
    --shadow-sm: 0 2px 8px rgba(26, 58, 108, 0.06);
    --shadow-md: 0 4px 20px rgba(26, 58, 108, 0.1);
    --shadow-lg: 0 8px 40px rgba(26, 58, 108, 0.15);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
}

* {
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

body {
    color: var(--text-dark);
    background-color: var(--bg-light);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

html[dir="rtl"] body {
    font-family: 'Cairo', sans-serif;
}

html[dir="ltr"] body {
    font-family: 'Inter', sans-serif;
}

.navbar {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 1px 3px rgba(26, 58, 108, 0.08);
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--border-light);
}

.navbar-brand img {
    height: 48px;
}

.navbar .nav-link {
    font-weight: 500;
    color: var(--text-dark) !important;
    padding: 0.5rem 1rem !important;
    border-radius: var(--radius-sm);
    position: relative;
}

.navbar .nav-link:hover {
    color: var(--primary) !important;
    background: rgba(26, 58, 108, 0.04);
}

.navbar .nav-link.active {
    color: var(--primary) !important;
    font-weight: 600;
}

.navbar .nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 3px;
    background: var(--accent);
    border-radius: 2px;
}

.btn-primary {
    background: var(--gradient-hero);
    border: none;
    font-weight: 600;
    padding: 0.6rem 1.5rem;
    border-radius: var(--radius-sm);
    box-shadow: 0 2px 8px rgba(26, 58, 108, 0.25);
    letter-spacing: 0.02em;
}

.btn-primary:hover {
    background: var(--primary-light);
    box-shadow: 0 4px 16px rgba(26, 58, 108, 0.35);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-outline-primary {
    color: var(--primary);
    border: 2px solid var(--primary);
    font-weight: 600;
    padding: 0.55rem 1.5rem;
    border-radius: var(--radius-sm);
    background: transparent;
}

.btn-outline-primary:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    box-shadow: 0 4px 16px rgba(26, 58, 108, 0.25);
    transform: translateY(-1px);
}

.btn-accent {
    background: var(--gradient-accent);
    border: none;
    color: #fff;
    font-weight: 600;
    padding: 0.7rem 2rem;
    border-radius: var(--radius-sm);
    box-shadow: 0 2px 12px rgba(201, 162, 39, 0.35);
    letter-spacing: 0.02em;
}

.btn-accent:hover {
    background: var(--accent-light);
    color: #fff;
    box-shadow: 0 4px 20px rgba(201, 162, 39, 0.45);
    transform: translateY(-2px);
}

.btn-outline-light {
    border: 2px solid rgba(255, 255, 255, 0.8);
    color: #fff;
    font-weight: 600;
    padding: 0.7rem 2rem;
    border-radius: var(--radius-sm);
    backdrop-filter: blur(4px);
}

.btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: #fff;
    color: #fff;
    transform: translateY(-2px);
}

.card {
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    background: var(--bg-card);
    overflow: hidden;
}

.card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-4px);
}

.card .card-body {
    padding: 1.25rem;
}

.card .card-footer {
    background: transparent;
    border-top: 1px solid var(--border-light);
    padding: 0.875rem 1.25rem;
}

.property-card {
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.property-card img {
    height: 230px;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.property-card:hover img {
    transform: scale(1.05);
}

.property-card .card-img-top {
    overflow: hidden;
}

.hero-section {
    background: var(--gradient-hero);
    color: white;
    padding: 80px 0 100px;
    position: relative;
    overflow: hidden;
}

.hero-bg-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.18;
    mix-blend-mode: luminosity;
    pointer-events: none;
}

.hero-section .container {
    position: relative;
    z-index: 1;
}

.hero-section .lead {
    font-size: 1.25rem;
    opacity: 0.92;
    font-weight: 300;
    max-width: 600px;
    margin: 0 auto 2rem;
}

.footer {
    background: var(--primary-dark);
    color: rgba(255, 255, 255, 0.7);
    padding: 60px 0 30px;
}

.footer h5,
.footer h6 {
    color: #fff !important;
    font-weight: 600;
    margin-bottom: 1rem;
}

.footer a {
    color: var(--accent-light);
    text-decoration: none;
    transition: color 0.2s;
}

.footer a:hover {
    color: #fff;
}

.footer hr {
    border-color: rgba(255, 255, 255, 0.1);
}

.footer .footer-desc {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
    line-height: 1.7;
}

.bg-primary-custom {
    background: var(--gradient-hero) !important;
}

.text-primary-custom {
    color: var(--primary) !important;
}

.text-accent {
    color: var(--accent) !important;
}

.badge {
    font-weight: 600;
    padding: 0.4em 0.8em;
    border-radius: 6px;
    font-size: 0.78rem;
    letter-spacing: 0.03em;
}

.badge.bg-success {
    background: linear-gradient(135deg, #0d9488, #14b8a6) !important;
}

.badge.bg-info {
    background: linear-gradient(135deg, var(--sky), var(--sky-light)) !important;
}

.badge.bg-warning {
    background: linear-gradient(135deg, var(--accent-dark), var(--accent)) !important;
    color: #fff !important;
}

.badge.bg-danger {
    background: linear-gradient(135deg, #dc2626, #ef4444) !important;
}

.badge.bg-secondary {
    background: linear-gradient(135deg, #475569, #64748b) !important;
}

.stat-card {
    text-align: center;
    padding: 2rem 1.5rem !important;
    border-radius: var(--radius-lg);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-hero);
}

.stat-card .stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    background: var(--gradient-hero);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

.stat-card .stat-label {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    margin-top: 0.25rem;
}

.dashboard-card {
    border-left: 4px solid var(--primary) !important;
    border-radius: var(--radius-md);
}

.dashboard-card.accent {
    border-left-color: var(--accent) !important;
}

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

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

.no-image-placeholder {
    height: 230px;
    background: linear-gradient(135deg, #e2e8f0, #f1f5f9);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    font-size: 3rem;
}

.form-control,
.form-select {
    border: 1.5px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 0.6rem 0.85rem;
    font-size: 0.95rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--sky);
    box-shadow: 0 0 0 3px rgba(74, 144, 196, 0.15);
}

.form-label {
    font-weight: 500;
    color: var(--text-dark);
    font-size: 0.9rem;
    margin-bottom: 0.35rem;
}

.table {
    border-radius: var(--radius-md);
    overflow: hidden;
}

.table thead {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    color: #fff;
}

.table thead th {
    border: none;
    font-weight: 600;
    padding: 0.85rem 1rem;
    font-size: 0.88rem;
    letter-spacing: 0.02em;
}

.table-hover tbody tr:hover {
    background-color: rgba(26, 58, 108, 0.03);
}

.table tbody td {
    padding: 0.8rem 1rem;
    vertical-align: middle;
    border-color: var(--border-light);
}

.alert {
    border: none;
    border-radius: var(--radius-md);
    font-weight: 500;
}

.alert-success {
    background: linear-gradient(135deg, rgba(13, 148, 136, 0.1), rgba(20, 184, 166, 0.08));
    color: #0d6651;
    border-left: 4px solid #0d9488;
}

.alert-danger {
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.1), rgba(239, 68, 68, 0.08));
    color: #991b1b;
    border-left: 4px solid #dc2626;
}

.alert-warning {
    background: linear-gradient(135deg, rgba(201, 162, 39, 0.1), rgba(224, 190, 74, 0.08));
    color: #92400e;
    border-left: 4px solid var(--accent);
}

.alert-info {
    background: linear-gradient(135deg, rgba(74, 144, 196, 0.1), rgba(107, 174, 214, 0.08));
    color: #1e40af;
    border-left: 4px solid var(--sky);
}

.page-header {
    padding: 2.5rem 0 1.5rem;
}

.page-header h1,
.page-header h2 {
    font-weight: 700;
    color: var(--primary-dark);
}

.section-title {
    font-weight: 700;
    color: var(--primary-dark);
    position: relative;
    display: inline-block;
    padding-bottom: 0.5rem;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 3px;
    background: var(--gradient-accent);
    border-radius: 2px;
}

.service-card {
    padding: 2.5rem 1.5rem !important;
    text-align: center;
    border-radius: var(--radius-lg);
    position: relative;
    overflow: hidden;
}

.service-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-accent);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.service-card:hover::after {
    transform: scaleX(1);
}

.service-card .service-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 1.25rem;
    background: linear-gradient(135deg, rgba(26, 58, 108, 0.08), rgba(74, 144, 196, 0.08));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    color: var(--primary);
}

.service-card h5 {
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 0.75rem;
}

.why-section {
    background: var(--gradient-hero);
    color: white;
    padding: 5rem 0;
    position: relative;
    overflow: hidden;
}

.why-section::before {
    content: '';
    position: absolute;
    top: -40%;
    right: -15%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(201, 162, 39, 0.12) 0%, transparent 70%);
    border-radius: 50%;
}

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

.why-item i {
    font-size: 2.5rem;
    color: var(--accent-light);
    margin-bottom: 1rem;
    display: block;
}

.why-item h6 {
    font-weight: 600;
    font-size: 1rem;
}

.auth-card {
    border-radius: var(--radius-xl) !important;
    box-shadow: var(--shadow-lg);
    border: none;
    padding: 2.5rem !important;
}

.auth-card .auth-logo {
    height: 70px;
    margin-bottom: 0.5rem;
}

.auth-card h2 {
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 1.5rem;
}

.auth-card .btn-primary {
    padding: 0.75rem;
    font-size: 1rem;
    border-radius: var(--radius-sm);
    margin-top: 0.5rem;
}

.auth-card a {
    color: var(--primary);
    font-weight: 500;
}

.auth-card a:hover {
    color: var(--accent);
}

.filter-card {
    border-radius: var(--radius-lg);
    padding: 1.5rem !important;
    position: sticky;
    top: 90px;
}

.filter-card h5 {
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--border-light);
}

.list-group-item {
    border-color: var(--border-light);
    padding: 0.85rem 1.25rem;
}

.list-group-item i.bi-check-circle {
    color: var(--sky) !important;
}

.dropdown-menu {
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    padding: 0.5rem;
}

.dropdown-item {
    border-radius: var(--radius-sm);
    padding: 0.5rem 1rem;
    font-weight: 500;
}

.dropdown-item:hover {
    background: rgba(26, 58, 108, 0.06);
    color: var(--primary);
}

.carousel-control-prev-icon,
.carousel-control-next-icon {
    background-color: rgba(26, 58, 108, 0.7);
    border-radius: 50%;
    padding: 1.25rem;
}

.price-tag {
    font-weight: 800;
    color: var(--primary);
    font-size: 1.1rem;
}

.location-text {
    color: var(--text-muted);
    font-size: 0.88rem;
}

.feature-specs {
    display: flex;
    gap: 1rem;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.feature-specs span {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.bg-section-alt {
    background-color: #fff;
}

.pagination .page-link {
    color: var(--primary);
    border-color: var(--border-light);
    border-radius: var(--radius-sm);
    margin: 0 2px;
    font-weight: 500;
}

.pagination .page-item.active .page-link {
    background: var(--gradient-hero);
    border-color: transparent;
}

.fw-500 {
    font-weight: 500;
}

.fw-600 {
    font-weight: 600;
}

@media (max-width: 768px) {
    .hero-section {
        padding: 60px 0 70px;
    }

    .hero-section .lead {
        font-size: 1rem;
    }

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

    .navbar-brand img {
        height: 38px;
    }

    .filter-card {
        position: static;
    }

    .auth-card {
        padding: 1.5rem !important;
    }
}
