/* ==========================================================================
   Base Styles & Variables
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;600;700&family=Inter:wght@300;400;600;700&display=swap');

:root {
    --primary-blue: #083c7e;
    --primary-blue-dark: #052654;
    --secondary-orange: #f27321;
    --secondary-orange-dark: #d25f16;
    --bg-white: #FFFFFF;
    --bg-light-gray: #F5F7FA;
    --text-main: #1E293B;
    --text-muted: #64748B;
    --border-color: #E2E8F0;
    
    --font-ar: 'Cairo', sans-serif;
    --font-en: 'Inter', sans-serif;
    
    --transition: all 0.3s ease;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1);
    
    --border-radius: 8px;
    --border-radius-lg: 12px;
}

html[lang="ar"] {
    direction: rtl;
    font-family: var(--font-ar);
}

html[lang="en"] {
    direction: ltr;
    font-family: var(--font-en);
}

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

body {
    background-color: var(--bg-white);
    color: var(--text-main);
    transition: background-color 0.3s ease, color 0.3s ease;
    line-height: 1.6;
    overflow-x: hidden;
}

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

ul {
    list-style: none;
}

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

/* ==========================================================================
   Typography
   ========================================================================== */
h1, h2, h3, h4, h5, h6 {
    color: var(--primary-blue);
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.3;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }

p { margin-bottom: 1rem; }

/* ==========================================================================
   Layout & Utilities
   ========================================================================== */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.section-padding {
    padding: 80px 0;
}

.bg-gray {
    background-color: var(--bg-light-gray);
}

.text-center {
    text-align: center;
}

.section-title {
    text-align: center;
    margin-bottom: 50px;
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background-color: var(--secondary-orange);
    margin: 15px auto 0;
    border-radius: 2px;
}

/* Flex Utilities */
.d-flex { display: flex; }
.align-items-center { align-items: center; }
.justify-content-between { justify-content: space-between; }
.justify-content-center { justify-content: center; }
.flex-column { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }
.gap-4 { gap: 2rem; }

/* Grid Utilities */
.grid { display: grid; }
.grid-cols-1 { grid-template-columns: 1fr; }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
.gap-grid { gap: 30px; }

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
    display: inline-block;
    padding: 12px 28px;
    font-weight: 600;
    border-radius: var(--border-radius);
    cursor: pointer;
    border: 2px solid transparent;
    text-align: center;
}

.btn-primary {
    background-color: var(--primary-blue);
    color: var(--bg-white);
}

.btn-primary:hover {
    background-color: var(--primary-blue-dark);
}

.btn-secondary {
    background-color: var(--secondary-orange);
    color: var(--bg-white);
}

.btn-secondary:hover {
    background-color: var(--secondary-orange-dark);
}

.btn-outline {
    background-color: transparent;
    border-color: var(--primary-blue);
    color: var(--primary-blue);
}

.btn-outline:hover {
    background-color: var(--primary-blue);
    color: var(--bg-white);
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */
header {
    background-color: var(--bg-white);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: var(--transition);
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
}

.logo {
    display: flex;
    align-items: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-blue);
    gap: 10px;
}

.logo img {
    height: 60px;
    max-height: 100%;
}

.nav-links {
    display: flex;
    gap: 30px;
}

.nav-links a {
    font-weight: 600;
    color: var(--text-main);
    padding: 10px 0;
    position: relative;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary-blue);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--secondary-orange);
    transition: var(--transition);
}
html[lang="ar"] .nav-links a::after {
    left: auto;
    right: 0;
}

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

.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.lang-switch {
    background: none;
    border: none;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 5px;
}

.lang-switch:hover {
    color: var(--primary-blue);
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--primary-blue);
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero {
    position: relative;
    height: calc(100vh - 80px);
    min-height: 500px;
    display: flex;
    align-items: center;
    background: linear-gradient(rgba(0, 59, 154, 0.8), rgba(0, 59, 154, 0.8)), url('../images/hero-bg.jpg') center/cover;
    color: var(--bg-white);
}

.hero-content {
    max-width: 700px;
}

