/* Basic Reset & Global Styles */
:root {
    --primary-color: #FFFFFF; /* White background */
    --secondary-color: #000000; /* Black text for main elements */
    --accent-color: #007BFF; /* A standard blue for accents */
    --accent-color-hover: #0056b3; /* Darker blue on hover */
    --text-color: #333333; /* Dark grey for general text */
    --background-color: #F8F8F8; /* Light grey background for sections */
    --border-radius: 10px;
    --transition-speed: 0.3s ease-in-out;
    --shadow-strength: 0 2px 10px rgba(0, 0, 0, 0.08);
}

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

html {
    scroll-behavior: smooth;
    overflow-x: hidden; /* Ensure no horizontal scroll */
}

body {
    font-family: 'Nunito Sans Expanded', sans-serif; /* Default font for English/Russian */
    color: var(--text-color);
    background-color: var(--primary-color);
    line-height: 1.7;
    overflow-x: hidden;
    position: relative;
    text-align: center; /* All body text centered by default */
}

/* Apply Cairo font specifically for Arabic language */
html[lang="ar"] body {
    font-family: 'Cairo', sans-serif;
}
html[lang="ar"] h1,
html[lang="ar"] h2,
html[lang="ar"] h3,
html[lang="ar"] .brand-name {
    font-family: 'Cairo', sans-serif;
}

/* Remove background particle animation for light theme */
body::before {
    content: none;
}

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

a:hover {
    color: var(--accent-color-hover);
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Typography */
h1, h2, h3 {
    font-family: 'Press Start 2P', cursive; /* Headings use this font by default */
    text-align: center;
    margin-bottom: 20px;
    color: var(--secondary-color);
    text-shadow: none;
}

h1 {
    font-size: 3.8em;
    text-transform: uppercase;
    letter-spacing: 2.5px;
}

h2 {
    font-size: 2.8em;
    text-transform: uppercase;
    letter-spacing: 1.8px;
}

h3 {
    font-size: 1.9em;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    display: flex; /* Enable flexbox for icon alignment */
    align-items: center; /* Center icon vertically */
    justify-content: center; /* ?????????? ?????? ? ????? ?????? */
    text-align: center; /* Ensures text inside h3 also centers if it wraps */
    flex-wrap: wrap; /* ????????? ??????????? h3 ???????????? ?? ????? ?????? */
    word-break: break-word; /* ?????????????? ??????? ????, ???? ??? ??????? ??????? */
}
html[lang="ar"] h3 {
    flex-direction: row-reverse; /* For RTL, put icon on the right */
}


p {
    font-family: 'Intro', sans-serif;
    font-size: 1.1em;
    margin-bottom: 15px;
    color: var(--text-color);
    text-align: center; /* All paragraphs are now centered */
    overflow-wrap: break-word; /* ????????? ??????? ?????? ???????????? */
}

.section-title {
    margin-top: 70px;
    margin-bottom: 40px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--accent-color); /* Kept simple border-bottom for base */
    display: inline-block;
    text-align: center;
    width: auto;
    margin-left: auto;
    margin-right: auto;
    box-shadow: none;
    position: relative; /* Needed for ::after pseudo-element */
}

/* Geometric Section Dividers */
.section-title::after {
    content: '';
    position: absolute;
    bottom: -15px; /* Position below the border */
    left: 50%;
    transform: translateX(-50%);
    width: 60px; /* Width of the geometric element */
    height: 6px; /* Height of the geometric element */
    background-color: var(--accent-color);
    clip-path: polygon(0% 0%, 100% 0%, 80% 100%, 20% 100%); /* Simple chevron/arrow shape */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: background-color var(--transition-speed);
}

.section-title:hover::after {
    background-color: var(--accent-color-hover);
}


.section-description {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 40px auto;
    font-size: 1.2em;
    color: var(--text-color);
}

/* Header */
.header {
    background-color: var(--primary-color);
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
    z-index: 1000;
    padding: 15px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: var(--shadow-strength);
    min-height: 80px; /* Ensure a minimum height for the fixed header */
    display: flex; /* Make header a flex container to align navbar content */
    align-items: center; /* Vertically center content */
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    width: 100%; /* Ensure navbar takes full width of header container */
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-img {
    display: none;
}

.brand-name {
    font-family: 'Press Start 2P', cursive;
    font-size: 2em;
    color: var(--secondary-color);
    text-shadow: none;
}

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

.nav-links a {
    font-family: 'Intro', sans-serif;
    font-size: 1.1em;
    color: var(--secondary-color);
    position: relative;
    padding: 5px 0;
    transition: color var(--transition-speed);
}

.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    background: var(--accent-color);
    left: 50%;
    bottom: -3px;
    transform: translateX(-50%);
    transition: width var(--transition-speed), background var(--transition-speed);
}

