/*
    CitySol Real Estate - Modern, Clean, and Mobile Responsive Style Sheet
    Primary Color: #EF4522 (Logo Color)
*/
html {
  scroll-behavior: smooth;
}

:root {
    --primary-color: #EF4522; /* Vibrant Orange/Red (Main Brand Color) */
    --secondary-color: #1C1C1C; /* Charcoal Black for Strong Contrast */
    --accent-color: #F8B400; /* Warm Gold for Highlights */
    --text-color-dark: #1f2937; /* Very dark gray for headers */
    --text-color-light: #4b5563; /* Medium gray for body text */
    --light-bg: #f9fafb; /* Soft off-white background */
    --dark-bg: #111827; /* Deep dark background for footer/sections */
    --white: #ffffff;
    --spacing-unit: 20px;
    --border-radius: 8px;
    --header-height: 70px; /* change this to match your navbar height */
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}
body {
    font-family: 'Tajawal', sans-serif;
    color: var(--text-color-light);
    line-height: 1.6;
    background-color: var(--white);
    direction: ltr; /* Default to RTL for Arabic */
    text-align: right; /* Default text alignment for RTL */
}

[dir="ltr"] body {
    direction: ltr; /* Default to RTL for Arabic */
}

[dir="rtl"] body {
    direction: rtl; /* Default to RTL for Arabic */
}

/* Typography */
h1, h2, h3, h4 {
    color: var(--text-color-dark);
    margin-bottom: var(--spacing-unit);
    line-height: 1.2;
    font-weight: 800;
}

h2 { font-size: 2.5rem; }
h3 { font-size: 2rem; }

p {
    margin-bottom: 15px;
    font-size: 1.1rem;
}

a {
    text-decoration: none;
    color: var(--primary-color);
    transition: color 0.3s;
}

a:hover {
    color: var(--white);
}

/* Utility Classes */
.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 var(--spacing-unit);
}

.padded-section {
    padding: 40px 0; /* Increased padding for modern look */
}

.bg-light {
    background-color: var(--light-bg);
}

.bg-dark {
    background-color: var(--dark-bg);
}

.text-white {
    color: var(--white) !important;
}

.section-title {
    text-align: center;
    font-size: 2.8rem;
    margin-bottom: 40px;
    position: relative;
    color: var(--text-color-dark);
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -20px;
    right: 50%;
    transform: translateX(50%);
    width: 40px;
    height: 5px;
    background-color: var(--primary-color);
    border-radius: 2px;
}

.section-title.vision-after {
    margin-bottom: 167px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 30px;
    border-radius: 50px; /* Pill shape for modernity */
    font-weight: bold;
    text-align: center;
    transition: background-color 0.3s, transform 0.2s, box-shadow 0.3s;
    border: 2px solid transparent;
}

.primary-btn {
    background-color: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
    box-shadow: 0 8px 15px rgba(239, 69, 34, 0.3);
}

.primary-btn:hover {
    background-color: #d13d1e; /* Slightly darker shade */
    transform: translateY(-3px);
    box-shadow: 0 12px 20px rgba(239, 69, 34, 0.4);
}

.secondary-btn {
    background-color: transparent;
    color: var(--secondary-color);
    border-color: var(--secondary-color);
}

.secondary-btn:hover {
    background-color: var(--secondary-color);
    color: var(--white);
    transform: translateY(-2px);
}

.small-btn {
    padding: 10px 20px;
    font-size: 0.9rem;
}

/* ------------------------------------
    1. Header & Navigation (Modernized)
------------------------------------ */
.main-header {
    background-color: var(--white);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.main-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px var(--spacing-unit);
}

.logo {
    font-size: 1.8rem;
    font-weight: 900;
    color: var(--primary-color);
    display: flex;
    align-items: baseline;
}

.logo .en-name {
    font-size: 1.2rem;
    font-weight: 400;
    color: var(--text-color-dark);
    margin-right: 8px; /* Spacing for RTL */
}
.logo-img{
    width: 160px;
}
.main-nav {
    display: flex;
    align-items: center;
}

