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

:root {
    --primary: #1a237e;
    --secondary: #ffd700;
    --accent: #00bcd4;
    --text-dark: #1a1a2e;
    --text-light: #f5f5f5;
    --gradient-1: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-2: linear-gradient(135deg, #1a237e 0%, #00bcd4 100%);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    overflow-x: hidden;
    transition: direction 0.3s ease;
}

/* RTL Support - But not for language switcher and logos */
html[dir="rtl"] body {
    font-family: 'Segoe UI', Tahoma, Arial, sans-serif;
}

html[dir="rtl"] .nav-container {
    direction: rtl;
}

html[dir="rtl"] .nav-menu {
    direction: rtl;
}

html[dir="rtl"] .feature-card::before {
    left: auto;
    right: 0;
}

html[dir="rtl"] .benefit-icon {
    margin-left: 15px;
    margin-right: 0;
}

html[dir="rtl"] #rag-advantage {
    border-left: none !important;
    border-right: 4px solid #ffd700 !important;
}

/* Keep TVL branding always LTR */
.logo, .nav-logo {
    direction: ltr !important;
    unicode-bidi: isolate !important;
}

/* Language Switcher - Completely isolated from RTL */
.lang-switcher,
.lang-switcher * {
    direction: ltr !important;
    text-align: left !important;
}

.lang-switcher {
    position: fixed !important;
    top: 80px !important;
    right: 20px !important;
    left: auto !important;
    z-index: 999999 !important;
    background: rgba(26, 35, 126, 0.98);
    backdrop-filter: blur(10px);
    border-radius: 25px;
    padding: 6px;
    display: inline-flex !important;
    flex-direction: row !important;
    gap: 6px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    isolation: isolate;
    transform: translateZ(0);
    border: 1px solid rgba(255,255,255,0.1);
    height: 46px !important;
    max-height: 46px !important;
    width: fit-content !important;
    align-items: center !important;
    justify-content: center !important;
    white-space: nowrap !important;
    overflow: visible !important;
}

/* Override any RTL effects on language switcher */
html[dir="rtl"] .lang-switcher {
    right: 20px !important;
    left: auto !important;
    direction: ltr !important;
}

.lang-btn {
    min-width: 55px;
    height: 34px !important;
    padding: 5px 10px;
    background: rgba(255,255,255,0.1);
    color: white;
    border: 1px solid transparent;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 3px;
    outline: none;
    pointer-events: auto !important;
    position: relative;
    user-select: none;
    touch-action: manipulation;
    flex-shrink: 0;
    white-space: nowrap;
    line-height: 1;
}

.lang-text {
    font-size: inherit;
    line-height: 1;
}

.lang-btn span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.lang-btn:hover {
    background: rgba(255,255,255,0.2);
    transform: scale(1.05);
}

/* Hide text on very small screens */
@media (max-width: 380px) {
    .lang-text {
        display: none;
    }
    
    .lang-btn {
        min-width: 40px;
    }
}

.lang-btn.active {
    background: var(--secondary);
    color: var(--text-dark);
}

.lang-icon {
    font-size: 1rem;
    line-height: 1;
}

/* Animations */
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