.nav-links a:hover::after {
    width: 100%;
    background: var(--accent-color-hover);
}

.language-switcher select {
    background-color: var(--primary-color);
    color: var(--secondary-color);
    border: 1px solid rgba(0, 0, 0, 0.2);
    padding: 8px 12px;
    border-radius: var(--border-radius);
    font-family: 'Intro', sans-serif;
    cursor: pointer;
    outline: none;
    transition: border-color var(--transition-speed), box-shadow var(--transition-speed);
    box-shadow: none;
}

.language-switcher select:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 6px rgba(0, 123, 255, 0.2);
}

/* Hero Section (Home) */
.hero-section {
    position: relative;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    overflow: hidden;
    background-color: var(--primary-color);
    padding-top: 120px; /* Increased padding to account for fixed header */
}

#globe-canvas { /* New canvas for 3D globe */
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0; /* Behind everything */
}

#bg-animation-canvas { /* Existing canvas for 2D animation */
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1; /* Behind hero-content, but above 3D globe */
}

.hero-content {
    position: relative;
    z-index: 2; /* On top of both canvases */
    padding: 20px;
    animation: fadeInScale 1.5s ease-out forwards;
}

.main-slogan {
    margin-bottom: 20px;
    font-size: 4.5em;
    color: var(--secondary-color);
    text-shadow: none;
}

.cta-button {
    background-color: var(--accent-color);
    color: var(--primary-color);
    padding: 15px 30px;
    border-radius: var(--border-radius);
    font-family: 'Press Start 2P', cursive;
    font-size: 1.2em;
    text-transform: uppercase;
    transition: background-color var(--transition-speed), transform var(--transition-speed), box-shadow var(--transition-speed);
    box-shadow: var(--shadow-strength);
    border: none;
    cursor: pointer;
    position: relative; /* Needed for ripple effect */
    overflow: hidden;
    display: inline-block;
}

.cta-button:hover {
    background-color: var(--accent-color-hover);
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

/* Ripple Effect for buttons */
.ripple-button .ripple {
    position: absolute;
    background: rgba(255, 255, 255, 0.3); /* White ripple */
    border-radius: 50%;
    transform: scale(0);
    animation: rippleEffect 0.6s linear;
    pointer-events: none; /* Make sure it doesn't block clicks */
}

@keyframes rippleEffect {
    to {
        transform: scale(2.5); /* Increase scale for a wider ripple */
        opacity: 0;
    }
}


/* Corner Design Elements */
.corner-design {
    position: absolute;
    width: 80px;
    height: 80px;
    border: 2px solid rgba(0, 123, 255, 0.15);
    z-index: 1;
    pointer-events: none;
    opacity: 0.7;
}

.corner-design.top-left {
    top: 20px;
    left: 20px;
    border-right: none;
    border-bottom: none;
    border-top-left-radius: 10px;
}

.corner-design.top-right {
    top: 20px;
    right: 20px;
    border-left: none;
    border-bottom: none;
    border-top-right-radius: 10px;
}

.corner-design.bottom-left {
    bottom: 20px;
    left: 20px;
    border-right: none;
    border-top: none;
    border-bottom-left-radius: 10px;
}

.corner-design.bottom-right {
    bottom: 20px;
    right: 20px;
    border-left: none;
    border-top: none;
    border-bottom-right-radius: 10px;
}


/* Content Sections */
.content-section {
    padding: 80px 0;
    min-height: 80vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    text-align: center;
    /* ????? ??? ?????? */
    background-image:
        radial-gradient(rgba(0, 0, 0, 0.03) 1px, transparent 1px),
        radial-gradient(rgba(0, 0, 0, 0.03) 1px, transparent 1px);
    background-size: 20px 20px;
    background-position: 0 0, 10px 10px; /* ???????? ??? ???????? ????? */
}

.content-section:nth-of-type(odd) {
    background-color: var(--primary-color);
}

.content-section:nth-of-type(even) {
    background-color: var(--background-color);
    /* ?????????????? ???? ??? ?????? ?????? */
    background-image:
        linear-gradient(90deg, rgba(0, 123, 255, 0.02) 1px, transparent 1px),
        linear-gradient(rgba(0, 123, 255, 0.02) 1px, transparent 1px);
    background-size: 20px 20px;
}

/* About Section */
.about-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 40px;
    text-align: center;
}

.about-item {
    background-color: var(--primary-color);
    padding: 30px;
    border-radius: var(--border-radius);
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: var(--shadow-strength);
    transition: transform var(--transition-speed), box-shadow var(--transition-speed), border-color var(--transition-speed);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.about-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 123, 255, 0.03);
    opacity: 0;
    transition: opacity var(--transition-speed);
    z-index: -1;
}