.main-nav ul {
    list-style: none;
    display: flex;
    gap: 30px;
    align-items: center;
}

.main-nav a:not(.btn) {
    color: var(--text-color-dark);
    padding: 5px 0;
    position: relative;
    font-weight: 700;
}

.main-nav a:not(.btn)::after {
    content: '';
    position: absolute;
    bottom: -5px;
    right: 50%;
    transform: translateX(50%);
    width: 0;
    height: 3px;
    background-color: var(--primary-color);
    transition: width 0.3s;
    border-radius: 2px;
}

.main-nav a:not(.btn):hover::after {
    width: 100%;
}

/* Language Switch Button */
.lang-switch-btn {
    margin-left: var(--spacing-unit);
}
[dir="rtl"] .lang-switch-btn i {
    margin-left: 8px;
}
[dir="ltr"] .lang-switch-btn i {
    margin-right: 8px;
}
/* Mobile Menu Toggle */
.menu-icon {
    display: none;
    font-size: 1.8rem;
    cursor: pointer;
    color: var(--primary-color);
    order: 1; /* Default to show after lang switch in RTL */
}

#menu-toggle {
    display: none;
}


/* ------------------------------------
    2. Hero Section
------------------------------------ */
.hero {
    background-color: var(--light-bg);
    padding: 30px 0;
    overflow: hidden;
}

.hero .container {
    display: flex;
    flex-direction: row-reverse; /* RTL layout */
    align-items: center;
    gap: 60px;
}

.hero-content {
    flex: 1;
}

.hero-content h2 {
    font-size: 3.5rem;
    color: var(--primary-color);
    margin-bottom: 25px;
}

.hero-content p {
    font-size: 1.4rem;
    font-weight: 400;
    color: var(--text-color-light);
    margin-bottom: 50px;
}

.hero-image {
    flex: 1;
    text-align: left; /* Align image to the left in RTL */
}

.hero-image img {
    max-width: 100%;
    height: auto;
    border-radius: 15px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
}

.primary-btn i {
    margin-right: 10px; /* Space between text and icon in RTL */
}


/* ------------------------------------
    3. About Section (Stats)
------------------------------------ */
.about-section {
    text-align: center;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    justify-content: space-around;
    gap: 40px;
    margin-top: 50px;
    padding: 40px 0;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
}

.stat-item {
    text-align: center;
}

.stat-item span {
    display: block;
    font-size: 3.5rem;
    font-weight: 900;
    color: var(--primary-color);
    line-height: 1;
}

.stat-item p {
    font-size: 1.2rem;
    color: var(--text-color-dark);
    margin-top: 10px;
}


/* ------------------------------------
    4. Vision & Mission (Modern Cards)
------------------------------------ */
.vision-mission-section .container {
    display: flex;
    gap: 30px;
}

.vm-card {
    background: var(--white);
    padding: 40px;
    border-radius: var(--border-radius);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s, box-shadow 0.3s;
    border-right: 5px solid var(--secondary-color); /* Feature border for RTL */
}

.vm-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
}

.vm-card i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-left: 15px; /* Spacing for RTL */
}

.vm-card h4 {
    display: inline-block;
    color: var(--text-color-dark);
    font-size: 1.6rem;
    margin-bottom: 0;
}

.vm-card p {
    margin-top: 20px;
    font-size: 1.1rem;
}

.vm-header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}


/* ------------------------------------
    5. Services (Scope of Work) - Card Design
------------------------------------ */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.service-card {
    background: var(--white);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s, box-shadow 0.3s;
}

.service-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

.service-card .card-image img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    transition: transform 0.5s;
}

.service-card:hover .card-image img {
    transform: scale(1.05);
}

.service-card h4 {
    color: var(--primary-color);
    padding: 25px 25px 10px;
    margin-bottom: 5px;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
}

.service-card h4 i {
    color: var(--secondary-color);
    margin-left: 12px; /* Spacing for RTL */
    font-size: 1.8rem;
}