.hero h1 {
    color: var(--bg-white);
    font-size: 3.5rem;
    margin-bottom: 20px;
    animation: fadeInUp 1s ease;
}

.hero p {
    font-size: 1.25rem;
    margin-bottom: 30px;
    opacity: 0.9;
    animation: fadeInUp 1s ease 0.2s;
    animation-fill-mode: both;
}

.hero-btns {
    display: flex;
    gap: 20px;
    animation: fadeInUp 1s ease 0.4s;
    animation-fill-mode: both;
}

/* ==========================================================================
   Cards (Products, Projects, Features)
   ========================================================================== */
.card {
    background-color: var(--bg-white);
    transition: background-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

.card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-5px);
}

.card-img-wrapper {
    height: 200px;
    overflow: hidden;
    position: relative;
    background-color: #eee;
}

.card-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.card:hover .card-img-wrapper img {
    transform: scale(1.05);
}

.card-content {
    padding: 25px;
}

.card-title {
    font-size: 1.25rem;
    margin-bottom: 10px;
}

/* ==========================================================================
   Statistics Section
   ========================================================================== */
.stats {
    background-color: var(--primary-blue);
    color: var(--bg-white);
    padding: 60px 0;
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 3rem;
    font-weight: 700;
    color: var(--secondary-orange);
    margin-bottom: 10px;
}

.stat-label {
    font-size: 1.1rem;
    font-weight: 600;
}

/* ==========================================================================
   Footer
   ========================================================================== */
footer {
    background-color: var(--primary-blue-dark);
    color: var(--bg-white);
    padding: 60px 0 20px;
}

.footer-top {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: 40px;
    margin-bottom: 40px;
}

.footer-about p {
    color: #cbd5e1;
    margin-top: 20px;
}

.footer-title {
    color: var(--bg-white);
    margin-bottom: 20px;
    font-size: 1.2rem;
    position: relative;
    padding-bottom: 10px;
}

.footer-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 2px;
    background-color: var(--secondary-orange);
}
html[lang="ar"] .footer-title::after {
    left: auto;
    right: 0;
}

.footer-links li {
    margin-bottom: 12px;
}

.footer-links a {
    color: #cbd5e1;
}

.footer-links a:hover {
    color: var(--secondary-orange);
}

.footer-contact li {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    color: #cbd5e1;
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 20px;
    text-align: center;
    color: #94a3b8;
    font-size: 0.9rem;
}

/* ==========================================================================
   Language Toggle Helpers
   ========================================================================== */
.lang-en { display: none; }
html[lang="en"] .lang-en { display: block; }
html[lang="en"] span.lang-en, html[lang="en"] a.lang-en { display: inline-block; }
html[lang="en"] .lang-ar { display: none !important; }

/* ==========================================================================
   Responsive Design
   ========================================================================== */
@media (max-width: 991px) {
    .grid-cols-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-cols-3 { grid-template-columns: repeat(2, 1fr); }
    .footer-top { grid-template-columns: repeat(2, 1fr); }
    .hero h1 { font-size: 2.5rem; }
}

@media (max-width: 768px) {
    .header-inner { position: relative; }
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: var(--bg-white);
        flex-direction: column;
        padding: 20px;
        box-shadow: var(--shadow-md);
        gap: 15px;
    }
    html[lang="ar"] .nav-links {
        left: auto;
        right: 0;
    }
    .nav-links.active {
        display: flex;
    }
    .mobile-menu-btn {
        display: block;
    }
    .grid-cols-2 { grid-template-columns: 1fr; }
    .footer-top { grid-template-columns: 1fr; }
    .hero { text-align: center; }
    .hero-btns { justify-content: center; }
    .hero-content { margin: 0 auto; }
}

/* ==========================================================================
   Animations
   ========================================================================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.8s ease forwards;
    opacity: 0;
}

[data-theme="dark"] {
    --bg-white: #0f172a;
    --bg-light-gray: #1e293b;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border-color: #334155;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.5);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.5);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.5);
}

[data-theme="dark"] header .logo img {
    filter: brightness(0) invert(1);
}

.theme-switch {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.25rem;
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}
.theme-switch:hover {
    color: var(--secondary-orange);
}
