/* 1️⃣ BRAND FOUNDATION - CSS VARIABLES */
:root {
    /* Colors */
    --primary: #0A1F44;
    /* Navy Blue - Trust/Authority */
    --secondary: #FFFFFF;
    /* Pure White - Clarity */
    --accent: #F97316;
    /* Safety Orange - Action/CTA */
    --accent-hover: #ea580c;
    /* Darker Orange */
    --gray: #F5F7FA;
    /* Soft Gray - Background */
    --text-dark: #1E293B;
    /* Dark text for readability */
    --text-light: #64748B;
    /* Muted text */

    /* Typography */
    --font-head: 'Poppins', sans-serif;
    --font-body: 'Inter', sans-serif;

    /* Spacing */
    --container-width: 1200px;
    --section-padding: 80px 0;
    --border-radius: 8px;

    /* Shadows */
    --shadow-sm: 0 4px 6px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 20px 40px rgba(0, 0, 0, 0.12);
}

/* RESET & BASE STYLES */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* FIX: Ensure proper height calculation context */
html {
    height: 100%;
}

body {
    font-family: var(--font-body);
    color: var(--text-dark);
    background-color: var(--secondary);
    line-height: 1.6;
    overflow-x: hidden;
    /* Sticky Footer Fix */
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1 0 auto;
    /* Pushes footer down */
    width: 100%;
}

footer {
    flex-shrink: 0;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-head);
    color: var(--primary);
    font-weight: 700;
    line-height: 1.2;
}

p {
    font-size: 16px;
    color: var(--text-light);
    margin-bottom: 1rem;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s ease;
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

/* UTILITIES */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}

.text-center {
    text-align: center;
}

.text-primary {
    color: var(--primary);
}

.text-accent {
    color: var(--accent);
}

/* BUTTONS */
.btn {
    display: inline-block;
    padding: 14px 28px;
    font-size: 16px;
    font-weight: 500;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    font-family: var(--font-body);
    text-align: center;
}

.btn-primary {
    background-color: var(--accent);
    color: white;
    box-shadow: 0 4px 14px rgba(249, 115, 22, 0.4);
}

.btn-primary:hover {
    background-color: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(249, 115, 22, 0.6);
}

.btn-secondary {
    background-color: transparent;
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
}

.btn-secondary:hover {
    border-color: white;
    background-color: rgba(255, 255, 255, 0.1);
}

.btn-link {
    color: var(--secondary);
    font-weight: 600;
    margin-left: 15px;
    text-decoration: underline;
}

.btn-block {
    width: 100%;
    margin-top: 10px;
}

/* ANIMATIONS */
.fade-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-up.visible {
    opacity: 1;
    transform: translateY(0);
}

