/* General Resets & Base Styles */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --primary-color: #9b59b6; /* Purple */
    --secondary-color: #6c5ce7; /* Darker Purple/Blue */
    --accent-color: #0be881; /* Greenish accent for highlights */
    --text-light: rgba(255, 255, 255, 0.9);
    --text-dark: rgba(0, 0, 0, 0.9);
    --bg-dark: rgba(0, 0, 0, 0.9);
    --card-bg-light: rgba(255, 255, 255, 0.08); /* Adjusted for glassmorphism */
    --card-border: rgba(255, 255, 255, 0.18); /* Adjusted for glassmorphism */
    --shadow-light: 0 5px 15px rgba(0, 0, 0, 0.2);
    --shadow-dark: 0 10px 30px rgba(0, 0, 0, 0.4);
    --gradient-purple: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

@font-face {
    font-family: 'Montserrat-Arabic';
    src: url('font/Montserrat-Arabic-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
}

body {
    font-family: 'Montserrat', 'Cairo', sans-serif; /* Prioritize Montserrat for English, Cairo for Arabic */
    background-color: #1a1a2e; /* Dark background */
    color: var(--text-light);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
    background-image: url('img/background-pattern.png'); /* A subtle, modern pattern */
    background-size: cover;
    background-attachment: fixed;
    position: relative;
    padding-top: 100px; /* Space for fixed header on desktop */
}

/* Background Animated Blobs for dynamic feel */
.background-blob {
    position: fixed;
    border-radius: 50%;
    opacity: 0.3;
    filter: blur(100px); /* Soft blur effect */
    z-index: -1;
    animation: blob-animate 15s infinite alternate;
}

.background-blob.top-left {
    width: 300px;
    height: 300px;
    background-color: var(--primary-color);
    top: -50px;
    left: -50px;
    animation-delay: 0s;
}

.background-blob.bottom-right {
    width: 400px;
    height: 400px;
    background-color: var(--secondary-color);
    bottom: -100px;
    right: -100px;
    animation-delay: 2s;
}

@keyframes blob-animate {
    0% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -50px) scale(1.1); }
    66% { transform: translate(-20px, 40px) scale(0.9); }
    100% { transform: translate(0, 0) scale(1); }
}


/* --- Global Animations --- */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-50px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(50px); }
    to { opacity: 1; transform: translateX(0); }
}

/* Base animation classes */
.fade-in-up { animation: fadeInUp 0.8s ease-out forwards; opacity: 0; }
.fade-in-down { animation: fadeInDown 0.8s ease-out forwards; opacity: 0; }
.fade-in { animation: fadeIn 0.8s ease-out forwards; opacity: 0; }
.slide-in-left { animation: slideInLeft 0.8s ease-out forwards; opacity: 0; }
.slide-in-right { animation: slideInRight 0.8s ease-out forwards; opacity: 0; }

/* Delay Utility Classes for Staggered Animations */
.delay-1 { animation-delay: 0.1s !important; }
.delay-2 { animation-delay: 0.2s !important; }
.delay-3 { animation-delay: 0.3s !important; }

/* Intersection Observer Animations (Controlled by JS) */
.fade-in-on-scroll,
.slide-in-left-on-scroll,
.slide-in-right-on-scroll,
.fade-in-up-on-scroll {
    opacity: 0;
    transform: translateY(20px); /* Default slide up */
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.slide-in-left-on-scroll { transform: translateX(-50px); }
.slide-in-right-on-scroll { transform: translateX(50px); }

/* Class added by JS when element is visible */
.is-visible {
    opacity: 1;
    transform: translate(0, 0);
}


/* --- Glassmorphism Effect --- */
.glassmorphism {
    background: rgba(255, 255, 255, 0.08); /* Slightly visible background */
    border-radius: 16px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(8px); /* The key to glass effect */
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    transition: all 0.3s ease-in-out;
}

.glassmorphism:hover {
    background: rgba(255, 255, 255, 0.15); /* Slightly brighter on hover */
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.2);
}