.about-item:hover::before {
    opacity: 1;
}

.about-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 0 15px rgba(0, 123, 255, 0.6); /* Enhanced glow on hover */
    border-color: var(--accent-color);
}

.about-item h3 {
    margin-bottom: 15px;
    color: var(--accent-color);
    text-shadow: none;
    text-align: center;
}

/* Minimalist Icons in headings */
.icon-left {
    margin-right: 12px; /* Increased space between icon and text */
    color: var(--accent-color);
    font-size: 0.8em; /* Slightly adjusted icon size relative to h3 */
    transition: transform var(--transition-speed);
    flex-shrink: 0; /* ????????????? ?????????? ?????? */
}
.about-item:hover .icon-left,
.solution-card:hover .icon-left {
    transform: scale(1.1); /* Subtle grow on hover */
}
html[lang="ar"] .icon-left {
    margin-left: 12px;
    margin-right: 0;
}


/* Solutions Section */
.solutions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 40px;
    text-align: center;
}

.solution-card {
    background-color: var(--primary-color);
    padding: 30px;
    border-radius: var(--border-radius);
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: var(--shadow-strength);
    transition: transform var(--transition-speed), box-shadow var(--transition-speed), border-color var(--transition-speed);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.solution-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 123, 255, 0.03);
    opacity: 0;
    transition: opacity var(--transition-speed);
    z-index: -1;
}

.solution-card:hover::before {
    opacity: 1;
}

.solution-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 0 15px rgba(0, 123, 255, 0.6); /* Enhanced glow on hover */
    border-color: var(--accent-color);
}

.solution-card h3 {
    margin-bottom: 15px;
    color: var(--accent-color);
    text-shadow: none;
    text-align: center;
}

/* Contact Section */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
    margin-top: 40px;
    text-align: center;
    justify-content: center;
}

.contact-info {
    background-color: var(--primary-color);
    padding: 30px;
    border-radius: var(--border-radius);
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: var(--shadow-strength);
    text-align: center;
    transition: box-shadow var(--transition-speed);
    max-width: 600px;
    margin: 0 auto;
}

.contact-info:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.contact-info p, .contact-info a {
    font-family: 'Intro', sans-serif;
    margin-bottom: 10px;
    color: var(--text-color);
    text-align: center;
}

/* Footer */
.footer {
    background-color: var(--primary-color);
    color: var(--text-color);
    text-align: center;
    padding: 30px 0;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    font-family: 'Intro', sans-serif;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}

/* Animations */
@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* --- Hamburger Menu & Mobile Navigation --- */

/* ???????? ??????-???? ?? ????????? ?? ???????? */
.hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    z-index: 1001; /* ?????? ????? */
    position: relative; /* ??? ???????? ???? */
    width: 40px; /* ????????????? ?????? ??? ???????????? ??????? */
    height: 40px; /* ????????????? ?????? */
    display: flex; /* ??? ????????????? ????? */
    flex-direction: column; /* ???? ???? ??? ?????? */
    justify-content: center; /* ?????????? ???? ??????????? */
    align-items: center; /* ?????????? ???? ????????????? */
}

.hamburger .bar {
    display: block;
    width: 25px;
    height: 3px;
    margin: 4px auto;
    background-color: var(--secondary-color); /* ???? ????? */
    transition: all 0.3s ease-in-out;
    border-radius: 2px;
}

/* ???????? ??????-???? ? ??????? */
.hamburger.is-active .bar:nth-child(2) {
    opacity: 0;
}

.hamburger.is-active .bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.hamburger.is-active .bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Desktop-only elements */
.desktop-only {
    display: block;
}

.mobile-language-switcher {
    display: none; /* Hidden on desktop */
}