.service-card p {
    padding: 0 25px 25px;
    font-size: 1rem;
    color: var(--text-color-light);
}


/* ------------------------------------
    6. Core Values - Dark Section
------------------------------------ */
.values-section {
    background-color: var(--white);
}

.values-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    text-align: center;
}

.value-item {
    background: #1e293b; /* Slightly lighter dark background */
    padding: 40px 25px;
    border-radius: var(--border-radius);
    border-bottom: 4px solid var(--accent-color);
    transition: background-color 0.3s;
}

.value-item:hover {
    background-color: #2b3544;
}

.value-item i {
    font-size: 3.5rem;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.value-item h5 {
    font-size: 1.4rem;
    margin-bottom: 10px;
}

.value-item p {
    color: #e5e7eb;
    font-size: 1rem;
    margin-bottom: 0;
}


/* ------------------------------------
    7. Footer
------------------------------------ */
.main-footer {
    background-color: var(--dark-bg);
    color: var(--white);
    padding-top: 70px;
}

.main-footer .container {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 40px;
    padding-bottom: 40px;
}

.footer-col {
    flex: 1;
    min-width: 250px;
}

.footer-col h4 {
    color: var(--primary-color);
    font-size: 1.4rem;
    margin-bottom: 30px;
    position: relative;
    padding-bottom: 10px;
}

.footer-col h4::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 50px;
    height: 4px;
    background-color: var(--accent-color);
    border-radius: 2px;
}

.footer-col ul {
    list-style: none;
}

.footer-col ul li {
    margin-bottom: 15px;
    font-size: 1rem;
    color: #c9d1d9;
    display: flex;
    align-items: center;
}

.footer-col ul li i {
    margin-left: 12px; /* Spacing for RTL */
    color: var(--white);
    font-size: 1.1rem;
}

.footer-col a {
    color: #c9d1d9;
    font-weight: normal;
}

.social-links {
    margin-top: 20px;
}

.social-links a {
    font-size: 1.8rem;
    color: var(--white);
    margin-left: 20px; /* Spacing for RTL */
    transition: color 0.3s;
}

.social-links a:hover {
    color: var(--primary-color);
}

.footer-bottom {
    text-align: center;
    padding: 20px 0;
    border-top: 1px solid #2d3748;
    font-size: 0.95rem;
    color: #9ca3af;
}


/* ------------------------------------
    8. LTR (English) Overrides
------------------------------------ */

[dir="ltr"] body {
    text-align: left;
}

[dir="ltr"] .logo .en-name {
    margin-left: 8px; /* Spacing for LTR */
    margin-right: 0;
}

/* Nav Underline LTR Fix */
[dir="ltr"] .main-nav a:not(.btn)::after {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
}

/* Hero Section LTR Fix */


[dir="ltr"] .hero-image {
    text-align: right; /* Image on the right in LTR */
}

[dir="ltr"] .primary-btn i {
    margin-left: 10px; /* Space between text and icon in LTR */
    margin-right: 0;
}

/* Card Feature Border LTR Fix */
[dir="ltr"] .vm-card {
    border-right: none;
    border-left: 5px solid var(--secondary-color);
}

/* Vision & Mission LTR Fix */
[dir="ltr"] .vm-card i {
    margin-right: 15px;
    margin-left: 0;
}

/* Services LTR Fix */
[dir="ltr"] .service-card h4 i {
    margin-right: 12px;
    margin-left: 0;
}

/* Footer LTR Fix */
[dir="ltr"] .footer-col h4::after {
    left: 0;
    right: auto;
}

[dir="ltr"] .footer-col ul li i {
    margin-right: 12px; /* Spacing for LTR */
    margin-left: 0;
}

[dir="ltr"] .social-links a {
    margin-right: 20px; /* Spacing for LTR */
    margin-left: 0;
}


