/* CSS Variables & Reset */
:root {
    /* Light Theme Palette */
    --color-bg: #f8fafc;
    /* Very light slate */
    --color-bg-secondary: #ffffff;
    /* Pure white */
    --color-text-primary: #0f172a;
    /* Dark slate */
    --color-text-secondary: #475569;
    /* Medium slate */
    --color-metallic: #94a3b8;
    --color-border: #e2e8f0;
    /* Light border */

    /* Accents - Retaining the Blue identity but adjusted for light bg */
    --color-accent: #0ea5e9;
    /* Sky Blue 500 */
    --color-primary: #0284c7;
    /* Sky Blue 600 */

    --font-main: 'Inter', 'Cairo', sans-serif;

    --transition-fast: 0.3s ease;
    --transition-smooth: 0.5s cubic-bezier(0.4, 0, 0.2, 1);

    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.05), 0 2px 4px -2px rgb(0 0 0 / 0.05);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.05), 0 4px 6px -4px rgb(0 0 0 / 0.05);
    --shadow-glow: 0 0 15px rgba(14, 165, 233, 0.15);
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-main);
    background-color: var(--color-bg);
    color: var(--color-text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    direction: rtl;
    text-align: right;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition-fast);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    line-height: 1.2;
    color: var(--color-text-primary);
    font-weight: 700;
}

p {
    color: var(--color-text-secondary);
    margin-bottom: 1rem;
}

