/* ========================================
   YNA92 – Design System
   Adapted from almahir.ly structure
   Light Mode Default + Dark Toggle
   Accent: #F4BE37 (Industrial Gold)
======================================== */

:root {
    /* Base Variables (Light Mode) */
    --primary-color: #F4BE37;
    --primary-hover: #DDAA2A;
    --secondary-color: #2F314D;
    --secondary-hover: #3A3D60;

    --bg-main: #F5F6F8;
    --bg-card: #FFFFFF;
    --bg-header: rgba(255, 255, 255, 0.85);

    --text-primary: #2F314D;
    --text-secondary: #6B6E83;
    --text-inverse: #FFFFFF;

    --border-color: #E2E8F0;

    /* Effects */
    --shadow-sm: 0 4px 6px rgba(47, 49, 77, 0.05);
    --shadow-md: 0 10px 20px rgba(47, 49, 77, 0.08);
    --shadow-lg: 0 20px 40px rgba(47, 49, 77, 0.12);

    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);

    /* Layout */
    --max-width: 1280px;
    --border-radius: 6px;
}

[data-theme="dark"] {
    --bg-main: #0F172A;
    --bg-card: #1E293B;
    --bg-header: rgba(15, 23, 42, 0.85);

    --text-primary: #F8FAFC;
    --text-secondary: #94A3B8;
    --text-inverse: #0F172A;

    --border-color: #334155;

    --shadow-sm: 0 4px 6px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 10px 20px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.5);
}

/* ============================
   RESET
============================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Roboto', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-secondary);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Raleway', sans-serif;
    color: var(--text-primary);
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
}

a {
    text-decoration: none;
    color: var(--primary-color);
    transition: var(--transition);
}

a:not(.btn):not(.whatsapp-cta-btn):not(.mobile-whatsapp-link):not(.active-lang):hover,
a:not(.btn):not(.whatsapp-cta-btn):not(.mobile-whatsapp-link):not(.active-lang):hover * {
    color: var(--primary-color) !important;
}

ul { list-style: none; }

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ============================
   LAYOUT
============================ */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 2rem;
}

section { padding: 5rem 0; }

/* Section Headers */
.section-title {
    text-align: center;
    margin-bottom: 3rem;
}

.section-title h2 {
    font-size: 2.5rem;
    position: relative;
    display: inline-block;
    padding-bottom: 10px;
}

.section-title h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background-color: var(--primary-color);
    border-radius: 2px;
}

.section-title p {
    font-size: 1.1rem;
    max-width: 600px;
    margin: 1rem auto 0;
}

/* ============================
   BUTTONS
============================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: 'Raleway', sans-serif;
    font-weight: 700;
    padding: 12px 28px;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    border: none;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.95rem;
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--secondary-color);
}

.btn-primary:hover {
    background-color: #E5AC18 !important;
    color: var(--secondary-color) !important;
    transform: translateY(-3px);
    box-shadow: 0 8px 15px rgba(244, 190, 55, 0.4);
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: #FFFFFF;
}

.btn-secondary:hover {
    background-color: var(--secondary-hover) !important;
    color: #FFFFFF !important;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.cta-header-btn {
    width: 200px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 12px 0;
}

/* WhatsApp CTA Button */
.whatsapp-cta-btn {
    background-color: var(--primary-color) !important;
    color: var(--secondary-color) !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.whatsapp-cta-btn:hover {
    background-color: #E5AC18 !important;
    color: var(--secondary-color) !important;
    box-shadow: 0 8px 15px rgba(244, 190, 55, 0.4) !important;
}

/* Mobile WhatsApp link in hamburger – hidden on desktop */
.mobile-whatsapp-link {
    display: none !important;
}

/* ============================
   HEADER & NAV
   (Exact almahir.ly pattern)
============================ */
.site-header {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    background: var(--bg-header);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: var(--shadow-sm);
    padding: 1rem 0;
    transition: var(--transition);
}

.site-header.scrolled {
    padding: 0.5rem 0;
    box-shadow: var(--shadow-md);
}

.nav-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    direction: ltr !important;
}

/* Logo */
.logo {
    font-family: 'Raleway', sans-serif;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    display: flex;
    align-items: center;
}

.logo span { color: var(--primary-color); margin-left: 5px; }
[dir="rtl"] .logo span { margin-left: 0; margin-right: 5px; }

.site-logo-img {
    height: 75px;
    width: auto;
    object-fit: contain;
}

/* CENTER: Navigation */
.main-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
}

.nav-links {
    display: flex;
    gap: 2rem;
    margin: 0 auto;
}

.nav-links > a {
    color: var(--text-primary);
    font-weight: 500;
    position: relative;
    padding: 5px 0;
}

.nav-links > a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: var(--transition);
}

[dir="rtl"] .nav-links > a::after {
    left: auto;
    right: 0;
}

.nav-links > a:hover::after {
    width: 100%;
}

/* Services desktop submenu */
.has-submenu {
    position: relative;
    display: flex;
    align-items: center;
}

.has-submenu > a {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--text-primary);
    font-weight: 500;
    cursor: pointer;
    padding: 5px 0;
    position: relative;
}

.has-submenu > a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: var(--transition);
}

[dir="rtl"] .has-submenu > a::after {
    left: auto;
    right: 0;
}

.has-submenu.submenu-open > a::after {
    width: 100%;
}

.has-submenu > a:hover { color: var(--primary-color); }
.has-submenu > a > i { transition: transform 0.3s; font-size: 0.7rem; }
.has-submenu.submenu-open > a > i,
.has-submenu:hover > a > i { transform: rotate(180deg); }

.submenu {
    display: none;
    position: absolute;
    top: calc(100% + 14px);
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    min-width: 200px;
    flex-direction: column;
    overflow: hidden;
    z-index: 999;
}

.has-submenu.submenu-open .submenu,
.has-submenu:hover .submenu { display: flex; }

.submenu a {
    padding: 11px 18px;
    color: var(--text-primary);
    font-size: 0.9rem;
    display: block;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
}

.submenu a:last-child { border-bottom: none; }
.submenu a:hover { background: var(--bg-main); color: var(--primary-color); }

/* RIGHT – Controls */
.nav-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.switches-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.control-btn {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 1.2rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.control-btn:hover {
    background-color: rgba(128, 128, 128, 0.1);
    color: var(--primary-color);
}

/* Language Dropdown (adapted for almahir-style controls area) */
.lang-dropdown { position: relative; }

.lang-btn {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-family: 'Cairo', sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 6px 10px;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    justify-content: center;
    transition: var(--transition);
}

.lang-btn:hover {
    background-color: rgba(128, 128, 128, 0.1);
    color: var(--primary-color);
}

.lang-btn #lang-label { display: none; }
.lang-btn .fa-chevron-down { display: none; }

.lang-content {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    min-width: 140px;
    z-index: 1001;
    overflow: hidden;
}

.lang-dropdown:hover .lang-content,
.lang-dropdown.open .lang-content { display: block; }

.lang-content a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 16px;
    color: var(--text-primary);
    font-family: 'Cairo', sans-serif;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
}

.lang-content a:last-child { border-bottom: none; }
.lang-content a:hover { background: var(--bg-main); color: var(--primary-color); }
.lang-content a.active-lang { color: var(--primary-color); background: rgba(244, 190, 55, 0.08); }

/* Hamburger – hidden on desktop */
.mobile-menu-btn {
    display: none;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
}

/* ============================
   HERO SECTION
============================ */
.hero {
    height: 100vh;
    height: 100svh;
    min-height: 600px;
    display: flex;
    align-items: center;
    position: relative;
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}



