/* ===============================================
   APEX WEBSITE - MODERN STYLING
   Bilingual (AR/EN) + Dark/Light Theme
   =============================================== */

/* ===== CSS VARIABLES - DARK THEME (DEFAULT) ===== */
:root[data-theme="dark"] {
    /* Colors */
    --primary-gradient: linear-gradient(135deg, #00D4FF 0%, #8B5CF6 100%);
    --bg-primary: #0a0a0f;
    --bg-secondary: #111118;
    --bg-card: #1e1e2e;
    --text-primary: #f5f5f7;
    --text-secondary: #a0a0ab;
    --accent-cyan: #00D4FF;
    --accent-purple: #8B5CF6;
    --border-color: rgba(255, 255, 255, 0.1);
    --shadow-glow: 0 0 40px rgba(0, 212, 255, 0.3);
}

/* ===== CSS VARIABLES - LIGHT THEME ===== */
:root[data-theme="light"] {
    /* Colors */
    --primary-gradient: linear-gradient(135deg, #0099CC 0%, #6B46C1 100%);
    --bg-primary: #ffffff;
    --bg-secondary: #f7f8fa;
    --bg-card: #ffffff;
    --text-primary: #1a1a1f;
    --text-secondary: #6b7280;
    --accent-cyan: #0099CC;
    --accent-purple: #6B46C1;
    --border-color: rgba(0, 0, 0, 0.1);
    --shadow-glow: 0 0 40px rgba(0, 153, 204, 0.2);
}

/* ===== COMMON VARIABLES ===== */
:root {
    /* Fonts */
    --font-arabic: 'Cairo', sans-serif;
    --font-en: 'Orbitron', monospace;

    /* Spacing */
    --container-width: 1440px;
    --header-height-large: 70px;
    --header-height-small: 60px;
}

/* ===== RESET & BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 100px;
}

body {
    font-family: var(--font-arabic);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
    transition: background 0.3s ease, color 0.3s ease;
}

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 24px;
}

/* ===== CINEMATIC ANIMATION OVERLAY ===== */
.cinematic-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(to bottom, #000, #111 90%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    opacity: 1;
    pointer-events: auto;
    transition: opacity 1s ease;
    direction: ltr;
}

.cinematic-overlay.hidden {
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
}

/* ===== MAIN CONTENT ===== */
.main-content {
    opacity: 0;
    visibility: hidden;
    transition: opacity 1s ease, visibility 0s 1s;
}

.main-content.visible {
    opacity: 1;
    visibility: visible;
    transition: opacity 1s ease, visibility 0s;
}

/* ===== HEADER / NAVBAR ===== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height-large);
    background: transparent;
    z-index: 1000;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Scrolled State - Compact Navbar */
.header.scrolled {
    height: var(--header-height-small);
    background: rgba(10, 10, 15, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

[data-theme="light"] .header.scrolled {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

.header-container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 40px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* ===== LOGO SECTION ===== */
.header-logo {
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.header-logo:hover {
    transform: translateY(-2px);
}

.logo-svg {
    width: 48px;
    height: 48px;
    filter: drop-shadow(0 0 10px rgba(0, 212, 255, 0.5));
    transition: all 0.5s ease;
}

.header.scrolled .logo-svg {
    width: 36px;
    height: 36px;
}

.logo-svg .logo-path {
    stroke-dasharray: 400;
    stroke-dashoffset: 400;
    fill-opacity: 0;
    animation: drawHeaderLogo 2s ease-out forwards;
}

@keyframes drawHeaderLogo {
    0% { stroke-dashoffset: 400; fill-opacity: 0; }
    60% { stroke-dashoffset: 0; fill-opacity: 0; }
    100% { stroke-dashoffset: 0; fill-opacity: 1; }
}

.header-logo:hover .logo-svg {
    filter: drop-shadow(0 0 15px rgba(0, 212, 255, 0.8));
}

.logo-text {
    font-family: var(--font-en);
    font-size: 32px;
    font-weight: 900;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 4px;
    transition: font-size 0.5s ease;
    white-space: nowrap;
    padding: 0 4px;
}

.header.scrolled .logo-text {
    font-size: 24px;
}

/* ===== NAVIGATION MENU ===== */
.nav-menu {
    display: flex;
    align-items: center;
    gap: 48px;
    transition: gap 0.5s ease;
}

.header.scrolled .nav-menu {
    gap: 32px;
}

.nav-link {
    position: relative;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
    transition: color 0.3s ease;
    padding: 8px 0;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-gradient);
    transition: width 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
    color: var(--accent-cyan);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

/* ===== HEADER CONTROLS ===== */
.header-controls {
    display: flex;
    align-items: center;
    gap: 16px;
}

.control-btn {
    position: relative;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.control-btn:hover {
    background: var(--bg-secondary);
    border-color: var(--accent-cyan);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 212, 255, 0.2);
}

/* Theme Toggle */
.theme-toggle .icon-sun,
.theme-toggle .icon-moon {
    position: absolute;
    transition: all 0.3s ease;
}

[data-theme="dark"] .theme-toggle .icon-sun {
    opacity: 0;
    transform: rotate(180deg) scale(0);
}

[data-theme="dark"] .theme-toggle .icon-moon {
    opacity: 1;
    transform: rotate(0) scale(1);
}

[data-theme="light"] .theme-toggle .icon-sun {
    opacity: 1;
    transform: rotate(0) scale(1);
}

[data-theme="light"] .theme-toggle .icon-moon {
    opacity: 0;
    transform: rotate(-180deg) scale(0);
}

/* Language Toggle */
.lang-toggle {
    min-width: 70px;
    font-family: var(--font-arabic);
    font-weight: 600;
    font-size: 14px;
}

.lang-text {
    transition: all 0.3s ease;
}

/* Mobile Toggle */
.mobile-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    width: 44px;
    height: 44px;
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 10px;
}

.mobile-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.mobile-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translateY(10px);
}

.mobile-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translateY(-10px);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 992px) {
    .header-container {
        padding: 0 24px;
    }

    .nav-menu {
        position: fixed;
        top: var(--header-height-large);
        right: -100%;
        width: 300px;
        height: calc(100vh - var(--header-height-large));
        background: var(--bg-card);
        border-left: 1px solid var(--border-color);
        flex-direction: column;
        align-items: flex-start;
        gap: 0;
        padding: 32px;
        transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    }

    [dir="ltr"] .nav-menu {
        left: -100%;
        right: auto;
        border-left: none;
        border-right: 1px solid var(--border-color);
    }

    .nav-menu.active {
        right: 0;
    }

    [dir="ltr"] .nav-menu.active {
        left: 0;
    }

    .header.scrolled .nav-menu {
        top: var(--header-height-small);
        height: calc(100vh - var(--header-height-small));
    }

    .nav-link {
        width: 100%;
        padding: 16px 0;
        border-bottom: 1px solid var(--border-color);
    }

    .mobile-toggle {
        display: flex;
    }
}

@media (max-width: 768px) {
    .header {
        height: 80px;
    }

    .header.scrolled {
        height: 60px;
    }

    .logo-text {
        font-size: 24px;
    }

    .header.scrolled .logo-text {
        font-size: 20px;
    }

    .logo-svg {
        width: 40px;
        height: 40px;
    }

    .header.scrolled .logo-svg {
        width: 32px;
        height: 32px;
    }
}
/* ===== SERVICES GRID ===== */
.services-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 30px; }
.service-card { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 16px; padding: 30px; transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275); opacity: 0; transform: translateY(30px); position: relative; overflow: hidden; z-index: 1; }
.service-card::before { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-image: linear-gradient(rgba(0, 212, 255, 0.05) 1px, transparent 1px), linear-gradient(90deg, rgba(0, 212, 255, 0.05) 1px, transparent 1px); background-size: 20px 20px; opacity: 0.5; z-index: -2; transition: all 0.5s ease; }
[data-theme="light"] .service-card::before { background-image: linear-gradient(rgba(0, 153, 204, 0.1) 1px, transparent 1px), linear-gradient(90deg, rgba(0, 153, 204, 0.1) 1px, transparent 1px); }
.service-card::after { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: radial-gradient(circle at top right, rgba(0, 212, 255, 0.1) 0%, transparent 60%), radial-gradient(circle at bottom left, rgba(139, 92, 246, 0.1) 0%, transparent 60%); z-index: -1; transition: all 0.5s ease; }
[data-theme="light"] .service-card::after { background: radial-gradient(circle at top right, rgba(0, 153, 204, 0.1) 0%, transparent 60%), radial-gradient(circle at bottom left, rgba(107, 70, 193, 0.1) 0%, transparent 60%); }
.service-card.visible { opacity: 1; transform: translateY(0); }
.service-card:hover { transform: translateY(-10px); box-shadow: 0 15px 30px rgba(0, 212, 255, 0.15); border-color: rgba(0, 212, 255, 0.4); }
.service-card:hover::before { transform: scale(1.1) rotate(2deg); opacity: 0.8; }
.service-card:hover::after { opacity: 1; background: radial-gradient(circle at center, rgba(0, 212, 255, 0.15) 0%, transparent 70%); }
.service-icon { width: 56px; height: 56px; border-radius: 14px; background: rgba(0, 212, 255, 0.1); display: flex; align-items: center; justify-content: center; margin-bottom: 20px; }
.service-card h3 { font-size: 18px; margin-bottom: 10px; color: var(--text-primary); }
.service-card p { color: var(--text-secondary); font-size: 14px; margin-bottom: 15px; line-height: 1.6; }
.service-link { color: var(--accent-cyan); font-weight: 600; font-size: 14px; text-decoration: none; transition: all 0.3s ease; }
.service-link:hover { letter-spacing: 1px; }

/* ===== WORK GRID ===== */
.work-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 400px), 1fr)); gap: 30px; }
.work-card { background: var(--bg-card); border-radius: 16px; overflow: hidden; border: 1px solid var(--border-color); transition: all 0.4s ease; opacity: 0; transform: translateY(30px); }
.work-card.visible { opacity: 1; transform: translateY(0); }
.work-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-glow); border-color: var(--accent-cyan); }
.work-card img { width: 100%; height: 220px; object-fit: cover; border-bottom: 1px solid var(--border-color); transition: transform 0.4s ease; }
.work-card:hover img { transform: scale(1.03); }
.work-card-info { padding: 18px 20px; }
.work-card-info h4 { color: var(--text-primary); font-size: 16px; margin-bottom: 6px; }
.work-card-info span { font-size: 12px; color: var(--accent-cyan); background: rgba(0, 212, 255, 0.1); padding: 4px 12px; border-radius: 20px; font-weight: 600; }

