:root, [data-theme="default"] {
    --primary: #00d2ff;
    --secondary: #3a7bd5;
    --accent: #ffd700;
    --bg-main: #0f172a;
    --card-glass: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-main: #f1f5f9;
    --header-bg: rgba(15, 23, 42, 0.9);
    --hero-overlay: linear-gradient(to bottom, rgba(15, 23, 42, 0.4) 0%, rgba(15, 23, 42, 0.8) 100%);
    --footer-bg: #020617;
    --lang-dropdown-bg: rgba(15, 23, 42, 0.95);
    --card-hover-bg: rgba(255, 255, 255, 0.08);
    --scrollbar-thumb: rgba(255, 255, 255, 0.2);
    --scrollbar-thumb-hover: var(--primary);
    --lang-hover-bg: rgba(255, 255, 255, 0.05);
}

[data-theme="light"] {
    --primary: #0088cc;
    --secondary: #00b7ff;
    --accent: #f59e0b;
    --bg-main: #f8fafc;
    --card-glass: rgba(0, 0, 0, 0.05);
    --glass-border: rgba(0, 0, 0, 0.1);
    --text-main: #0f172a;
    --header-bg: rgba(248, 250, 252, 0.9);
    --hero-overlay: linear-gradient(to bottom, rgba(255, 255, 255, 0.5) 0%, rgba(248, 250, 252, 1) 100%);
    --footer-bg: #e2e8f0;
    --lang-dropdown-bg: rgba(248, 250, 252, 0.95);
    --card-hover-bg: rgba(0, 0, 0, 0.08);
    --scrollbar-thumb: rgba(0, 0, 0, 0.2);
    --scrollbar-thumb-hover: var(--primary);
    --lang-hover-bg: rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] {
    --primary: #00b4d8;
    --secondary: #0077b6;
    --accent: #ffd700;
    --bg-main: #000000;
    --card-glass: rgba(255, 255, 255, 0.08);
    --glass-border: rgba(255, 255, 255, 0.15);
    --text-main: #ffffff;
    --header-bg: rgba(0, 0, 0, 0.9);
    --hero-overlay: linear-gradient(to bottom, rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0.9) 100%);
    --footer-bg: #050505;
    --lang-dropdown-bg: rgba(0, 0, 0, 0.95);
    --card-hover-bg: rgba(255, 255, 255, 0.12);
    --scrollbar-thumb: rgba(255, 255, 255, 0.2);
    --scrollbar-thumb-hover: var(--primary);
    --lang-hover-bg: rgba(255, 255, 255, 0.08);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scroll-behavior: smooth;
}

body {
    font-family: 'Cairo', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate {
    animation: fadeIn 0.8s ease forwards;
}

/* Glassmorphism Classes */
.glass {
    background: var(--card-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
}

/* Header & Nav */
header {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    padding: 1.5rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: 0.3s;
}

header.scrolled {
    background: var(--header-bg);
    padding: 1rem 5%;
    backdrop-filter: blur(5px);
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.8rem;
    font-weight: 800;
    background: linear-gradient(to left, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-family: 'Outfit', sans-serif;
    text-decoration: none;
}

.logo img {
    width: 40px;
    height: 40px;
    filter: drop-shadow(0 0 5px rgba(0, 210, 255, 0.4));
}

nav ul {
    display: flex;
    list-style: none;
    gap: 2rem;
}

nav a {
    color: var(--text-main);
    text-decoration: none;
    font-weight: 500;
    transition: 0.3s;
    font-size: 1rem;
}

nav a:hover {
    color: var(--primary);
}

/* Hero Section */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0 10%;
    background: url('assets/hero.jpg') center center / cover no-repeat;
    position: relative;
    box-shadow: inset 0 0 100px rgba(0,0,0,0.5);
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--hero-overlay);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
}

.hero-content h1 {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.hero-content p {
    font-size: 1.4rem;
    max-width: 800px;
    margin: 0 auto 2rem;
    color: var(--text-main);
    font-weight: 500;
}

.btn {
    padding: 1rem 2.5rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: bold;
    transition: 0.3s;
    display: inline-block;
}

.btn-primary {
    background: linear-gradient(45deg, var(--secondary), var(--primary));
    color: white;
    box-shadow: 0 10px 20px rgba(58, 123, 213, 0.3);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(58, 123, 213, 0.5);
}

/* Sections Styling */
section {
    padding: 100px 10%;
}

h2 {
    font-size: 2.5rem;
    margin-bottom: 3rem;
    text-align: center;
    position: relative;
}

h2::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: var(--primary);
    border-radius: 2px;
}

.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.card {
    padding: 2.5rem;
    transition: 0.4s;
}

.card:hover {
    transform: translateY(-10px);
    background: var(--card-hover-bg);
}

.card h3 {
    color: var(--primary);
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

/* Footer */
footer {
    padding: 3rem 10%;
    text-align: center;
    background: var(--footer-bg);
    border-top: 1px solid var(--glass-border);
}

.footer-logo {
    font-size: 1.5rem;
    font-family: 'Outfit', sans-serif;
    color: #94a3b8;
    margin-bottom: 1rem;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.social-links a {
    color: var(--text-main);
    font-size: 1.8rem;
    transition: 0.3s;
    text-decoration: none;
}

.social-links a:hover {
    color: var(--primary);
    transform: scale(1.2);
}

/* Menu Toggle */
.menu-toggle {
    display: none;
    font-size: 1.8rem;
    color: var(--text-main);
    cursor: pointer;
    z-index: 1001;
    position: relative;
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 30px;
    left: 30px;
    right: auto;
    background: linear-gradient(45deg, var(--secondary), var(--primary));
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    text-decoration: none;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    opacity: 0;
    visibility: hidden;
    transition: 0.3s;
    z-index: 999;
}

.back-to-top.active {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(58, 123, 213, 0.5);
    color: white;
}

/* Footer Social Icons Compact */
footer .social-links {
    margin-top: 1rem;
}

footer .social-links a {
    font-size: 1.5rem;
}

footer .social-links svg {
    width: 24px;
    height: 24px;
}

/* Responsive */
@media (max-width: 768px) {
    .hero-content h1 { font-size: 2.5rem; }
    
    .menu-toggle {
        display: block;
    }

    nav ul {
        position: fixed;
        top: 0;
        left: 0;
        right: auto;
        width: 250px;
        height: 100vh;
        background: var(--lang-dropdown-bg);
        backdrop-filter: blur(10px);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 2rem;
        transform: translateX(-100%);
        transition: transform 0.4s ease-in-out;
        z-index: 1000;
        box-shadow: 5px 0 15px rgba(0,0,0,0.5);
        display: flex;
    }

    nav ul.active {
        transform: translateX(0);
    }

    section { padding: 60px 5%; }
}

/* ==========================================
   Language Selector & Translation Styling
   ========================================== */
.lang-selector-container {
    position: relative;
    font-family: 'Cairo', 'Outfit', sans-serif;
    margin-right: auto;
    margin-left: 1.5rem;
    z-index: 1002;
}

html[dir="ltr"] .lang-selector-container {
    margin-left: auto;
    margin-right: 1.5rem;
}

.lang-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--card-glass);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: 0.3s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.lang-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary);
    box-shadow: 0 0 10px rgba(0, 210, 255, 0.2);
}

