/* Modern Arabic Font Imports */
/* Using Google Fonts for better performance and availability */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@200;300;400;500;600;700;800;900&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@200;300;400;500;700;800;900&display=swap');

/* Root Variables for Brand Colors and Direction */
:root {
    /* Primary Colors */
    --snowy-white: #f8f8ff;
    --deep-blue: #1E3A8A;

    /* Typography */
    --base-font-size: 16px;
    --fluid-min-width: 320;
    --fluid-max-width: 1140;

    --fluid-screen: 100vw;
    --fluid-bp: calc((var(--fluid-screen) - var(--fluid-min-width) / 16 * 1rem) / (var(--fluid-max-width) - var(--fluid-min-width)));
}

/* Typography Scale - Using Modern Fluid Typography */
:root {
    --step--2: clamp(0.78rem, calc(0.77rem + 0.03vw), 0.80rem);
    --step--1: clamp(0.94rem, calc(0.92rem + 0.11vw), 1rem);
    --step-0: clamp(1.13rem, calc(1.08rem + 0.22vw), 1.25rem);
    --step-1: clamp(1.35rem, calc(1.28rem + 0.37vw), 1.56rem);
    --step-2: clamp(1.62rem, calc(1.50rem + 0.58vw), 1.95rem);
    --step-3: clamp(1.94rem, calc(1.77rem + 0.87vw), 2.44rem);
    --step-4: clamp(2.33rem, calc(2.08rem + 1.25vw), 3.05rem);
    --step-5: clamp(2.80rem, calc(2.45rem + 1.77vw), 3.82rem);
}

/* Typography Implementation */
h1 { font-size: var(--step-5); }
h2 { font-size: var(--step-4); }
h3 { font-size: var(--step-3); }
h4 { font-size: var(--step-2); }
h5 { font-size: var(--step-1); }
h6 { font-size: var(--step-0); }
p { font-size: var(--step--1); }
small { font-size: var(--step--2); }


/* Base Styles */
body {
    font-family: 'Tajawal', sans-serif; /* Or 'Cairo', choose your preference */
    background-color: var(--snowy-white);
    color: var(--deep-blue);
    line-height: 1.75;
    font-size: var(--base-font-size);
    margin: 0; /* Reset default margin */
    /* direction: var(--dir);  Removed direction from body */
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Cairo', sans-serif; /* Or 'Tajawal', choose your preference */
    line-height: 1.0;
    letter-spacing: -0.02em;
    color: var(--deep-blue); /* Ensuring consistent color */
    /* direction: var(--dir); Removed direction from here as well */
}

a {
    color: var(--deep-blue);
    text-decoration: none;
    transition: color 0.3s ease;
    /* direction: var(--dir); Removing direction from here as well*/
}

a:hover {
    color: #001a4d; /* Darker shade of blue */
}

/* Utility Classes */
.text-white { color: var(--snowy-white); }
.text-blue { color: var(--deep-blue); }
.bg-white { background-color: var(--snowy-white); }
.bg-blue { background-color: var(--deep-blue); }

.mar-top { margin-top: 80px !important; } /* Using margin instead of padding as it's in the class name*/

/* Modern Navigation Styles */
.navbar {
    font-family: 'Tajawal', sans-serif;
    padding: 0.8rem 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    background-color: var(--snowy-white);
    /*direction: var(--dir); remove direction from hier*/
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--deep-blue) !important;
    transition: transform 0.3s ease, color 0.3s ease;
}

.navbar-brand:hover {
    transform: translateY(-2px);
    color: #001a4d !important;  /* Darker shade */
}

.nav-link {
    font-size: 1rem;
    font-weight: 500;
    color: var(--deep-blue) !important;
    padding: 0.5rem 1rem;
    transition: all 0.3s ease;
    position: relative;
   /* direction: var(--dir); removed direction from here*/
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    /* The left and right properties below need to be swapped based on direction */
    left: var(--link-left);   /* Use variables for dynamic switching */
    right: var(--link-right);
    width: 0;
    height: 2px;
    background: var(--deep-blue); /*Consistent color for underline*/
    transition: width 0.3s ease;
    transform: translateX(-50%);
}

.nav-link:hover::after {
    width: 60%;
}

.nav-link:hover {
    color: #001a4d !important; /* Darker shade */
    transform: translateY(-2px);
}

/* Dropdown Menu Styling */
.dropdown-menu {
    background: var(--snowy-white);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 0.5rem;
    /*direction: var(--dir);  remove direction from here*/
}

.dropdown-item {
    font-size: 0.9rem;
    color: var(--deep-blue) !important;
    border-radius: 4px;
    padding: 0.4rem 0.8rem;
    transition: all 0.2s ease;
}

.dropdown-item:hover {
    background: rgba(30, 58, 138, 0.1); /* Light blue hover */
    color: #001a4d !important;
    transform: translateX(3px); /* Adjust if needed for RTL */
}