/* ===== CONTACT FORM ===== */
.contact-form { max-width: 600px; margin: 0 auto; background: var(--bg-card); padding: 40px; border-radius: 16px; border: 1px solid var(--border-color); box-shadow: 0 10px 30px rgba(0,0,0,0.1); }
.form-group { margin-bottom: 20px; }
.form-group input, .form-group textarea { width: 100%; padding: 15px; border-radius: 8px; border: 1px solid var(--border-color); background: rgba(0,0,0,0.2); color: var(--text-primary); font-family: var(--font-arabic); font-size: 16px; transition: all 0.3s; }
[data-theme="light"] .form-group input, [data-theme="light"] .form-group textarea { background: rgba(255,255,255,0.8); }
.form-group input:focus, .form-group textarea:focus { outline: none; border-color: var(--accent-cyan); box-shadow: 0 0 10px rgba(0, 212, 255, 0.2); }
.submit-btn { width: 100%; background: transparent; border: 1px solid var(--accent-cyan); color: var(--accent-cyan); border-radius: 8px; cursor: pointer; font-size: 18px; padding: 15px; transition: all 0.3s ease; font-weight: 600; letter-spacing: 1px; }
.submit-btn:hover { background: var(--accent-cyan); color: #fff; box-shadow: 0 5px 15px rgba(0, 212, 255, 0.2); transform: translateY(-2px); }

/* ===== SITE FOOTER ===== */
.site-footer { background: var(--bg-card); padding: 60px 0 20px; border-top: 1px solid var(--border-color); position: relative; z-index: 10; }
.footer-content { display: flex; justify-content: center; align-items: center; flex-direction: column; text-align: center; margin-bottom: 40px; }
.footer-brand { max-width: 400px; }
.footer-logo { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 15px; }
.footer-logo .logo-svg { width: 40px; height: 40px; filter: drop-shadow(0 0 10px rgba(0, 212, 255, 0.5)); }
.footer-logo .logo-text { font-family: var(--font-en); font-size: 24px; font-weight: 900; background: var(--primary-gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; letter-spacing: 2px; }
.footer-desc { color: var(--text-secondary); margin-bottom: 25px; line-height: 1.6; font-size: 15px; }
.social-links { display: flex; gap: 15px; justify-content: center; }
.social-link { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,0.05); color: var(--text-primary); text-decoration: none; transition: all 0.3s; border: 1px solid var(--border-color); }
.social-link:hover { transform: translateY(-3px); color: #fff; }
.social-link.facebook:hover { background: #1877F2; border-color: #1877F2; box-shadow: 0 5px 15px rgba(24, 119, 242, 0.4); }
.social-link.whatsapp:hover { background: #25D366; border-color: #25D366; box-shadow: 0 5px 15px rgba(37, 211, 102, 0.4); }
[data-theme="light"] .social-link { background: rgba(0,0,0,0.05); }
.footer-bottom { border-top: 1px solid var(--border-color); padding-top: 20px; text-align: center; color: var(--text-secondary); font-size: 14px; font-family: var(--font-en); }

/* ===== WHATSAPP FLOAT ===== */
.whatsapp-float { position: fixed; bottom: 30px; right: 30px; background-color: #25d366; color: #FFF; border-radius: 50px; width: 60px; height: 60px; z-index: 10000; box-shadow: 0 4px 10px rgba(37, 211, 102, 0.4); display: flex; align-items: center; justify-content: center; text-decoration: none; animation: pulse-green 2s infinite; }
.whatsapp-float:hover { background-color: #1ebe5d; transform: scale(1.1); transition: all 0.3s; }
@keyframes pulse-green { 0% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7); } 70% { box-shadow: 0 0 0 15px rgba(37, 211, 102, 0); } 100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); } }

/* ===== GENERIC BUTTON ===== */
.slide-btn { display: inline-block; background: var(--primary-gradient); color: #fff; padding: 12px 30px; border-radius: 30px; text-decoration: none; font-weight: 600; transition: transform 0.3s ease; }
.slide-btn:hover { transform: translateY(-3px); box-shadow: var(--shadow-glow); color: #fff; }

/* ===== LIGHTBOX MODAL ===== */
.lightbox-modal { display: none; position: fixed; z-index: 9999; left: 0; top: 0; width: 100%; height: 100%; background-color: rgba(0,0,0,0.9); backdrop-filter: blur(10px); }
.lightbox-close { position: absolute; top: 20px; right: 35px; color: #fff; font-size: 40px; font-weight: bold; cursor: pointer; z-index: 10000; transition: 0.3s; }
.lightbox-close:hover { color: var(--accent-cyan); }
.lightbox-content { position: relative; margin: auto; top: 50%; transform: translateY(-50%); width: 90%; max-width: 1000px; }
.lightbox-slider { position: relative; width: 100%; height: 80vh; display: flex; justify-content: center; align-items: center; }
.lightbox-slide { display: none; max-width: 100%; max-height: 100%; border-radius: 12px; box-shadow: 0 0 30px rgba(0, 212, 255, 0.2); border: 1px solid rgba(255,255,255,0.1); }
.lightbox-slide.active { display: block; animation: zoomIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
.lightbox-prev, .lightbox-next { cursor: pointer; position: absolute; top: 50%; transform: translateY(-50%); width: auto; padding: 16px; color: white; font-weight: bold; font-size: 24px; transition: 0.3s; background: rgba(0,0,0,0.5); border: none; border-radius: 50%; z-index: 10000; }
.lightbox-prev:hover, .lightbox-next:hover { background-color: var(--accent-cyan); }
.lightbox-prev { left: -60px; }
.lightbox-next { right: -60px; }
[dir="ltr"] .lightbox-prev { right: -60px; left: auto; }
[dir="ltr"] .lightbox-next { left: -60px; right: auto; }
@media (max-width: 768px) {
    .lightbox-prev { left: 10px; }
    .lightbox-next { right: 10px; }
    [dir="ltr"] .lightbox-prev { right: 10px; left: auto; }
    [dir="ltr"] .lightbox-next { left: 10px; right: auto; }
}
@keyframes zoomIn { from { transform: scale(0.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }
