:root {
    --primary-color: #019cde;
    --secondary-color: #2d2c2b;
    --text-color: #4a4a4a;
    --light-bg: #f8f9fa;
    --white: #ffffff;
    --transition: all 0.3s ease;
    --header-height: 90px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Cairo', 'Inter', sans-serif;
    line-height: 1.6;
    color: var(--secondary-color);
    background-color: var(--white);
    overflow-x: hidden;
}

body.ltr {
    font-family: 'Inter', 'Cairo', sans-serif;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

.container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 30px;
}

section {
    padding: 100px 0;
}

/* Header & Navbar */
header {
    height: var(--header-height);
    background: transparent;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

header.scrolled {
    background: var(--secondary-color);
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.2);
    height: 80px;
}

nav.main-nav {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    width: 100%;
}

/* Brand Section */
.brand {
    display: flex;
    align-items: center;
    gap: 15px;
    width: fit-content;
}

.brand-text {
    display: flex;
    flex-direction: column;
}

.brand-text h2 {
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1.1;
    color: var(--primary-color);
    transition: var(--transition);
}

header.scrolled .brand-text h2 {
    color: var(--white);
}

.brand-text span {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
    transition: var(--transition);
}

header.scrolled .brand-text span {
    color: var(--primary-color);
}

.logo-img {
    height: 55px;
    width: auto;
    transition: var(--transition);
}

header.scrolled .logo-img {
    height: 45px;
    filter: brightness(0) invert(1);
}

/* Nav Links */
.nav-links {
    display: flex;
    gap: 45px;
}

.nav-links a {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--white);
    position: relative;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: var(--transition);
}

header.scrolled .nav-links a {
    color: var(--white);
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary-color);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    width: 0;
    height: 3px;
    background: var(--primary-color);
    transition: var(--transition);
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

/* Lang Switch */
.header-actions {
    display: flex;
    justify-content: flex-end;
}

.lang-switch {
    font-weight: 700;
    color: var(--white);
    font-size: 0.9rem;
    letter-spacing: 1px;
    transition: var(--transition);
    text-transform: uppercase;
}

header.scrolled .lang-switch {
    color: var(--white);
}

.lang-switch:hover {
    color: var(--primary-color) !important;
}

/* RTL Essentials */
body.rtl {
    direction: rtl;
}

body.ltr {
    direction: ltr;
}

body.rtl .header-actions {
    justify-content: flex-start;
}

/* Hero Section */
.hero {
    min-height: 100vh;
    min-height: 100svh;
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    display: flex;
    align-items: center;
    position: relative;
    color: var(--white);
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(45, 44, 43, 0.75), rgba(45, 44, 43, 0.5));
}

.hero-content {
    position: relative;
    max-width: 850px;
    z-index: 1;
}

.hero h1 {
    font-size: 4rem;
    font-weight: 700;
    margin-bottom: 25px;
    line-height: 1.1;
    animation: fadeInUp 1s ease forwards;
}

.hero p {
    font-size: 1.4rem;
    margin-bottom: 40px;
    opacity: 0.95;
    font-weight: 300;
    animation: fadeInUp 1s ease forwards 0.2s;
    opacity: 0;
}

.btn {
    display: inline-block;
    padding: 16px 40px;
    background: var(--primary-color);
    color: var(--white);
    font-weight: 700;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: var(--transition);
    border: none;
    cursor: pointer;
}

.btn:hover {
    background: #0089c4;
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(1, 156, 222, 0.3);
}

/* Page Header (Subpages) */
.page-header {
    height: 450px;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    color: var(--white);
    text-align: center;
}

.page-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(45, 44, 43, 0.7);
}

.page-header h1 {
    position: relative;
    font-size: 3.5rem;
    z-index: 1;
    animation: fadeInUp 1s ease forwards;
}

/* Service Cards */
.services-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
}

.service-card {
    background: var(--white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.06);
    transition: var(--transition);
}

.service-card:hover {
    transform: translateY(-15px);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.1);
}

.service-img {
    height: 250px;
    overflow: hidden;
}

.service-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.service-card:hover .service-img img {
    transform: scale(1.1);
}

.service-content {
    padding: 35px;
}

.service-content h3 {
    font-size: 1.6rem;
    margin-bottom: 15px;
    color: var(--secondary-color);
}

/* Projects Grid */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
}

.project-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    height: 450px;
    cursor: pointer;
}

.project-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.project-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(22, 29, 55, 0.9) 0%, rgba(22, 29, 55, 0.2) 60%, transparent 100%);
    color: var(--white);
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    transform: translateY(20px);
    transition: var(--transition);
    opacity: 0.9;
}

.project-item:hover img {
    transform: scale(1.1);
}

.project-item:hover .project-overlay {
    transform: translateY(0);
    opacity: 1;
}

.project-overlay h3 {
    font-size: 1.8rem;
    margin-bottom: 5px;
}