/* --- Header Styles --- */
header {
    background-color: var(--bg-dark);
    padding: 15px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: var(--shadow-dark);
    border-bottom-left-radius: 20px;
    border-bottom-right-radius: 20px;
    animation-delay: 0s !important; /* Header appears instantly */
}

header .logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

header .logo img {
    width: 50px;
    height: auto;
    filter: drop-shadow(0 0 5px var(--primary-color));
}

header .logo h1 {
    font-size: 1.8rem;
    color: var(--text-light);
    font-weight: 700;
    text-shadow: 0 0 5px var(--primary-color);
}

/* زر البرجر - إخفاء افتراضياً على الديسكتوب وإظهار على الجوال */
.hamburger-menu {
    display: none; /* Hidden on desktop by default */
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    z-index: 1001;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.hamburger-menu .bar {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--primary-color);
    margin: 4px 0;
    transition: all 0.3s ease;
}

/* تحويل زر البرجر إلى X */
.hamburger-menu.is-active .bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger-menu.is-active .bar:nth-child(2) { opacity: 0; }
.hamburger-menu.is-active .bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }


/* Desktop Navigation */
.desktop-nav {
    display: flex;
    flex-grow: 1;
    justify-content: center;
    gap: 30px;
}

.nav-group {
    display: flex;
    list-style: none;
    gap: 20px;
}

.nav-btn {
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    padding: 8px 15px;
    border-radius: 8px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.nav-btn::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--primary-color);
    transform: translateX(-100%);
    transition: transform 0.3s ease;
}

.nav-btn:hover::before {
    transform: translateX(0);
}

.nav-btn:hover {
    color: var(--primary-color);
    text-shadow: 0 0 5px var(--primary-color);
}


/* Language Switcher */
.language-switcher {
    display: flex;
    gap: 10px;
}