/* Cards */
.cardi {
    background-color: rgba(255, 255, 255, 0.7); /* Slightly transparent white*/
    border-radius: 15px;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease; /* Combined transition*/
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); /* Subtle shadow */
    padding: 2rem;
   /* direction: var(--dir); removed direction from here*/
}

.cardi:hover {
    transform: translateY(-10px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2); /* Increased shadow on hover*/
}

/* Real Estate Section (Example) */
.realestate {
    background-color: var(--deep-blue); /* Solid background for contrast*/
    color: var(--snowy-white);
    padding: 2rem 0;
   /* direction: var(--dir); removed direction from here*/
}

.realestate h2, .realestate p {
    color: var(--snowy-white); /* Ensure text is readable */
}

/* Floating Icon */
.floating-icon {
    position: fixed;
    bottom: 30px;
   /* Use dynamic variables for left/right property, to adjust to the different language directions */
    right: var(--float-right); /* Default for LTR */
    left: auto;
    background-color: var(--deep-blue);
    color: var(--snowy-white);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    transition: background-color 0.3s ease, transform 0.2s ease;
    z-index: 9999;
}

.floating-icon:hover {
    transform: scale(1.1);
    background-color: #001a4d; /* Darker blue on hover*/
}

/* Dropdown for Floating Icon */
.dropdown-float {
    display: none;
    position: fixed;
    bottom: 90px;
        /* Use dynamic variables for left/right property, to adjust to the different language directions */
    right: var(--float-right); /* Default for LTR */
    left: auto;
    background-color: var(--snowy-white);
    border-radius: 15px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    z-index: 1004;
}

.dropdown-float a {
    display: block;
    padding: 10px 20px;
    text-decoration: none;
    color: var(--deep-blue);
    border-bottom: 1px solid rgba(30, 58, 138, 0.2); /* Light blue separator*/
}

.dropdown-float a:hover {
    background: rgba(30, 58, 138, 0.05); /* Very light blue hover */
    border-radius: 15px;
    color: #001a4d; /*Darker blue on hover*/
}

/* Carousel Styles */
.carousel-item {
    position: relative;
  /* direction: var(--dir); removed direction from here*/
}

.overlay {
    position: absolute;
    top: 0;
    /*Use dynamic variables for left/right property, to adjust to the different language directions*/
    right: 0;
    left: auto;
    width: 100%;
    height: 100%;
    background: rgba(30, 58, 138, 0.4); /* Semi-transparent blue overlay */
    z-index: 1;
}

.carousel-caption {
    position: absolute;
    /*The left and right properties below need to be swapped based on direction*/
    left: 15%;
    right: 15%;
    bottom: 1.25rem;
    padding-top: 1.25rem;
    padding-bottom: 1.25rem;
    color: var(--snowy-white);
    text-align: center;
    z-index: 2;
  /* direction: var(--dir); removed direction from here*/
}

.carousel-item img {
    object-fit: cover;
    width: 100%;
    height: 100%; /* Make sure images fill the space */
}

.carousel-caption > h2 {
    font-size: 3rem;
    font-weight: bold;
    color: var(--snowy-white);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    margin-bottom: 1.5rem;
}

.carousel-indicators {
    z-index: 3;
}

@media (max-width: 768px) {
    .carousel-caption > h2 {
        font-size: 1.5rem;
    }

    .carousel-caption {
        top: 1rem;
    }

    .carousel-item {
        height: 50vh;
    }

    .carousel-item img {
        object-fit: cover;
        height: 100%;
    }
}

/* Full-page layout adjustments */
body, html {
    height: 100%;
    margin: 0;
}

#page-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    /* direction: var(--dir);  moved direction from body to page wrapper */
}

main {
    flex-grow: 1; /* Pushes footer to the bottom */
   /* direction: var(--dir);  removed direction from here*/
}

footer {
    background-color: var(--snowy-white); /*  White footer */
    border-top: 1px solid #dee2e6; /* Light border */
    text-align: center;
    padding: 1rem;
    color: var(--deep-blue);
    /*direction: var(--dir); remove direction from here*/
}

/* Scrollbar Styling (Optional - Add for Custom Scrollbar) */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: var(--deep-blue);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* New styles */
.text-and-qr-container {
    direction: var(--dir);
    text-align: var(--text-align);
}




.rtl-label {
    text-align: right; /* Or left, depending on the desired look */
    display: block;     /* Make the span a block-level element */
    margin-right: auto;  /* Adjust margins as needed */
    margin-left: 0;
}

/* Adjust input fields for RTL layout */
input[dir="rtl"],
textarea[dir="rtl"],
select[dir="rtl"] {
    direction: rtl; /* Force RTL direction */
    text-align: right;
}