/* --- General Setup & Theming --- */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600;700&display=swap');

:root {
    --dark-bg: #0d1117;
    --primary-card-bg: #161b22;
    --primary-accent: #3b82f6;
    --secondary-accent: #ca8a04;
    --text-primary: #f0f0f0;
    --text-secondary: #a0a0b0;
    --border-color: rgba(255, 255, 255, 0.1);
    --glow-color: rgba(59, 130, 246, 0.25);
    --bot-bubble-bg: #21262d;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { font-family: 'Poppins', sans-serif; background-color: var(--dark-bg); color: var(--text-primary); overflow-x: hidden; display: flex; flex-direction: column; min-height: 100vh; }
.main-content { flex: 1; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 2rem; }
h1, h2, h3 { font-weight: 700; }
h1 { font-size: 3.5rem; line-height: 1.2; margin-bottom: 1.5rem; }
h2 { font-size: 2.5rem; text-align: center; margin-bottom: 3rem; }
p { line-height: 1.8; color: var(--text-secondary); }
.section-subtitle { text-align:center; max-width:800px; margin:-2rem auto 3rem auto; }
section { padding: 6rem 0; }
.gradient-text { background: linear-gradient(90deg, var(--primary-accent), var(--secondary-accent)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.cta-button { 
    display: inline-block; 
    padding: 1rem 2.5rem; 
    background: var(--primary-accent); 
    color: #fff; 
    text-decoration: none; 
    font-weight: 600; 
    border-radius: 50px; 
    transition: transform 0.3s ease, box-shadow 0.3s ease; 
    border: 1px solid var(--primary-accent); 
    cursor: pointer;
    min-height: 44px;
    line-height: 1.2;
    position: relative;
    z-index: 10;
    /* Ensure the entire button area is clickable */
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    user-select: none;
    /* Make sure the button takes full space */
    box-sizing: border-box;
    /* Ensure proper touch target size */
    min-width: 44px;
}
.cta-button:hover { transform: translateY(-5px); box-shadow: 0 10px 30px var(--glow-color); }
nav { position: fixed; width: 100%; top: 0; left: 0; padding: 1.5rem 2rem; z-index: 1000; background: rgba(13, 17, 23, 0.7); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border-color); }
.nav-container { max-width: 1200px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; }
.nav-right, .nav-links, .lang-dropdown { display: flex; align-items: center; }
.nav-links { list-style: none; gap: 2rem; margin: 0; padding: 0; }
.nav-logo {
    text-decoration: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
}
.logo-image {
    height: 80px;
    width: auto;
    filter: brightness(0) invert(1);
    transition: filter 0.3s ease;
}
.logo-text { font-size: 2rem; }
.nav-links a { color: var(--text-secondary); text-decoration: none; transition: color 0.3s ease; font-weight: 600; }
.language-switcher { position: relative; }
.lang-dropdown-menu { position: absolute; top: 100%; right: 0; background: var(--primary-card-bg); border: 1px solid var(--border-color); border-radius: 8px; min-width: 140px; opacity: 0; visibility: hidden; transform: translateY(-10px); transition: all 0.3s ease; z-index: 1000; margin-top: 0.5rem; }
.lang-dropdown.active .lang-dropdown-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.lang-option { display: flex; align-items: center; gap: 0.5rem; padding: 0.8rem 1rem; cursor: pointer; }
.dropdown-arrow { transition: transform 0.3s ease; }
.lang-dropdown.active .dropdown-arrow { transform: rotate(180deg); }

/* --- [FIXED] Language Switcher Button Style --- */
.lang-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 0.3rem 0.8rem;
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.lang-btn:hover {
    color: var(--primary-accent);
}
/* ------------------------------------------- */

/* --- Dynamic Hero Section with 3D Effect--- */
.hero-dynamic { 
    min-height: 100vh; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    position: relative; 
    overflow: hidden; 
    padding-top: 120px; 
}
.hero-container { 
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    align-items: center; 
    gap: 4rem; 
    max-width: 1200px; 
    width: 100%; 
    z-index: 2; 
    padding: 0 2rem;
}
.hero-text { text-align: left; }
.hero-dynamic .subtitle { font-size: 1.2rem; margin: 0 0 2.5rem; max-width: 500px; }
.hero-visual { position: relative; perspective: 2000px; }
#particle-canvas { position: absolute; top: 50%; left: 50%; width: 150%; height: 150%; transform: translate(-50%, -50%); z-index: 1; }
.chat-interface { 
    background: rgba(22, 27, 34, 0.8); 
    backdrop-filter: blur(8px); 
    border: 1px solid var(--border-color); 
    border-radius: 20px; 
    padding: 1.5rem; 
    width: 100%; 
    max-width: 450px; 
    margin: 0 auto; 
    box-shadow: 0 25px 50px rgba(0,0,0,0.5), 0 0 40px var(--glow-color); 
    z-index: 2; 
    transform-style: preserve-3d; 
    transform: rotateY(-25deg) rotateX(8deg); 
    transition: transform 0.4s ease-out; 
}
.chat-bubbles { 
    display: flex; 
    flex-direction: column; 
    gap: 1rem; 
    height: 400px; 
    overflow-y: auto; 
    overflow-x: hidden;
    justify-content: flex-start; 
    scroll-behavior: smooth;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* Internet Explorer 10+ */
}

.chat-bubbles::-webkit-scrollbar { 
    display: none; /* Safari and Chrome */
}
.chat-bubble { 
    padding: 0.8rem 1.2rem; 
    border-radius: 15px; 
    max-width: 85%; 
    opacity: 0; 
    animation: enter 0.8s forwards cubic-bezier(0.19, 1, 0.22, 1);
    transform: rotateY(-8deg) rotateX(3deg);
    transition: transform 0.3s ease;
}
.chat-bubble:hover {
    transform: rotateY(-12deg) rotateX(5deg) scale(1.02);
}
.chat-bubble.exit { animation: exit 0.6s forwards ease-out; }
@keyframes enter { 
    from { 
        opacity: 0; 
        transform: translateY(35px) scale(0.9) rotateY(-8deg) rotateX(3deg); 
    } 
    to { 
        opacity: 1; 
        transform: translateY(0) scale(1) rotateY(-8deg) rotateX(3deg); 
    } 
}
@keyframes exit { 
    from { 
        opacity: 1; 
        transform: translateY(0) rotateY(-8deg) rotateX(3deg); 
    } 
    to { 
        opacity: 0; 
        transform: translateY(-25px) rotateY(-8deg) rotateX(3deg); 
    } 
}
.chat-bubble p { color: #FFFFFF; font-weight: 400; line-height: 1.6; }



/* --- Typing Effect Cursor --- */
.chat-bubble p::after {
    content: '';
    margin-left: 0;
}

.chat-bubble.typing-text p::after {
    content: '|';
    color: var(--primary-accent);
    animation: blink 1s infinite;
    margin-left: 2px;
}

@keyframes blink {
    0%, 50% {
        opacity: 1;
    }
    51%, 100% {
        opacity: 0;
    }
}
.chat-bubble.user { 
    background-color: var(--primary-accent); 
    align-self: flex-end; 
    border-radius: 15px 15px 0 15px; 
    transform: rotateY(12deg) rotateX(3deg);
}
.chat-bubble.user:hover {
    transform: rotateY(18deg) rotateX(5deg) scale(1.02);
}
.chat-bubble.bot { 
    background-color: var(--bot-bubble-bg); 
    align-self: flex-start; 
    border-radius: 15px 15px 15px 0; 
    display: flex; 
    align-items: flex-start; 
    gap: 0.7rem; 
    transform: rotateY(-12deg) rotateX(3deg);
}
.chat-bubble.bot:hover {
    transform: rotateY(-18deg) rotateX(5deg) scale(1.02);
}
.bot-icon { font-size: 1.2rem; line-height: 1.6; }

/* --- Use Cases / Industry Tabs Section --- */
.industry-tabs-container { max-width: 1000px; margin: 0 auto; }
.tab-nav { display: flex; justify-content: center; gap: 1rem; margin-bottom: 3rem; flex-wrap: wrap; }
.tab-btn { background-color: var(--primary-card-bg); color: var(--text-secondary); border: 1px solid var(--border-color); padding: 0.8rem 1.8rem; font-size: 1rem; font-weight: 600; border-radius: 50px; cursor: pointer; transition: all 0.3s ease; position: relative; }
.tab-btn:hover { color: var(--text-primary); border-color: var(--primary-accent); }
.tab-btn.active { color: #fff; background-image: linear-gradient(90deg, var(--primary-accent), var(--secondary-accent)); border-color: transparent; box-shadow: 0 5px 20px rgba(59, 130, 246, 0.3); }
.tab-panel { display: none; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: center; animation: fadeIn 0.6s ease; }
.tab-panel.active { display: grid; }
.panel-visual img { width: 100%; height: auto; border-radius: 15px; object-fit: cover; aspect-ratio: 4/3; }
.panel-text ul { list-style: none; padding-left: 0; margin-top: 1.5rem; }
.panel-text li { position: relative; padding-left: 25px; margin-bottom: 0.7rem; }
.panel-text li::before { content: '✓'; color: var(--primary-accent); position: absolute; left: 0; font-weight: 700; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* --- Process Timeline Section --- */
.timeline-container { position: relative; max-width: 800px; margin: 3rem auto; padding: 2rem 0; }
.timeline-container::before { content: ''; position: absolute; width: 3px; background-color: var(--border-color); top: 0; bottom: 0; left: 50%; transform: translateX(-50%); }
.timeline-step { padding: 1rem 3rem; position: relative; width: 50%; opacity: 0; transform: translateY(50px); transition: opacity 0.6s ease-out, transform 0.6s ease-out; }
.timeline-step.in-view { opacity: 1; transform: translateY(0); }
.timeline-step:nth-child(odd) { left: 0; }
.timeline-step:nth-child(even) { left: 50%; }
.timeline-step::after { content: ''; position: absolute; width: 20px; height: 20px; right: -10px; background-color: var(--dark-bg); border: 4px solid var(--primary-accent); top: 25px; border-radius: 50%; z-index: 1; }
.timeline-step:nth-child(even)::after { left: -10px; }
.timeline-content { padding: 1.5rem 2rem; background: var(--primary-card-bg); border: 1px solid var(--border-color); border-radius: 10px; }
.timeline-content h3 { color: var(--primary-accent); }

/* --- Security Section --- */
.security-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 2rem; max-width: 1000px; margin: 0 auto; }
.security-feature { text-align: center; }
.feature-icon { font-size: 3rem; color: var(--secondary-accent); margin-bottom: 1rem; }
.security-feature h3 { font-size: 1.25rem; margin-bottom: 0.5rem; }

/* --- About Us Section --- */
#about { background-color: var(--primary-card-bg); }

/* --- Contact Info Section --- */
.contact-info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 2rem; max-width: 700px; margin: 2rem auto 0; }
.contact-card { background-color: var(--primary-card-bg); padding: 2rem; border-radius: 15px; border: 1px solid var(--border-color); text-align: center; text-decoration: none; transition: all 0.3s ease; }
.contact-card:hover { transform: translateY(-10px); border-color: var(--primary-accent); box-shadow: 0 10px 30px var(--glow-color); }
.contact-icon { font-size: 3rem; margin-bottom: 1rem; }
.contact-card h3 { color: var(--text-primary); margin-bottom: 0.5rem; }
.contact-card p { color: var(--primary-accent); font-weight: 600; }

/* --- Services Section --- */
.services-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 2rem; }
.service-card { background-color: var(--primary-card-bg); padding: 2.5rem; border-radius: 15px; border: 1px solid var(--border-color); }
.service-icon { font-size: 2.5rem; margin-bottom: 1.5rem; color: var(--primary-accent); display: inline-block; }

/* --- Footer --- */
footer { padding: 3rem 0; text-align: center; border-top: 1px solid var(--border-color); margin-top: auto; }
.footer-container p { color: var(--text-secondary); font-size: 0.9rem; }

/* --- Responsive & RTL --- */
@media (max-width: 992px) {
    .hero-container { 
        grid-template-columns: 1fr; 
        gap: 3rem; 
        padding: 0 1.5rem;
    }
    .hero-text, #about .section-subtitle { text-align: center; }
    .hero-dynamic .subtitle { margin: 0 auto 2.5rem; }
    .chat-interface { 
        transform: rotateY(-8deg) rotateX(3deg); 
        max-width: 400px;
    }
    .chat-bubbles { height: 350px; }
}

@media (max-width: 768px) {
    h1 { font-size: 2.5rem; line-height: 1.3; }
    .nav-links { display: none; }
    .hero-dynamic { 
        padding: 8rem 1rem 3rem 1rem; 
        min-height: auto; 
    }
    .hero-container { 
        gap: 2rem; 
        padding: 0 1rem;
    }
    .hero-dynamic .subtitle { 
        font-size: 1rem; 
        margin: 0 auto 2rem; 
    }
    .chat-interface { 
        transform: rotateY(-20deg) rotateX(6deg); 
        max-width: 350px;
        padding: 1rem;
    }
    .chat-bubbles { 
        height: 300px; 
        gap: 0.8rem;
    }
    .chat-bubble { 
        padding: 0.7rem 1rem; 
        max-width: 90%;
        font-size: 0.9rem;
        transform: rotateY(-6deg) rotateX(2deg);
    }
    .chat-bubble.user {
        transform: rotateY(8deg) rotateX(2deg);
    }
    .chat-bubble p { 
        font-size: 0.9rem; 
        line-height: 1.5; 
    }
    .bot-icon { font-size: 1rem; }
    /* Improve button clickability on mobile */
    .cta-button {
        /* Ensure proper touch target size */
        min-height: 44px;
        min-width: 44px;
        /* Improve mobile interaction */
        -webkit-tap-highlight-color: rgba(59, 130, 246, 0.3);
        touch-action: manipulation;
        /* Prevent text selection */
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
        /* Add some spacing */
        margin: 0.25rem 0;
    }
    section { padding: 3rem 0; }
    .tab-panel { grid-template-columns: 1fr; }
    .panel-visual { order: -1; }
    .timeline-container::before { left: 15px; }
    .timeline-step, .timeline-step:nth-child(even) { width: 100%; left: 0; padding-left: 50px; }
    .timeline-step::after, .timeline-step:nth-child(even)::after { left: 5px; }
}

@media (max-width: 480px) {
    h1 { font-size: 2rem; line-height: 1.2; }
    .hero-dynamic { 
        padding: 7rem 0.5rem 2rem 0.5rem; 
    }
    .hero-container { 
        gap: 1.5rem; 
        padding: 0 0.5rem;
    }
    .hero-dynamic .subtitle { 
        font-size: 0.9rem; 
        margin: 0 auto 1.5rem; 
    }
    .chat-interface { 
        transform: rotateY(-18deg) rotateX(5deg); 
        max-width: 300px;
        padding: 0.8rem;
    }
    .chat-bubbles { 
        height: 250px; 
        gap: 0.6rem;
    }
    .chat-bubble { 
        padding: 0.6rem 0.8rem; 
        max-width: 95%;
        font-size: 0.8rem;
        transform: rotateY(-4deg) rotateX(1.5deg);
    }
    .chat-bubble.user {
        transform: rotateY(6deg) rotateX(1.5deg);
    }
    .chat-bubble p { 
        font-size: 0.8rem; 
        line-height: 1.4; 
    }
    .bot-icon { font-size: 0.9rem; }
    .cta-button { 
        padding: 1rem 2.5rem; 
        font-size: 1rem;
        /* Ensure larger touch target on mobile */
        min-height: 48px;
        min-width: 48px;
        /* Improve mobile clickability */
        -webkit-tap-highlight-color: rgba(59, 130, 246, 0.3);
        /* Prevent text selection on tap */
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
        /* Ensure proper touch handling */
        touch-action: manipulation;
        /* Add some spacing to prevent accidental clicks */
        margin: 0.5rem 0;
    }
    section { padding: 2.5rem 0; }
    .container { padding: 0 1rem; }
}
.main-content[dir="rtl"] { direction: rtl; }
.main-content[dir="rtl"] .hero-text, .main-content[dir="rtl"] .panel-text, .main-content[dir="rtl"] #about .section-subtitle { text-align: right; }
.main-content[dir="rtl"] .chat-bubble.user { border-radius: 15px 15px 15px 0; }
.main-content[dir="rtl"] .chat-bubble.bot { border-radius: 15px 15px 0 15px; }
.main-content[dir="rtl"] .panel-text li { padding-left: 0; padding-right: 25px; }
.main-content[dir="rtl"] .panel-text li::before { right: 0; left: auto; }
.main-content[dir="rtl"] .timeline-step, .main-content[dir="rtl"] .timeline-step:nth-child(even) { left: auto; right: 0; }
.main-content[dir="rtl"] .timeline-step:nth-child(odd) { right: 0; }
.main-content[dir="rtl"] .timeline-step:nth-child(even) { right: 50%; }
.main-content[dir="rtl"] .timeline-step::after { left: -10px; right: auto; }
.main-content[dir="rtl"] .timeline-step:nth-child(even)::after { right: -10px; left: auto; }
@media (max-width: 768px) {
    .main-content[dir="rtl"] .timeline-container::before { right: 15px; left: auto; }
    .main-content[dir="rtl"] .timeline-step, .main-content[dir="rtl"] .timeline-step:nth-child(even) { right: 0; padding-right: 50px; padding-left: 1rem;}
    .main-content[dir="rtl"] .timeline-step::after, .main-content[dir="rtl"] .timeline-step:nth-child(even)::after { right: 5px; left: auto;}
}