.lang-btn {
    background: var(--card-bg-light);
    border: 1px solid var(--card-border);
    color: var(--text-light);
    padding: 8px 15px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.lang-btn:hover, .lang-btn.active {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 0 10px rgba(155, 89, 182, 0.6);
}


/* Mobile Navigation */
.mobile-nav {
    position: fixed;
    top: 0;
    right: -100%; /* Off-screen by default for LTR */
    width: 70%;
    max-width: 300px;
    height: 100%;
    background-color: var(--bg-dark);
    box-shadow: -5px 0 20px rgba(0, 0, 0, 0.4);
    z-index: 1000;
    transition: right 0.4s ease-in-out; /* Transition for LTR */
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 80px;
}

.mobile-nav.is-active {
    right: 0; /* Slide in for LTR */
}

.mobile-nav .close-menu {
    position: absolute;
    top: 20px;
    right: 20px; /* Position for LTR */
    background: none;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    font-size: 1.5rem;
    font-weight: bold;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.mobile-nav .close-menu:hover {
    background-color: var(--primary-color);
    color: white;
}

.mobile-nav .language-switcher {
    margin-bottom: 30px;
}

.mobile-nav ul {
    list-style: none;
    width: 100%;
    text-align: center;
    padding: 0;
}

.mobile-nav li {
    margin-bottom: 20px;
    opacity: 0;
    transform: translateX(20px);
    transition: opacity 0.4s ease-out, transform 0.4s ease-out;
}

.mobile-nav.is-active li {
    opacity: 1;
    transform: translateX(0);
}

.mobile-nav a {
    text-decoration: none;
    color: var(--text-light);
    font-size: 1.2rem;
    padding: 10px 0;
    display: block;
    transition: color 0.3s;
}

.mobile-nav a:hover {
    color: var(--primary-color);
}


/* --- New Layout Classes for Employee Sections --- */
.employees-layout-container {
    max-width: 1200px;
    margin: 60px auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 50px;
}

.category-title {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 40px;
    font-weight: 600;
    text-align: center;
    text-shadow: 0 0 8px rgba(155, 89, 182, 0.4);
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 10px;
    display: inline-block;
    width: auto;
    margin-left: auto;
    margin-right: auto;
}

/* Styling for individual sections (sec1, sec2, etc.) */
/* Removed general flex properties from here to avoid conflicts,
   specific sections will define their own display properties. */
section[class^="sec"] {
    width: 100%; /* Take full width of parent container */
    /* Ensure no conflicting display properties are inherited */
    margin-bottom: 0;
}

/* Specific styling for Owner Section (sec1) */
.owner-section {
    display: flex; /* Apply flexbox here for owner card */
    flex-direction: column;
    align-items: center;
    margin-bottom: 60px;
    justify-content: center; /* Center the single owner card */
    gap: 30px; /* Space between card and any title if present */
}

/* Specific styling for Management Team Row (sec2 and sec3) */
.management-team-row {
    width: 100%;
    display: flex;
    justify-content: center; /* Center the management cards */
    flex-wrap: wrap; /* Allow cards to wrap */
    gap: 40px; /* Space between management cards */
    margin-bottom: 60px;
}
.management-section {
    display: flex; /* Apply flexbox here for management card */
    flex-direction: column;
    align-items: center;
    width: 45%; /* Each management card takes roughly half width on larger screens */
    min-width: 300px; /* Minimum width for cards */
    max-width: 400px; /* Limit max width for better responsiveness */
}

/* Styling for Marketing Team Main Title */
.marketing-team-main-title {
    margin-top: 40px;
    margin-bottom: 50px;
}

/* Styling for Marketing Team Pyramid - This is the container for marketing cards */
.marketing-team-pyramid {
    width: 100%;
    display: flex; /* This remains flex to stack the section titles and card containers */
    flex-direction: column;
    align-items: center;
    gap: 40px;
}

/* *** CRITICAL CHANGE FOR MARKETING CARDS LAYOUT *** */
/* This section uses Flexbox to create 3-2-1 column layout */
.sec4.marketing-section {
    display: flex; /* Use flexbox for marketing cards */
    flex-wrap: wrap; /* ALLOW CARDS TO WRAP TO THE NEXT LINE */
    justify-content: center; /* Center cards horizontally in the row */
    gap: 30px; /* Space between cards */
    width: 100%; /* Ensure the flex container takes full width */
    max-width: 1100px; /* Limit max width of the section for better centering */
    margin: 0 auto; /* Center the marketing section itself */
}

/* Styling for individual Personal Business Card */
.personal-business-card {
    background: rgba(255, 255, 255, 0.08); /* Glassmorphism effect */
    border-radius: 16px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    transition: all 0.3s ease-in-out;
    padding: 25px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    /* Flexbox properties for responsive width */
    flex-grow: 1; /* Allow cards to grow */
    flex-shrink: 1; /* Allow cards to shrink */
    min-width: 280px; /* Minimum width before wrapping */
    max-width: 350px; /* Maximum width to prevent cards from becoming too wide */
    /* This flex-basis ensures ~3 cards per row on wider screens, accounting for gaps */
    flex-basis: calc(33.333% - 20px); /* (100% - 2*gap) / 3 if no max-width */
    margin-bottom: 0; /* Handled by gap on parent */
}

/* Hover effect for cards */
.personal-business-card:hover {
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.2);
}

/* Card internal elements styling */
.card-logo-section {
    margin-bottom: 15px;
}
.card-gs-tag-logo {
    width: 80px;
    height: auto;
    filter: drop-shadow(0 0 5px var(--primary-color));
}

.card-profile-section {
    margin-bottom: 20px;
}
.card-profile-pic {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--accent-color);
    box-shadow: 0 0 15px rgba(11, 232, 129, 0.6);
}

.card-info-section {
    margin-bottom: 25px;
}
.card-name {
    font-size: 1.8rem;
    color: var(--primary-color);
    margin-bottom: 8px;
    font-weight: 700;
}
.card-title {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.7);
}