.slide-in-right {
    opacity: 0;
    transform: translateX(50px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.slide-in-right.visible {
    opacity: 1;
    transform: translateX(0);
}

/* HEADER & NAVIGATION */
/* HEADER & NAVIGATION */
header {
    background-color: var(--primary);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.nav-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 1002;
    text-decoration: none;
}

.logo-text {
    display: flex;
    flex-direction: column;
    font-size: 20px;
    font-weight: 700;
    color: white;
    line-height: 1.1;
    font-family: var(--font-head);
}

.logo-text span {
    color: var(--accent);
    font-size: 0.6em;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.logo img {
    height: 40px;
    width: auto;
    object-fit: contain;
}

/* Desktop Navigation */
.nav-menu {
    display: flex;
    gap: 30px;
    align-items: center;
}

.nav-menu a {
    color: rgba(255, 255, 255, 0.8);
    font-size: 15px;
    font-weight: 500;
    position: relative;
    padding: 5px 0;
}

.nav-menu a:not(.btn-nav-cta)::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: var(--accent);
    transition: width 0.3s;
}

.nav-menu a:hover::after,
.nav-menu a.active::after {
    width: 100%;
}

.nav-menu a:hover,
.nav-menu a.active {
    color: white;
}

/* Contact Button in Nav */
.btn-nav-cta {
    color: var(--accent) !important;
    font-weight: 600;
    border: 1px solid var(--accent);
    padding: 8px 16px !important;
    border-radius: 4px;
    transition: all 0.3s;
}

.btn-nav-cta:hover {
    background-color: var(--accent);
    color: white !important;
}

/* Hamburger Toggle */
.mobile-toggle {
    display: none;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 1002;
}

/* Hide Mobile Elements on Desktop */
.nav-overlay,
.nav-close-btn {
    display: none;
}

.bar {
    display: block;
    width: 25px;
    height: 3px;
    margin: 5px auto;
    background-color: white;
    transition: all 0.3s ease-in-out;
}

/* MOBILE RESPONSIVE STYLES */
@media (max-width: 768px) {

    /* Compact Header on Mobile */
    header {
        padding: 10px 0;
    }

    /* FIX: Maintain single row layout */
    .nav-wrapper {
        display: flex;
        flex-wrap: nowrap;
        justify-content: space-between;
        align-items: center;
        width: 100%;
    }

    .logo {
        z-index: 1003;
        max-width: 75%;
    }

    .logo-text {
        font-size: 16px;
    }

    .logo-text span {
        font-size: 0.7em;
        display: block;
        /* Ensure stacking */
    }

    .logo img {
        height: 32px;
        /* Slightly smaller icon */
        flex-shrink: 0;
        /* Prevent image squash */
    }

    .mobile-toggle {
        display: block;
        z-index: 1003;
        /* Ensure above mobile menu */
    }

    /* Mobile Menu Drawer */
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 0;
        gap: 0;
        flex-direction: column;
        background-color: var(--primary);
        width: 85%;
        /* Drawer width */
        max-width: 320px;
        height: 100vh;
        text-align: left;
        /* Better for drawer */
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.2);
        padding: 80px 20px 20px;
        z-index: 1002;
    }

    .nav-menu.active {
        left: 0;
    }

    /* Overlay */
    .nav-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1001;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s;
        backdrop-filter: blur(2px);
    }

    .nav-overlay.active {
        opacity: 1;
        visibility: visible;
    }

    /* Close Button */
    .nav-close-btn {
        position: absolute;
        top: 20px;
        right: 20px;
        background: rgba(255, 255, 255, 0.1);
        border: none;
        color: white;
        font-size: 28px;
        width: 40px;
        height: 40px;
        border-radius: 50%;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: background 0.3s;
    }

    .nav-close-btn:hover {
        background: rgba(255, 255, 255, 0.2);
        color: var(--accent);
    }

    .nav-menu li {
        margin: 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        width: 100%;
    }

    .nav-menu a {
        font-size: 16px;
        font-weight: 500;
        display: block;
        padding: 15px 10px;
        color: rgba(255, 255, 255, 0.9);
    }

    .nav-menu a:hover {
        background-color: rgba(255, 255, 255, 0.05);
    }

    /* Hamburger Animation */
    .mobile-toggle.active .bar:nth-child(2) {
        opacity: 0;
    }

    .mobile-toggle.active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    .mobile-toggle.active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    .btn-nav-cta {
        border: 1px solid rgba(255, 255, 255, 0.2);
        background-color: rgba(249, 115, 22, 0.1);
        display: inline-block !important;
        width: auto !important;
        margin: 10px auto 0;
        padding: 10px 30px !important;
    }
}

/* FOOTER */
footer {
    background-color: #020d1f;
    /* Darker than primary */
    color: #94a3b8;
    padding: 60px 0 20px;
    font-size: 15px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 40px;
}

.footer-logo {
    color: white;
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 15px;
    display: block;
}

.footer-col h4 {
    color: white;
    margin-bottom: 20px;
    font-size: 16px;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a:hover {
    color: var(--accent);
}

.copyright {
    text-align: center;
    font-size: 14px;
}

/* TOAST NOTIFICATION */
#toast {
    visibility: hidden;
    min-width: 300px;
    background-color: var(--primary);
    color: #fff;
    text-align: center;
    border-radius: 4px;
    padding: 16px;
    position: fixed;
    z-index: 2000;
    left: 50%;
    bottom: 30px;
    transform: translateX(-50%);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border-left: 5px solid var(--accent);
    opacity: 0;
    transition: opacity 0.3s, bottom 0.3s;
}

#toast.show {
    visibility: visible;
    opacity: 1;
    bottom: 50px;
}

/* =========================================
   MOBILE FOOTER FIX
   ========================================= */
@media (max-width: 768px) {
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 30px;
        padding-bottom: 20px;
    }

    .footer-col {
        text-align: center;
    }

    .footer-links {
        padding: 0;
    }

    .footer-links li {
        margin-bottom: 12px;
    }

    .footer-logo {
        justify-content: center;
    }
}

/* =========================================
   RTL SUPPORT (ARABIC)
   ========================================= */
[dir="rtl"] {
    font-family: 'Tajawal', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    text-align: right;
}

[dir="rtl"] h1,
[dir="rtl"] h2,
[dir="rtl"] h3,
[dir="rtl"] h4,
[dir="rtl"] h5,
[dir="rtl"] h6 {
    font-family: 'Tajawal', sans-serif;
}

[dir="rtl"] .btn-link {
    margin-left: 0;
    margin-right: 15px;
    flex-direction: row-reverse;
}