.project-overlay p {
    font-size: 1rem;
    opacity: 0.8;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease-out;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Footer */
footer {
    background: var(--secondary-color);
    padding: 100px 0 60px;
    color: var(--white);
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 40px;
}

.footer-logo .logo-icon {
    width: 60px;
    height: 60px;
    font-size: 2rem;
}

.footer-links {
    display: flex;
    gap: 40px;
    margin-bottom: 60px;
}

.footer-links a {
    font-weight: 600;
    font-size: 1.1rem;
    opacity: 0.7;
    transition: var(--transition);
}

.footer-links a:hover {
    opacity: 1;
    color: var(--primary-color);
}

.footer-bottom {
    padding-top: 40px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    width: 100%;
    text-align: center;
}

.footer-bottom p {
    opacity: 0.6;
    font-size: 0.95rem;
    letter-spacing: 0.5px;
}

/* Side-by-Side Layout */
.side-by-side {
    display: flex;
    align-items: center;
    gap: 60px;
}

.side-by-side .text-content {
    flex: 1;
}

.side-by-side .image-content {
    flex: 1;
}

.side-by-side .image-content img {
    width: 100%;
    height: auto;
    object-fit: cover;
}

/* Service Card Refinements */
.service-icon {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 25px;
    transition: var(--transition);
}

.service-card:hover .service-icon {
    transform: scale(1.1);
}

.service-card h3 {
    font-size: 1.8rem;
    margin-bottom: 20px;
    color: var(--secondary-color);
    font-weight: 700;
}

/* Value Items */
.value-icon {
    font-size: 3.5rem;
    color: var(--primary-color);
    margin-bottom: 30px;
}

/* Section Backgrounds & Spacing */
.overlay-dark {
    background: rgba(26, 26, 26, 0.85);
}

.section-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 30px;
}

section {
    padding: 120px 0;
}

/* Mobile Adjustments */
@media (max-width: 992px) {
    .side-by-side {
        flex-direction: column;
        text-align: center;
        gap: 40px;
    }

    .intro-paragraph {
        max-width: 100%;
    }

    .values-grid-premium {
        grid-template-columns: repeat(2, 1fr);
        gap: 30px;
    }

    .values-section-premium .section-title {
        font-size: 2.8rem;
    }

    nav.main-nav {
        grid-template-columns: 1fr auto;
    }

    .nav-links {
        display: none;
    }

    .hero h1 {
        font-size: 2.8rem;
    }

    .services-grid,
    .projects-grid {
        grid-template-columns: 1fr;
    }

    .container {
        padding: 0 20px;
    }
}

@media (max-width: 576px) {
    .values-grid-premium {
        grid-template-columns: 1fr;
    }

    .value-item-premium {
        padding: 40px 25px;
    }
}

/* Utility */
.text-center {
    text-align: center;
}

.mb-20 {
    margin-bottom: 20px;
}

.mb-40 {
    margin-bottom: 40px;
}

.mt-20 {
    margin-top: 20px;
}

.mt-40 {
    margin-top: 40px;
}

/* === MANDATORY STRICT BACKGROUND RULES === */
.bg-section {
    position: relative;
    min-height: 100vh;
    min-height: 100svh;
    overflow: hidden;
}

.section-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: #2d2c2b;
    /* Safety */
}

.overlay-strong {
    position: absolute;
    inset: 0;
    background: rgba(22, 29, 55, 0.9) !important;
    z-index: -1;
    pointer-events: none;
}

.section-content {
    position: relative;
    z-index: 1;
    color: #ffffff;
}

/* Background Utilities */
.bg-about-hero {
    background-image: url('../images/backgrounds/asia-building-services-bg.webp');
}

.bg-services-hero {
    background-image: url('../images/backgrounds/asia-building-services-bg.webp');
}

.bg-projects-hero {
    background-image: url('../images/backgrounds/asia-building-hero-section.webp');
}

.bg-careers-hero {
    background-image: url('../images/backgrounds/asia-building-about-background.webp');
}

.bg-contact-hero {
    background-image: url('../images/backgrounds/asia-building-contact-us-bg.webp');
}

.bg-cta {
    background-image: url('../images/backgrounds/asia-building-cta-background.webp');
}

.bg-vision {
    background-image: url('../images/backgrounds/asia-building-hero-section.webp');
}

.bg-management {
    background-image: url('../images/backgrounds/asia-building-cta-background.webp');
}

/* Helper for page heroes to respect design intent but keep structure */
.page-hero {
    min-height: 60vh !important;
}

/* Base styles for sections with backgrounds */
.page-hero,
.cta-section,
.management-section,
.hero {
    position: relative;
    /* Ensure text is above overlay */
    z-index: 2;
}

/* Content wrapper ensuring z-index above overlay */
.page-hero .container,
.cta-section .container,
.management-section .container,
.hero .container {
    position: relative;
    z-index: 3;
}

/* STRICT TEXT VISIBILITY ON BACKGROUNDS */
.page-hero h1,
.page-hero p,
.cta-section h2,
.cta-section p,
.management-section h2,
.management-section p,
.hero h1,
.hero p,
.text-on-dark {
    color: #ffffff !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
    /* High contrast shadow */
}

.page-hero h1 {
    font-weight: 800;
}

/* CTA Section Global Style */
.cta-section {
    padding: 100px 0;
    text-align: center;
    color: var(--white);
}

.cta-section .btn {
    margin-top: 30px;
    background: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.cta-section .btn:hover {
    background: transparent;
    color: var(--white);
}