.card-buttons-section {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
}
.card-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 20px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}
.primary-phone-btn {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 5px 15px rgba(155, 89, 182, 0.4);
}
.primary-phone-btn:hover {
    background: var(--secondary-color);
    box-shadow: 0 8px 20px rgba(108, 92, 231, 0.6);
}
.company-contact-btn {
    background: rgba(255, 255, 255, 0.15);
    color: var(--text-light);
    border: 1px solid rgba(255, 255, 255, 0.3);
}
.company-contact-btn:hover {
    background: var(--accent-color);
    color: #1a1a2e;
    border-color: var(--accent-color);
    box-shadow: 0 5px 15px rgba(11, 232, 129, 0.4);
}
.company-website-btn {
    background: rgba(255, 255, 255, 0.15);
    color: var(--text-light);
    border: 1px solid rgba(255, 255, 255, 0.3);
}
.company-website-btn:hover {
    background: var(--secondary-color);
    color: white;
    border-color: var(--secondary-color);
    box-shadow: 0 5px 15px rgba(108, 92, 231, 0.4);
}

/* Footer Styles */
footer {
    background-color: var(--bg-dark);
    padding: 30px 40px;
    color: var(--text-light);
    text-align: center;
    box-shadow: 0 -5px 15px rgba(0, 0, 0, 0.4);
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    margin-top: 80px;
}
.footer-content {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 30px;
    margin-bottom: 20px;
}
.footer-section {
    flex-basis: calc(33% - 40px);
    min-width: 250px;
    text-align: left;
}
.footer-logo-section img {
    width: 80px;
    margin-bottom: 15px;
}
.footer-logo-section .tagline {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.7);
}
.footer-section h3 {
    font-size: 1.2rem;
    color: var(--primary-color);
    margin-bottom: 15px;
}
.footer-links ul {
    list-style: none;
}
.footer-links ul li a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    margin-bottom: 8px;
    display: block;
    transition: color 0.3s ease;
}
.footer-links ul li a:hover {
    color: var(--accent-color);
}
.footer-contact p {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 8px;
}
.social-icons img {
    width: 35px;
    margin-right: 15px;
    transition: transform 0.3s ease;
}
.social-icons img:hover {
    transform: translateY(-3px);
}
.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 20px;
    margin-top: 20px;
}
.footer-bottom p {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
}


/* --- Media Queries for Responsiveness --- */
@media (max-width: 992px) {
    /* Layout for Management Team (2 cards per row usually, stacking on smaller) */
    .management-team-row {
        flex-direction: column; /* Stack management cards vertically */
        align-items: center;
        gap: 30px;
    }
    .management-section {
        width: 80%; /* Wider on smaller screens */
        max-width: 400px;
    }

    /* Marketing Team Layout: Now 2 cards per row on tablets */
    .sec4.marketing-section .personal-business-card {
        flex-basis: calc(50% - 15px); /* Two cards per row, accounting for gap */
        max-width: 380px; /* Adjust max width for better 2-column layout */
    }

    /* Footer adjustments */
    .footer-section {
        flex-basis: calc(50% - 20px);
        text-align: center;
    }
    .footer-logo-section, .footer-links, .footer-contact {
        margin: 0 auto;
    }
}