/* ------------------------------------
    9. Mobile Responsiveness
------------------------------------ */
@media (max-width: 992px) {
    .padded-section {
        padding: 80px 0;
    }
    
    .section-title {
        font-size: 2.2rem;
        margin-bottom: 60px;
    }

    /* Hero */
    .hero {
        padding: 80px 0 40px;
    }
    .hero .container {
        flex-direction: column; /* Stack image and content vertically */
        text-align: center;
        gap: 30px;
    }
    .hero-content h2 {
        font-size: 2.8rem;
    }
    .hero-content p {
        font-size: 1.2rem;
    }
    .hero-image {
        order: -1; /* Move image above content on mobile */
        margin-bottom: 20px;
    }
    [dir="ltr"] .hero-image, .hero-image {
        text-align: center;
    }

    /* Vision & Mission */
    .vision-mission-section .container {
        flex-direction: column;
    }

    /* Footer */
    .main-footer .container {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .footer-col {
        min-width: 100%;
    }
    .footer-col h4::after {
        right: 50%;
        transform: translateX(50%);
    }
    [dir="ltr"] .footer-col h4::after {
        left: 50%;
        right: auto;
        transform: translateX(-50%);
    }
    .footer-col ul li {
        justify-content: center;
    }
    
}

@media (max-width: 768px) {
    /* Header/Nav Mobile */
    .main-header .container {
        padding: 15px var(--spacing-unit);
    }
    .logo {
        font-size: 1.5rem;
    }
    .menu-icon {
        display: block;
        order: -1; /* Icon before language switch in RTL */
    }
    
    .lang-switch-btn {
        order: -2; /* Language button first in RTL */
        margin-left: 10px;
    }
    
    [dir="ltr"] .menu-icon {
        order: 1; /* Icon after logo in LTR */
    }
    [dir="ltr"] .lang-switch-btn {
        order: -2; /* Language button last in LTR */
        margin-right: 0;
        margin-left: 10px;
    }


    .main-nav ul {
        flex-direction: column;
        gap: 0;
        position: absolute;
        top: 65px;
        right: 0;
        width: 100%;
        background-color: var(--white);
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
        padding: 15px 0;
        display: none;
        text-align: center;
    }

    [dir="ltr"] .main-nav ul {
        right: auto;
        left: 0;
    }

    #menu-toggle:checked ~ ul {
        display: flex;
    }

    .main-nav li {
        width: 100%;
        border-bottom: 1px solid var(--light-bg);
    }
    .main-nav li:last-child {
        border-bottom: none;
    }
    
    .main-nav a:not(.btn) {
        display: block;
        padding: 12px 0;
    }
    .main-nav a:not(.btn)::after {
        display: none;
    }

    /* Stats Grid */
    .stats-grid {
        grid-template-columns: 1fr;
        padding: 0;
        border: none;
    }
    .stat-item {
        border-bottom: 1px solid #eee;
        padding: 20px 0;
    }
    .stat-item:last-child {
        border-bottom: none;
    }
    .section-title.vision-after {
        margin-bottom: 20px;
    }
}

/* Very Small Screens */
@media (max-width: 480px) {
    .hero-content h2 {
        font-size: 2.2rem;
    }
    .section-title {
        font-size: 1.8rem;
    }
    .hero {
        padding-top: 60px;
    }
}

/* Prevent sticky header from covering anchor targets */
section, .section {
  /* when a link points to this element, the browser will stop this much above it */
  scroll-margin-top: calc(var(--header-height) + 16px);
}

/* Optional: nicer visual feedback when arriving at a section via anchor */
section:target, .section:target {
  animation: targetPulse 1s ease;
}

/* soft orange glow pulse using your brand color #EF4522 */
@keyframes targetPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(239,69,34,0);
    transform: translateY(6px);
  }
  40% {
    box-shadow: 0 8px 30px rgba(239,69,34,0.12);
    transform: translateY(0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(239,69,34,0);
    transform: translateY(0);
  }
}

/* If you use different section tags (e.g., .about, .contact), apply scroll-margin-top to them too */
#about, #vision, #philosophy, #services, #values, #contact {
  scroll-margin-top: calc(var(--header-height) + 16px);
}