.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(15, 23, 42, 0.7), rgba(15, 23, 42, 0.8));
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.hero-content h1 {
    color: #FFFFFF;
    font-size: 4rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 1.5rem;
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

.hero-content p {
    color: #E2E8F0;
    font-size: 1.25rem;
    margin-bottom: 2rem;
}

.hero-content .hero-badge {
    display: inline-block;
    background: var(--primary-color);
    color: var(--secondary-color);
    font-weight: 700;
    font-size: 0.85rem;
    padding: 5px 16px;
    border-radius: 50px;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 1.5rem;
    font-family: 'Cairo', sans-serif;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* ============================
   CARDS (Services/Products from API)
============================ */
.card-item-box {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

.card-item-box:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

/* ============================
   CONTACT SECTION
============================ */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 4rem;
}

.contact-info-card {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    border-inline-start: 4px solid var(--primary-color);
}

.contact-icon {
    width: 50px;
    height: 50px;
    background: var(--bg-main);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    font-size: 1.5rem;
    flex-shrink: 0;
}

.contact-text h4 { margin: 0; font-size: 1.1rem; }

.contact-form-wrapper {
    background: var(--bg-card);
    padding: 3rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    border-top: 5px solid var(--primary-color);
}

.form-group { margin-bottom: 1.5rem; }

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-family: 'Raleway', sans-serif;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.form-control {
    width: 100%;
    padding: 0.9rem 1rem;
    font-size: 1rem;
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: var(--border-radius);
    font-family: inherit;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(244, 190, 55, 0.2);
}

/* ============================
   FOOTER (almahir pattern)
============================ */
.site-footer {
    background-color: var(--secondary-color);
    color: #94A3B8;
    padding-top: 4rem;
}

[data-theme="dark"] .site-footer {
    background-color: #0B1120;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 2fr;
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-col h3 {
    color: #FFFFFF;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.footer-col h4 {
    color: #FFFFFF;
    margin-bottom: 1.5rem;
    font-size: 1.25rem;
    position: relative;
    padding-bottom: 0.5rem;
}

.footer-col h4::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 2px;
    background-color: var(--primary-color);
}

[dir="rtl"] .footer-col h4::after {
    left: auto;
    right: 0;
}

.footer-nav li,
.footer-contact li { margin-bottom: 0.8rem; }

.footer-nav a { color: #94A3B8; }

.footer-nav a:hover {
    color: var(--primary-color);
    padding-left: 5px;
}

[dir="rtl"] .footer-nav a:hover {
    padding-left: 0;
    padding-right: 5px;
}

.footer-contact li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.footer-contact i {
    color: var(--primary-color);
    margin-top: 5px;
}

.footer-bottom {
    background-color: rgba(0, 0, 0, 0.3);
    padding: 1.5rem 0;
    text-align: center;
    font-size: 0.9rem;
}



/* ============================
   ANIMATIONS
============================ */
.fade-up {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.fade-up.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Button Loading */
.btn-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.85;
    animation: btn-pulse 1.5s infinite;
}

@keyframes btn-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(244, 190, 55, 0.7); }
    70%  { box-shadow: 0 0 0 15px rgba(244, 190, 55, 0); }
    100% { box-shadow: 0 0 0 0 rgba(244, 190, 55, 0); }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Skeleton loaders */
.skeleton {
    background: linear-gradient(90deg, var(--bg-card) 25%, var(--border-color) 50%, var(--bg-card) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--border-radius);
}

@keyframes shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ============================
   RESPONSIVE – MOBILE (≤992px)
   Exact almahir.ly mobile header
============================ */
@media (max-width: 992px) {
    .nav-wrapper {
        display: flex;
        justify-content: space-between;
        align-items: center;
        height: 80px;
    }

    /* Logo centered on mobile */
    .logo {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        margin: 0;
        z-index: 5;
    }

    [dir="rtl"] .logo {
        left: 50%;
        right: auto;
        transform: translateX(-50%);
    }

    .mobile-menu-btn {
        display: block;
        order: -1;
        z-index: 10;
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .nav-controls {
        order: 1;
        z-index: 10;
        margin: 0;
    }

    .switches-container {
        flex-direction: column;
        gap: 2px;
    }

    .control-btn {
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }

    .lang-btn {
        width: 32px;
        height: 32px;
        font-size: 0.85rem;
    }

    .site-logo-img {
        height: 50px !important;
    }

    /* Nav links → dropdown panel below header */
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: var(--bg-header);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        flex-direction: column;
        padding: 2rem;
        box-shadow: var(--shadow-lg);
        text-align: center;
        border-bottom-left-radius: 20px;
        border-bottom-right-radius: 20px;
        border-top: 1px solid var(--border-color);
        gap: 0.5rem;
    }

    .nav-links.active {
        display: flex;
    }

    .nav-links > a::after {
        display: none;
    }

    /* Hide CTA on mobile */
    .cta-header-btn {
        display: none !important;
    }

    /* WhatsApp icon in hamburger menu */
    .mobile-whatsapp-link {
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 48px;
        height: 48px;
        border-radius: 50%;
        background: var(--primary-color);
        color: var(--secondary-color) !important;
        font-size: 1.5rem;
        margin: 0.5rem auto 0;
        transition: var(--transition);
        text-decoration: none;
    }

    .mobile-whatsapp-link:hover {
        background: #E5AC18;
        transform: scale(1.1);
        box-shadow: 0 4px 15px rgba(244, 190, 55, 0.4);
        color: var(--secondary-color) !important;
    }

    /* Services submenu in mobile dropdown */
    .has-submenu {
        flex-direction: column;
        width: 100%;
    }

    .has-submenu > a {
        width: 100%;
        justify-content: center;
    }

    .has-submenu > a::after {
        display: none;
    }

    .submenu {
        position: static;
        box-shadow: none;
        border: none;
        background: transparent;
        width: 100%;
        display: none;
        flex-direction: column;
        min-width: unset;
    }

    .has-submenu.submenu-open .submenu {
        display: flex;
        animation: fadeIn 0.3s ease;
    }

    .has-submenu:hover .submenu {
        display: none;
    }

    .has-submenu.submenu-open:hover .submenu {
        display: flex;
    }

    .submenu a {
        border-bottom: none;
        padding: 8px 16px;
        font-size: 0.85rem;
        color: var(--text-secondary);
    }

    .submenu a:hover {
        color: var(--primary-color);
        background: transparent;
    }

    /* Footer */
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    .footer-grid .footer-col:nth-child(1) {
        order: 2;
    }
    .footer-grid .footer-col:nth-child(2) {
        order: 1;
    }

    .hero-content h1 {
        font-size: 3rem;
    }

    .contact-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .hero-content h1 {
        font-size: 2.2rem;
    }

    .hero-actions {
        flex-direction: column;
        width: 100%;
        max-width: 300px;
        margin: 0 auto;
    }

    .contact-form-wrapper { padding: 1.5rem; }
}

/* ============================
   ARABIC & CJK TYPOGRAPHY
============================ */
[dir="rtl"] body,
[dir="rtl"] p,
[dir="rtl"] span,
[dir="rtl"] a,
[dir="rtl"] li,
[dir="rtl"] div {
    font-family: 'Tajawal', sans-serif !important;
}

[dir="rtl"] h1,
[dir="rtl"] h2,
[dir="rtl"] h3,
[dir="rtl"] h4,
[dir="rtl"] h5,
[dir="rtl"] h6,
[dir="rtl"] .btn {
    font-family: 'Cairo', sans-serif !important;
}