/* Responsive Design */
@media (max-width: 768px) {
    .navbar {
        flex-direction: row; /* Keep as row for main header elements */
        justify-content: space-between;
        align-items: center;
        padding: 10px 20px; /* Adjust padding for mobile header */
    }

    .hamburger {
        display: block; /* Show hamburger on mobile */
    }

    .nav-links {
        position: fixed; /* Full screen overlay */
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background-color: var(--primary-color); /* Overlay background */
        flex-direction: column;
        justify-content: center;
        align-items: center;
        transform: translateX(100%); /* Slide from right (LTR default) */
        transition: transform 0.3s ease-in-out;
        z-index: 999; /* Below header, but above content */
        pointer-events: none; /* Prevent interaction when hidden */
        padding: 0; /* Reset padding for full height */
        gap: 20px; /* Adjust spacing for mobile menu items */
    }

    .nav-links.is-active {
        transform: translateX(0); /* Slide into view */
        pointer-events: auto; /* Allow interaction when active */
    }

    .nav-links li {
        width: 100%;
        padding: 0; /* Reset padding for list items */
    }

    .nav-links a {
        padding: 15px 0; /* Large clickable area */
        display: block;
        font-size: 1.5em; /* Larger font for mobile menu */
        color: var(--secondary-color); /* Ensure good contrast */
    }

    .nav-links a::after {
        content: none; /* Remove underline animation for mobile menu */
    }

    .language-switcher.desktop-only {
        display: none; /* Hide desktop language switcher on mobile */
    }

    .mobile-language-switcher {
        display: block; /* Show mobile language switcher inside overlay */
        margin-top: 30px; /* Space from nav links */
        width: 100%;
        text-align: center;
    }

    .mobile-language-switcher select {
        width: calc(100% - 80px); /* Adjust width */
        max-width: 250px;
        font-size: 1.1em;
        padding: 10px 15px;
    }

    /* Adjust order for RTL mobile (index_ar.html) */
    html[lang="ar"] .navbar {
        flex-direction: row;
        justify-content: space-between;
    }
    html[lang="ar"] .logo {
        order: 3; /* Move logo to end for RTL */
    }
    html[lang="ar"] .hamburger {
        order: 2; /* Hamburger in the middle for RTL */
    }
    html[lang="ar"] .language-switcher.desktop-only {
        order: 1; /* Language switcher first for RTL on desktop */
    }
    html[lang="ar"] .nav-links {
        transform: translateX(-100%); /* Slide from left for RTL */
        left: auto; /* Reset left */
        right: 0; /* Anchor to right */
    }
    html[lang="ar"] .nav-links.is-active {
        transform: translateX(0); /* Slide into view for RTL */
    }

    /* Adjustments for smaller fonts and spacing on mobile */
    .main-slogan {
        font-size: 2.8em; /* Adjusted from 4.5em */
    }

    h1 {
        font-size: 3em; /* Adjusted from 3.8em */
    }

    h2 {
        font-size: 2.2em; /* Adjusted from 2.8em */
    }

    h3 {
        font-size: 1.6em; /* Adjusted from 1.9em */
        letter-spacing: 0.8px;
    }

    .cta-button {
        padding: 12px 25px;
        font-size: 1em;
    }

    .brand-name {
        font-size: 1.8em;
    }

    .nav-links a {
        font-size: 1.2em;
    }

    .language-switcher select {
        padding: 6px 10px;
        font-size: 0.9em;
    }

    .hero-section {
        padding-top: 90px; /* Adjusted padding for mobile header height */
    }
}

/* ?????????? ??? ????? ????????? ??????? */
@media (max-width: 480px) {
    .navbar {
        padding: 10px 15px;
    }

    .brand-name {
        font-size: 1.5em; /* ??????? ????????? ??????? */
    }

    .hamburger {
        width: 35px;
        height: 35px;
    }
    .hamburger .bar {
        width: 20px;
        margin: 3px auto;
    }
    .hamburger.is-active .bar:nth-child(1) {
        transform: translateY(6px) rotate(45deg);
    }

    .hamburger.is-active .bar:nth-child(3) {
        transform: translateY(-6px) rotate(-45deg);
    }

    .nav-links a {
        font-size: 1.3em; /* Further adjust font size for very small screens */
    }

    .main-slogan {
        font-size: 2.2em;
        letter-spacing: 0.5px;
    }

    h1 {
        font-size: 2.5em;
    }

    h2 {
        font-size: 1.8em;
    }

    h3 {
        font-size: 1.4em;
        letter-spacing: 0.5px;
    }
}

/* Scroll Animation Classes (added by JS) */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px); /* Increased initial Y translation */
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.animate-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Specific animations for cards with varied delays and types */
.about-item.animate-on-scroll { } /* Base animation */
.about-item:nth-child(2).animate-on-scroll { transition-delay: 0.05s; }
.about-item:nth-child(3).animate-on-scroll { transition-delay: 0.1s; }
.about-item:nth-child(4).animate-on-scroll { transition-delay: 0.15s; }
.about-item:nth-child(5).animate-on-scroll { transition-delay: 0.2s; }
.about-item:nth-child(6).animate-on-scroll { transition-delay: 0.25s; }

.solution-card.animate-on-scroll { } /* Base animation */
.solution-card:nth-child(2).animate-on-scroll { transition-delay: 0.05s; }
.solution-card:nth-child(3).animate-on-scroll { transition-delay: 0.1s; }
.solution-card:nth-child(4).animate-on-scroll { transition-delay: 0.15s; }
.solution-card:nth-child(5).animate-on-scroll { transition-delay: 0.2s; }
.solution-card:nth-child(6).animate-on-scroll { transition-delay: 0.25s; }

.contact-info.animate-on-scroll { transition-delay: 0.05s; }