@media (max-width: 768px) {
    body {
        padding-top: 70px;
    }
    header {
        height: 70px;
        border-radius: 0;
        justify-content: space-between;
        padding: 10px 20px;
    }
    header .logo h1 {
        font-size: 1.5rem;
    }
    header .logo img {
        width: 40px;
    }
    /* Hide desktop navigation and show hamburger */
    .desktop-nav, .desktop-lang-switcher {
        display: none;
    }
    .hamburger-menu {
        display: flex;
    }
    .employees-layout-container {
        margin: 40px auto;
        padding: 15px;
        gap: 40px;
    }
    .category-title {
        font-size: 2rem;
        margin-bottom: 30px;
    }
    .personal-business-card {
        padding: 20px;
    }
    .card-profile-pic {
        width: 120px;
        height: 120px;
    }
    .card-name {
        font-size: 1.5rem;
    }
    .card-title {
        font-size: 1rem;
    }
    .card-btn {
        padding: 10px 15px;
        font-size: 0.9rem;
    }
    footer {
        padding: 40px 15px 10px;
        border-radius: 0;
    }
    .footer-content {
        flex-direction: column;
        align-items: center;
        gap: 25px;
    }
    .footer-section {
        flex-basis: 100%;
        text-align: center;
    }
    .footer-logo-section {
        text-align: center;
    }
    .footer-section h3 {
        text-align: center;
        margin-bottom: 15px;
    }
    .footer-links ul {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px 15px;
    }
    .social-icons {
        justify-content: center;
    }
    .footer-bottom {
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    /* Marketing Team Layout: Now 1 card per row on small phones */
    .sec4.marketing-section .personal-business-card {
        flex-basis: 100%; /* Single card per row on very small screens */
        max-width: 350px; /* Limit max-width to keep cards readable */
        margin: 0 auto; /* Center the single card if needed */
    }
    .management-section {
        width: 100%;
        max-width: 350px;
        margin: 0 auto;
    }
}

/* Language specific adjustments */
html[lang="ar"] .card-name,
html[lang="ar"] .card-title,
html[lang="ar"] .card-btn {
    font-family: 'Cairo', sans-serif;
}
html[lang="ar"] header .logo h1,
html[lang="ar"] .nav-btn,
html[lang="ar"] .lang-btn,
html[lang="ar"] .category-title,
html[lang="ar"] .footer-section h3,
html[lang="ar"] .footer-links ul li a,
html[lang="ar"] .footer-contact p,
html[lang="ar"] .footer-bottom p,
html[lang="ar"] .mobile-nav a {
    font-family: 'Cairo', sans-serif;
}


/* RTL adjustments for Arabic */
body.arabic-active {
    direction: rtl;
    font-family: 'Cairo', 'Montserrat-Arabic', sans-serif;
}

.arabic-active .hamburger-menu {
    margin-right: auto;
    margin-left: 0;
}
.arabic-active header .logo {
    margin-right: 0;
    margin-left: auto;
}

/* RTL for Mobile Navigation */
.arabic-active .mobile-nav {
    left: -100%;
    right: auto;
    box-shadow: 5px 0 20px rgba(0, 0, 0, 0.4);
    transition: left 0.4s ease-in-out;
}
.arabic-active .mobile-nav.is-active {
    left: 0;
    right: auto;
}
.arabic-active .mobile-nav .close-menu {
    left: 20px;
    right: auto;
}
.arabic-active .mobile-nav li {
    transform: translateX(-20px);
}

/* RTL Feature List Bullets - if applicable from other sections */
.arabic-active .package-card .features {
    text-align: right;
    padding-right: 0;
    padding-left: 0;
}
.arabic-active .package-card .features li {
    padding-right: 20px;
    padding-left: 0;
    text-align: right;
}
.arabic-active .package-card .features li::before {
    left: auto;
    right: 0;
    top: 0;
}

.arabic-active .footer-content {
    text-align: right;
}
.arabic-active .footer-links,
.arabic-active .footer-contact,
.arabic-active .footer-social,
.arabic-active .footer-logo-section {
    text-align: right;
}
.arabic-active .social-icons {
    justify-content: flex-end;
}

@media (max-width: 768px) {
    .arabic-active .footer-links,
    .arabic-active .footer-contact,
    .arabic-active .footer-social,
    .arabic-active .footer-logo-section {
        text-align: center;
    }
    .arabic-active .social-icons {
        justify-content: center;
    }
    .arabic-active .hamburger-menu {
        margin-right: 0;
        margin-left: auto;
    }
    .arabic-active header .logo {
        margin-right: auto;
        margin-left: 0;
    }
}