[dir="rtl"] .nav-menu {
    flex-direction: row;
    /* Keep menu consistent but items ordered RTL */
}

/* Ensure Desktop only for this rule if possible, but overriding in mobile is safer */

/* Fix Hero Logic for RTL */
[dir="rtl"] .hero-container {
    direction: rtl;
}

[dir="rtl"] .hero-content {
    text-align: right;
}

[dir="rtl"] .hero-buttons {
    flex-direction: row;
}

/* Form Styles RTL */
[dir="rtl"] .hero-form {
    text-align: right;
}

[dir="rtl"] .form-group label {
    text-align: right;
}

/* =========================================
   PAGE HERO STYLES (Used in About, Contact, Services)
   ========================================= */
.page-hero {
    position: relative;
    height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
    margin-bottom: 0;
}

.page-hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    z-index: 1;
}

.page-hero-overlay::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 32, 74, 0.85);
    /* Primary overlay */
    z-index: 2;
}

.page-hero-content {
    position: relative;
    z-index: 3;
    padding-top: 60px;
}

.page-hero-content h1 {
    color: white;
    font-size: 3.5rem;
    margin-bottom: 15px;
}

.page-hero-content .hero-sub {
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.9);
    max-width: 700px;
    margin: 0 auto;
}

/* FIX: Header Issue at 1024x600 (Landscape Tablet) */
@media screen and (min-width: 900px) and (max-width: 1100px) {
    .nav-wrapper {
        padding: 0 10px;
    }

    .nav-menu {
        gap: 15px;
        /* Reduce gap between items */
    }

    .nav-menu a {
        font-size: 13px;
        /* Slightly smaller font */
    }

    .logo {
        font-size: 20px;
    }

    .btn-nav-cta {
        padding: 6px 12px !important;
        font-size: 13px;
    }
}

/* Service Cards */
[dir="rtl"] .service-card {
    text-align: right;
}

[dir="rtl"] .icon-box {
    margin-right: 0;
    margin-left: 20px;
}

/* Footer */
[dir="rtl"] .footer-col {
    text-align: right;
}

/* Mobile Menu RTL */
/* Mobile Menu RTL */
@media (max-width: 768px) {
    [dir="rtl"] .nav-menu {
        left: auto;
        right: -100%;
        text-align: right;
        flex-direction: column !important;
        /* FIX: Force column to prevent spill */
        align-items: flex-start;
        /* Align items to the right (start of RTL) */
        transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    [dir="rtl"] .nav-menu.active {
        left: auto;
        right: 0;
    }

    [dir="rtl"] .nav-close-btn {
        right: auto;
        left: 20px;
    }

    /* Fix Contact Button Alignment in RTL Drawer */
    [dir="rtl"] .btn-nav-cta {
        margin: 10px 0 0 0;
        /* Remove auto margin to respect flex alignment */
    }

    /* Language Toggle Pill Style */
    #lang-toggle {
        display: inline-block;
        background: rgba(255, 255, 255, 0.1);
        padding: 8px 24px;
        border-radius: 50px;
        margin-top: 20px;
        color: var(--accent) !important;
        font-weight: 600;
        border: 1px solid var(--accent);
        text-align: center;
        transition: all 0.3s;
    }

    #lang-toggle:hover {
        background: var(--accent);
        color: white !important;
    }

    #lang-toggle:hover {
        background: var(--accent);
        color: white !important;
    }
}

/* =========================================
   CONTACT PAGE STYLES
   ========================================= */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: flex-start;
}

.contact-info-card h2 {
    font-size: 32px;
    margin-bottom: 20px;
}

.contact-info-card p {
    color: var(--text-light);
    margin-bottom: 30px;
    font-size: 16px;
}

.trust-badges {
    display: flex;
    flex-direction: column;
    gap: 25px;
    margin-bottom: 40px;
}

.trust-item {
    display: flex;
    align-items: flex-start;
    /* Align icon with top of text */
    gap: 15px;
    padding: 15px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    transition: transform 0.3s;
    border: 1px solid #f1f5f9;
}

.trust-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
    border-color: var(--accent);
}

.trust-item svg {
    width: 28px;
    height: 28px;
    min-width: 28px;
    /* Prevent shrinking */
    fill: var(--accent);
    margin-top: 2px;
    /* slight visual adjustment */
}

.trust-item span {
    font-size: 15px;
    color: var(--text-dark);
    line-height: 1.5;
}

.trust-item strong {
    color: var(--primary);
    display: block;
    margin-bottom: 2px;
}

/* Contact Page Responsive */
@media (max-width: 900px) {
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .contact-info-card {
        /* Natural stacking: Info first, then Form */
    }

    .hero-form-card {
        margin-top: 20px;
    }
}