@keyframes slideInLeft {
    from { transform: translateX(-100px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideInRight {
    from { transform: translateX(100px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Hero Section */
.hero {
    min-height: auto;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 25%, #1a237e 50%, #00bcd4 100%);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    position: relative;
    overflow: visible;
    padding-top: 140px;
    padding-bottom: 80px;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.3);
    z-index: 1;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 200px;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 320"><path fill="%23ffffff20" fill-opacity="1" d="M0,224L48,213.3C96,203,192,181,288,181.3C384,181,480,203,576,218.7C672,235,768,245,864,234.7C960,224,1056,192,1152,181.3C1248,171,1344,181,1392,186.7L1440,192L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z"></path></svg>');
    background-repeat: no-repeat;
    background-position: bottom;
    background-size: cover;
    z-index: 1;
}

.hero-content {
    text-align: center;
    color: var(--text-light);
    z-index: 3;
    padding: 0 20px 30px;
    animation: slideInLeft 1s ease;
    max-width: 100%;
    position: relative;
    width: 100%;
}

html[dir="rtl"] .hero-content {
    animation: none;
}

/* Ensure TVL logo is always visible */
.hero-content .logo {
    color: #ffffff !important;
}

.logo {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 0 30px 0;
    padding: 0;
    width: 100%;
    position: relative;
    z-index: 5;
}

.hero-logo-img {
    height: 160px; /* Reduced size */
    width: auto;
    max-width: 90%;
    filter: drop-shadow(0 8px 16px rgba(0,0,0,0.7));
    animation: pulse 2s infinite;
    object-fit: contain;
    display: block;
    position: relative;
    z-index: 10;
    margin-top: 0;
}

html[dir="rtl"] .logo {
    animation: none;
}

html[dir="rtl"] .hero-logo-img {
    animation: none;
}

.tagline {
    font-size: 1.8rem;
    margin-bottom: 5px;
    margin-top: 0;
    opacity: 0.95;
    animation: slideInRight 1s ease;
}

.subtitle {
    font-size: 1.1rem;
    max-width: 700px;
    margin: 0 auto 40px;
    opacity: 0.9;
    line-height: 1.6;
}

.cta-button {
    display: inline-block;
    padding: 18px 45px;
    background: var(--secondary);
    color: var(--text-dark);
    text-decoration: none;
    font-weight: 700;
    font-size: 1.1rem;
    border-radius: 50px;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    animation: float 3s ease-in-out infinite;
}

.cta-button:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.3);
    background: #ffed4e;
}

/* Navigation */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(26, 35, 126, 0.95);
    backdrop-filter: blur(10px);
    z-index: 900;
    padding: 0;
    transition: all 0.3s ease;
}

nav.scrolled {
    background: rgba(26, 35, 126, 0.98);
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

html[dir="rtl"] .nav-container {
    flex-direction: row-reverse;
}

.nav-logo {
    font-size: 1.8rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 3px;
    font-family: Arial, sans-serif;
}

/* Text Logo Styles - Navigation */
.logo-text {
    font-size: 2rem;
    font-weight: 800;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #ffd700 100%);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 2px;
    font-family: 'Arial Black', Arial, sans-serif;
    transition: all 0.3s ease;
    display: inline-block;
}

.logo-ai {
    background: linear-gradient(90deg, #ffd700 0%, #ffed4e 50%, #ffd700 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 900;
    font-style: italic;
    letter-spacing: 1px;
}

.nav-logo a:hover .logo-text {
    transform: scale(1.05);
    background-position: 100% 50%;
}

/* Text Logo Styles - Hero Section */
.logo-text-hero {
    font-size: 6rem;
    font-weight: 900;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 25%, #ffd700 100%);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 8px;
    font-family: 'Arial Black', Arial, sans-serif;
    text-shadow: 0 0 30px rgba(255,215,0,0.3);
    display: inline-block;
    animation: pulse 2s infinite, gradientShift 3s ease infinite;
    filter: drop-shadow(0 8px 16px rgba(0,0,0,0.7));
}

.logo-ai-hero {
    background: linear-gradient(90deg, #ffd700 0%, #ffed4e 50%, #ffd700 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 900;
    font-style: italic;
    letter-spacing: 4px;
}

.nav-logo-img {
    height: 50px; /* Reduced navbar logo size */
    width: auto;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
    transition: all 0.3s ease;
}

.nav-logo-img:hover {
    transform: scale(1.08);
    filter: drop-shadow(0 3px 6px rgba(0,0,0,0.5));
}

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

html[dir="rtl"] .nav-menu {
    flex-direction: row-reverse;
}

.nav-menu a {
    color: var(--text-light);
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 500;
}

.nav-menu a:hover {
    color: var(--secondary);
}

/* Features Section */
.features {
    padding: 100px 20px;
    background: linear-gradient(135deg, #0f0c29 0%, #302b63 50%, #24243e 100%);
    position: relative;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

.section-title {
    text-align: center;
    font-size: 2.8rem;
    margin-bottom: 20px;
    color: #ffffff;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.features .section-title {
    background: linear-gradient(90deg, #ffd700 0%, #ffed4e 50%, #ffd700 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-subtitle {
    text-align: center;
    font-size: 1.2rem;
    color: rgba(255,255,255,0.8);
    margin-bottom: 60px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 40px;
    margin-top: 60px;
}

.feature-card {
    background: linear-gradient(145deg, rgba(255,255,255,0.1), rgba(255,255,255,0.05));
    backdrop-filter: blur(10px);
    padding: 40px 30px;
    border-radius: 20px;
    text-align: center;
    transition: all 0.4s ease;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    border: 1px solid rgba(255,215,0,0.3);
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, transparent, #ffd700, transparent);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.feature-card::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,215,0,0.1) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.feature-card:hover {
    transform: translateY(-15px) scale(1.02);
    box-shadow: 0 25px 60px rgba(255,215,0,0.2);
    border-color: rgba(255,215,0,0.6);
    background: linear-gradient(145deg, rgba(255,255,255,0.15), rgba(255,255,255,0.08));
}

.feature-card:hover::after {
    opacity: 1;
}

.feature-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 25px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    box-shadow: 0 8px 20px rgba(102,126,234,0.3);
    transition: all 0.3s ease;
}

.feature-card:hover .feature-icon {
    transform: scale(1.1) rotate(10deg);
    box-shadow: 0 12px 30px rgba(102,126,234,0.5);
}

.feature-title {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: #ffd700;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.feature-description {
    color: rgba(255,255,255,0.85);
    line-height: 1.7;
    font-size: 1rem;
}

/* Expertise Section */
.expertise {
    padding: 100px 20px;
    background: linear-gradient(135deg, #1a237e 0%, #00bcd4 100%);
    color: var(--text-light);
}

.expertise-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 50px;
    margin-top: 60px;
}

.expertise-card {
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    padding: 40px;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.2);
    position: relative;
}

/* Team Member Photo Styles */
.team-member-photo {
    width: 120px;
    height: 120px;
    margin: 0 auto 25px;
    position: relative;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid #ffd700;
    box-shadow: 0 8px 20px rgba(255,215,0,0.3);
}

.member-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none; /* Hidden by default, shown when image loads */
}

.member-photo[src]:not([src=""]) {
    display: block;
}

.member-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 2.5rem;
    font-weight: bold;
    letter-spacing: 2px;
}

.member-photo:not([src=""]) ~ .member-placeholder {
    display: none;
}

/* Member Languages and Flags */
.member-languages {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.country-flag {
    display: flex;
    align-items: center;
    justify-content: center;
}

.country-flag img {
    height: 30px;
    width: auto;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.language-badges {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
}

.lang-badge {
    background: rgba(255,215,0,0.2);
    color: #ffd700;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: 600;
    border: 1px solid rgba(255,215,0,0.4);
    transition: all 0.3s ease;
}

.lang-badge:hover {
    background: rgba(255,215,0,0.3);
    transform: scale(1.05);
}

.expertise-number {
    font-size: 3rem;
    font-weight: 900;
    color: var(--secondary);
    margin-bottom: 15px;
}

.expertise-title {
    font-size: 1.3rem;
    margin-bottom: 15px;
}

/* Benefits Section */
.benefits {
    padding: 100px 20px;
    background: white;
}

.benefits-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-top: 60px;
}

.benefit-item {
    display: flex;
    align-items: flex-start;
    gap: 15px;
}

.benefit-icon {
    font-size: 1.5rem;
    color: var(--accent);
    margin-top: 5px;
}

.benefit-text {
    flex: 1;
}

.benefit-text h4 {
    margin-bottom: 8px;
    color: var(--primary);
}

/* Languages Section */
.languages {
    padding: 80px 20px;
    background: #f8f9fa;
    text-align: center;
}

.language-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    margin-top: 40px;
}

.language-tag {
    padding: 12px 25px;
    background: white;
    border-radius: 30px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    font-weight: 600;
    transition: all 0.3s ease;
}

.language-tag:hover {
    transform: scale(1.1);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    background: var(--gradient-2);
    color: white;
}

/* CTA Section */
.cta-section {
    padding: 100px 20px;
    background: var(--gradient-1);
    text-align: center;
    color: var(--text-light);
}

.cta-title {
    font-size: 2.5rem;
    margin-bottom: 20px;
}

.cta-subtitle {
    font-size: 1.3rem;
    margin-bottom: 40px;
    opacity: 0.9;
}

.contact-info {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-top: 40px;
    flex-wrap: wrap;
}

.contact-item {
    font-size: 1.1rem;
}

.contact-item a {
    color: var(--secondary);
    text-decoration: none;
    font-weight: 600;
}

/* Footer */
footer {
    background: var(--text-dark);
    color: var(--text-light);
    text-align: center;
    padding: 30px 20px;
}

/* Responsive */
@media (max-width: 768px) {
    .hero {
        padding-top: 100px;
        padding-bottom: 60px;
    }

    .hero-content {
        padding: 20px 20px 30px;
    }
    
    .logo {
        margin: 0 0 20px;
        padding: 5px;
    }
    
    .hero-logo-img {
        height: 80px; /* Reduced mobile size */
        max-width: 85%;
    }

    .nav-logo-img {
        height: 35px; /* Reduced mobile navbar size */
    }

    /* Text Logo - Mobile Responsive */
    .logo-text {
        font-size: 1.5rem;
        letter-spacing: 1px;
    }

    .logo-text-hero {
        font-size: 3rem;
        letter-spacing: 4px;
    }

    .logo-ai-hero {
        letter-spacing: 2px;
    }

    html[dir="rtl"] .logo {
        color: #ffffff !important;
    }

    .tagline {
        font-size: 1.4rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .nav-menu {
        display: none;
    }
    
    .expertise-grid,
    .features-grid {
        grid-template-columns: 1fr;
    }

    .lang-switcher {
        top: 10px !important;
        right: 10px !important;
        padding: 5px;
        height: 42px !important;
        max-height: 42px !important;
        gap: 5px;
        border-radius: 21px;
    }
    
    .lang-btn {
        min-width: 48px;
        height: 32px !important;
        padding: 4px 8px;
        font-size: 0.75rem;
        border-radius: 16px;
    }
    
    .lang-icon {
        font-size: 0.85rem;
    }
}