.lang-btn svg {
    stroke: var(--text-main);
    transition: 0.3s;
}

.lang-btn:hover svg {
    stroke: var(--primary);
}

.lang-btn .chevron-icon {
    transition: transform 0.3s ease;
}

.lang-btn.active .chevron-icon {
    transform: rotate(180deg);
}

.lang-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    right: auto;
    width: 280px;
    max-height: 400px;
    background: var(--lang-dropdown-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    overflow: hidden;
}

html[dir="ltr"] .lang-dropdown {
    left: auto;
    right: 0;
}

.lang-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-search {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 15px;
    border-bottom: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.02);
}

.lang-search svg {
    stroke: #94a3b8;
    flex-shrink: 0;
}

.lang-search input {
    width: 100%;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-main);
    font-size: 0.85rem;
    font-family: inherit;
}

.lang-search input::placeholder {
    color: #64748b;
}

.lang-list {
    overflow-y: auto;
    flex: 1;
    padding: 5px;
}

/* Scrollbar for lang-list */
.lang-list::-webkit-scrollbar {
    width: 6px;
}

.lang-list::-webkit-scrollbar-track {
    background: transparent;
}

.lang-list::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 3px;
}

.lang-list::-webkit-scrollbar-thumb:hover {
    background: var(--scrollbar-thumb-hover);
}

.lang-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 8px 12px;
    background: transparent;
    border: none;
    color: var(--text-main);
    text-align: right;
    font-size: 0.9rem;
    cursor: pointer;
    border-radius: 8px;
    transition: 0.2s;
    font-family: inherit;
}

html[dir="ltr"] .lang-item {
    text-align: left;
}

.lang-item:hover {
    background: var(--lang-hover-bg);
    color: var(--primary);
}

.lang-item.active {
    background: rgba(0, 210, 255, 0.1);
    color: var(--primary);
    font-weight: bold;
}

.lang-item .native-name {
    font-size: 0.9rem;
}

.lang-item .english-name {
    font-size: 0.75rem;
    color: #64748b;
}

/* Direction Adaptations */
html[dir="ltr"] .back-to-top {
    left: auto;
    right: 30px;
}

/* Hide Google Translate original UI elements completely */
.goog-te-banner-frame {
    display: none !important;
}

.goog-logo-link {
    display: none !important;
}



/* Make sure mobile views are handled correctly */
@media (max-width: 768px) {
    .lang-selector-container {
        margin-right: auto;
        margin-left: 0.5rem;
    }
    
    html[dir="ltr"] .lang-selector-container {
        margin-left: auto;
        margin-right: 0.5rem;
    }
    
    .lang-dropdown {
        width: 260px;
        position: fixed;
        top: 70px;
        left: 5%;
        right: 5%;
        margin: 0 auto;
        max-height: 300px;
    }
}


/* Theme Toggle Button */
.theme-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--card-glass);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    padding: 0.5rem;
    border-radius: 50px;
    cursor: pointer;
    transition: 0.3s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    width: 38px;
    height: 38px;
    margin-right: 0.5rem;
}
html[dir="ltr"] .theme-btn {
    margin-right: 0;
    margin-left: 0.5rem;
}
.theme-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary);
    box-shadow: 0 0 10px rgba(0, 210, 255, 0.2);
}
.theme-btn svg {
    stroke: var(--text-main);
    transition: 0.3s;
}
.theme-btn:hover svg {
    stroke: var(--primary);
}