.text-gradient {
    background: linear-gradient(to left, #0f172a, #334155);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.text-accent {
    color: var(--color-accent);
}

/* Utilities */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.grid {
    display: grid;
    gap: 2rem;
}

.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.flex {
    display: flex;
    gap: 1rem;
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.flex-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.section {
    padding: 5rem 0;
}

.btn {
    display: inline-block;
    padding: 0.875rem 2rem;
    background-color: transparent;
    border: 1px solid var(--color-accent);
    color: var(--color-accent);
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    text-transform: uppercase;
    font-size: 0.875rem;
    letter-spacing: 0.5px;
    transition: var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.btn:hover {
    background-color: var(--color-accent);
    color: white;
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.btn-primary {
    background-color: var(--color-accent);
    color: white;
}

.btn-primary:hover {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 1.5rem 0;
    background-color: rgba(255, 255, 255, 0.9);
    /* Light translucent */
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--color-border);
    transition: var(--transition-fast);
}

.navbar.scrolled {
    padding: 1rem 0;
    background-color: rgba(255, 255, 255, 0.95);
    box-shadow: var(--shadow-sm);
}

.nav-logo {
    display: flex;
    align-items: center;
    padding: 0.5rem 0;
}

.nav-logo img {
    height: 60px;
    transition: var(--transition-fast);
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-link {
    font-size: 1rem;
    color: var(--color-text-secondary);
    font-weight: 500;
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    bottom: -5px;
    right: 0;
    height: 2px;
    background-color: var(--color-accent);
    transition: var(--transition-fast);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.nav-link:hover,
.nav-link.active {
    color: var(--color-accent);
}

/* Mobile Nav Toggle */
.mobile-toggle {
    display: none;
    font-size: 1.5rem;
    color: var(--color-text-primary);
    cursor: pointer;
}

/* Enhanced Hero Section - Light Mode Friendly */
.hero {
    position: relative;
    height: 100vh;
    display: flex;
    align-items: center;
    overflow: hidden;
    color: white;
    /* Important: Hero text still needs to be light if over image */
}

/* Background Animation */
.hero-bg-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.hero-bg {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    animation: zoomEffect 20s infinite alternate linear;
}

@keyframes zoomEffect {
    0% {
        transform: scale(1);
    }

    100% {
        transform: scale(1.1);
    }
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Dark overlay still needed for text legibility on images */
    background: linear-gradient(to left, rgba(15, 23, 42, 0.8), rgba(15, 23, 42, 0.4));
    z-index: 1;
}

.hero-overlay::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.1) 1px, transparent 1px);
    background-size: 40px 40px;
    z-index: 1;
    opacity: 0.3;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    /* Hero text color override */
    color: white;
}

.hero-content p {
    color: #cbd5e1;
    /* Light gray for description on dark overlay */
}

.hero-content h1 {
    color: white;
}

.hero-subtitle {
    display: inline-block;
    color: #38bdf8;
    /* Brighter blue for contrast on dark overlay */
    font-weight: 600;
    letter-spacing: 1px;
    margin-bottom: 1.5rem;
    padding: 0.5rem 1rem;
    background: rgba(14, 165, 233, 0.2);
    border-radius: 50px;
    border: 1px solid rgba(56, 189, 248, 0.3);
    backdrop-filter: blur(5px);
    animation: slideInDown 1s ease-out;
}

.hero-title {
    font-size: 4.5rem;
    margin-bottom: 1.5rem;
    line-height: 1.1;
    animation: fadeInUp 1s ease-out 0.3s backwards;
}

.hero-desc {
    font-size: 1.35rem;
    margin-bottom: 3rem;
    max-width: 650px;
    animation: fadeInUp 1s ease-out 0.6s backwards;
}

.hero-btns {
    animation: fadeInUp 1s ease-out 0.9s backwards;
}

/* Hero Small (Page Headers) - Adjusted for Light Mode */
.hero-small {
    height: 50vh;
    min-height: 400px;
    align-items: center;
    display: flex;
}

/* Animations Keyframes */
@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* General Animations */
.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.fade-in-up.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Cards - Light Theme */
.card {
    background-color: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    padding: 2rem;
    border-radius: 8px;
    transition: var(--transition-fast);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.card:hover {
    transform: translateY(-5px);
    border-color: var(--color-accent);
    box-shadow: var(--shadow-lg);
}

.card-icon {
    font-size: 2.5rem;
    color: var(--color-accent);
    margin-bottom: 1.5rem;
}

.card-title {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--color-text-primary);
}

/* Section specific */
.bg-secondary {
    background-color: var(--color-bg-secondary);
}

/* Footer - Dark Footer is often better even in light themes, but let's make it light grey as per request */
footer {
    background-color: #f1f5f9;
    /* Light Gray */
    border-top: 1px solid var(--color-border);
    padding: 4rem 0 2rem;
    color: var(--color-text-secondary);
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 4rem;
    margin-bottom: 3rem;
    text-align: right;
}

.footer-brand h3 {
    color: var(--color-text-primary);
    margin-bottom: 1rem;
}

.footer-links h4 {
    color: var(--color-text-primary);
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

.footer-links ul li {
    margin-bottom: 0.75rem;
}

.footer-links ul li a:hover {
    color: var(--color-accent);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid var(--color-border);
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 768px) {

    .grid-2,
    .grid-3 {
        grid-template-columns: 1fr;
    }

    .navbar {
        padding: 1rem 0;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: var(--color-bg-secondary);
        flex-direction: column;
        padding: 2rem;
        gap: 1.5rem;
        border-bottom: 1px solid var(--color-border);
        text-align: center;
        box-shadow: var(--shadow-lg);
    }

    .nav-links.active {
        display: flex;
    }

    .mobile-toggle {
        display: block;
        margin-right: auto;
        margin-left: 0;
    }

    .nav-logo {
        margin-left: auto;
    }

    .hero-title {
        font-size: 2.8rem;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--color-text-primary);
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 0.875rem;
    background-color: #fff;
    /* White bg for inputs */
    border: 1px solid var(--color-border);
    border-radius: 4px;
    color: var(--color-text-primary);
    font-family: var(--font-main);
    transition: var(--transition-fast);
    text-align: right;
}

.form-control:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.1);
}

textarea.form-control {
    resize: vertical;
    min-height: 120px;
}

/* Table */
.table-container {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.table th,
.table td {
    padding: 1rem;
    text-align: right;
    border-bottom: 1px solid var(--color-border);
    color: var(--color-text-secondary);
}

.table th {
    color: var(--color-text-primary);
    font-weight: 600;
}

.table tr:hover {
    background-color: #f1f5f9;
}