:root {
    --primary-color: #0F172A; /* Deep Navy */
    --accent-color: #059669; /* Emerald Green */
    --accent-hover: #047857;
    --text-primary: #1E293B;
    --text-secondary: #475569;
    --bg-light: #F8FAFC;
    --white: #ffffff;
    --border-color: #E2E8F0;
    --hero-overlay: rgba(15, 23, 42, 0.75);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--text-primary);
    line-height: 1.6;
    font-size: 16px;
    background-color: var(--white);
}

/* Language Visibility Logic */
body.lang-en :not(.lang-en),
body.lang-ru :not(.lang-ru),
body.lang-ar :not(.lang-ar),
body.lang-zh :not(.lang-zh),
body.lang-es :not(.lang-es),
body.lang-tr :not(.lang-tr) {
    /* Base rule: hide non-matching languages */
}

/* Specific hiding */
.lang-en:not(body), .lang-ru:not(body), .lang-ar:not(body), .lang-zh:not(body), .lang-es:not(body), .lang-tr:not(body) { display: none; }

body.lang-en .lang-en { display: inline-block; }
body.lang-ru .lang-ru { display: inline-block; }
body.lang-ar .lang-ar { display: inline-block; }
body.lang-zh .lang-zh { display: inline-block; }
body.lang-es .lang-es { display: inline-block; }
body.lang-tr .lang-tr { display: inline-block; }

/* Block level overrides for headings, paragraphs, divs */
body.lang-en h1.lang-en, body.lang-en h2.lang-en, body.lang-en h3.lang-en, body.lang-en h4.lang-en, body.lang-en p.lang-en, body.lang-en span.lang-en,
body.lang-ru h1.lang-ru, body.lang-ru h2.lang-ru, body.lang-ru h3.lang-ru, body.lang-ru h4.lang-ru, body.lang-ru p.lang-ru, body.lang-ru span.lang-ru,
body.lang-ar h1.lang-ar, body.lang-ar h2.lang-ar, body.lang-ar h3.lang-ar, body.lang-ar h4.lang-ar, body.lang-ar p.lang-ar, body.lang-ar span.lang-ar,
body.lang-zh h1.lang-zh, body.lang-zh h2.lang-zh, body.lang-zh h3.lang-zh, body.lang-zh h4.lang-zh, body.lang-zh p.lang-zh, body.lang-zh span.lang-zh,
body.lang-es h1.lang-es, body.lang-es h2.lang-es, body.lang-es h3.lang-es, body.lang-es h4.lang-es, body.lang-es p.lang-es, body.lang-es span.lang-es,
body.lang-tr h1.lang-tr, body.lang-tr h2.lang-tr, body.lang-tr h3.lang-tr, body.lang-tr h4.lang-tr, body.lang-tr p.lang-tr, body.lang-tr span.lang-tr {
    display: block;
}

body.lang-en span.lang-en,
body.lang-ru span.lang-ru,
body.lang-ar span.lang-ar,
body.lang-zh span.lang-zh,
body.lang-es span.lang-es,
body.lang-tr span.lang-tr {
    display: inline;
}

/* RTL Support */
[dir="rtl"] {
    direction: rtl;
    text-align: right;
}

[dir="rtl"] .nav-links {
    margin-right: auto;
    margin-left: 0;
}

[dir="rtl"] .lang-switcher {
    border-left: none;
    border-right: 1px solid var(--border-color);
    padding-left: 0;
    padding-right: 20px;
}

[dir="rtl"] .form-group label {
    left: auto;
    right: 0;
}

[dir="rtl"] .product-card,
[dir="rtl"] .feature {
    text-align: right;
}

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

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Header & Nav */
header {
    background: var(--white);
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    height: 80px;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
    direction: ltr !important; /* Keep logo left, nav right even in RTL mode */
}

.logo-text {
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--primary-color);
    letter-spacing: -0.02em;
    text-transform: uppercase;
}

.logo-img {
    height: 40px;
    width: auto;
    display: block;
}

nav {
    display: flex;
    align-items: center;
    gap: 40px;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 32px;
    align-items: center;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.2s;
}

.nav-links a:hover {
    color: var(--primary-color);
}

.btn-contact {
    background: var(--primary-color);
    color: var(--white) !important;
    padding: 10px 24px;
    border-radius: 6px;
    transition: background 0.2s !important;
}

.btn-contact:hover {
    background: #1e293b !important;
}

/* Language Switcher Selector */
.lang-selector-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    border-left: 1px solid var(--border-color);
    padding-left: 20px;
}

.lang-selector {
    padding: 6px 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: transparent;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    outline: none;
    appearance: none; /* Remove default arrow to save space */
    -webkit-appearance: none;
    padding-right: 20px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23475569'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 4px center;
    background-size: 12px;
}

.lang-selector:hover {
    border-color: var(--primary-color);
}

.mobile-menu-toggle {
    display: none;
    font-size: 1.5rem;
    color: var(--primary-color);
    cursor: pointer;
}

/* Hero Section */
.hero {
    position: relative;
    background-image: url('hero-bg.jpeg');
    background-size: cover;
    background-position: center;
    height: 90vh;
    min-height: 600px;
    display: flex;
    align-items: center;
    margin-top: 80px;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--hero-overlay);
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
    color: var(--white);
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 24px;
    letter-spacing: -0.02em;
}

.hero p {
    font-size: 1.25rem;
    margin-bottom: 40px;
    opacity: 0.9;
    font-weight: 300;
    max-width: 600px;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    background: var(--accent-color);
    color: var(--white);
    padding: 16px 32px;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
    font-size: 1.05rem;
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.2);
}

/* Section Common */
section {
    padding: 100px 0;
}

.section-title {
    text-align: center;
    font-size: 2.25rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--primary-color);
}

.section-subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 60px;
    font-size: 1.1rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Products */
.products {
    background: var(--bg-light);
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 32px;
}

.product-card {
    background: var(--white);
    padding: 40px 32px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    border-color: transparent;
}

.icon-box {
    width: 56px;
    height: 56px;
    background: #DCFCE7; /* Light green bg */
    color: var(--accent-color);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 24px;
}

.product-card h3 {
    margin-bottom: 12px;
    color: var(--primary-color);
    font-size: 1.25rem;
}

.product-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* About / Features */
.about {
    background: var(--white);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 40px;
    max-width: 900px;
    margin: 0 auto;
}

.feature {
    position: relative;
    padding-top: 20px;
}

.feature-icon {
    font-size: 3rem;
    font-weight: 900;
    color: #E2E8F0;
    position: absolute;
    top: -20px;
    left: 0;
    z-index: -1;
    font-family: monospace;
}

.feature h4 {
    margin-bottom: 16px;
    font-size: 1.25rem;
    color: var(--primary-color);
}

.feature p {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* Contact Section */
.contact {
    background: var(--primary-color);
    color: var(--white);
    padding: 80px 0;
}

.contact-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 80px;
    align-items: start;
}

.contact-info-col h2 {
    font-size: 2.5rem;
    margin-bottom: 20px;
}

.contact-info-col p {
    opacity: 0.8;
    margin-bottom: 40px;
    font-size: 1.1rem;
}

.info-items {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.item {
    display: flex;
    align-items: center;
    gap: 16px;
}

.item i {
    width: 24px;
    color: var(--accent-color);
    font-size: 1.2rem;
}

.item a, .item span {
    color: var(--white);
    text-decoration: none;
    font-size: 1.1rem;
}

.contact-form {
    background: var(--white);
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.form-group {
    position: relative;
    margin-bottom: 24px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 0;
    border: none;
    border-bottom: 2px solid #E2E8F0;
    outline: none;
    font-family: inherit;
    font-size: 1rem;
    background: transparent;
    transition: border-color 0.2s;
}

.form-group textarea {
    height: 100px;
    resize: vertical;
}

.form-group label {
    position: absolute;
    top: 12px;
    left: 0;
    color: #94a3b8;
    transition: 0.2s ease all;
    pointer-events: none;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group input:valid,
.form-group textarea:valid {
    border-color: var(--accent-color);
}

.form-group input:focus ~ label,
.form-group textarea:focus ~ label,
.form-group input:valid ~ label,
.form-group textarea:valid ~ label {
    top: -10px;
    font-size: 0.85rem;
    color: var(--accent-color);
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.checkbox-group input {
    width: 20px;
    height: 20px;
    padding: 0;
    border: 1px solid var(--border-color);
    margin: 0;
    cursor: pointer;
}

.checkbox-group input:focus {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

/* Position static label for checkbox */
.checkbox-group label {
    position: static;
    font-size: 0.9rem;
    color: var(--text-secondary);
    cursor: pointer;
    line-height: 1.4;
    pointer-events: auto;
}

[dir="rtl"] .checkbox-group label {
    text-align: right;
}

.btn-submit {
    width: 100%;
    background: var(--primary-color);
    color: var(--white);
    padding: 16px;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.2s;
}

.btn-submit:hover {
    background: #334155;
}

/* Success Message */
.success-message {
    background: var(--white);
    padding: 60px 40px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    color: var(--text-primary);
}

.success-icon {
    font-size: 4rem;
    color: var(--accent-color);
    margin-bottom: 24px;
}

.success-message h3 {
    font-size: 2rem;
    margin-bottom: 16px;
    color: var(--primary-color);
}

.success-message p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Footer */
footer {
    background: #0f172a;
    color: #94a3b8;
    padding: 32px 0;
    text-align: center;
    border-top: 1px solid #1e293b;
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 960px) {
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .contact-wrapper {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .hero h1 {
        font-size: 2.5rem;
    }
}

@media (max-width: 768px) {
    .header-container {
        padding: 0 16px;
    }

    .nav-links {
        display: none; /* In a real project, implement mobile menu logic */
    }

    .mobile-menu-toggle {
        display: block;
    }
    
    .lang-switcher {
        display: none; /* Use mobile menu */
    }
    
    /* Move selector to absolute top right in mobile if needed, or put inside menu */
    .lang-selector-wrapper {
        position: absolute;
        right: 60px;
        border: none;
    }

    .nav-links.active {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 80px;
        left: 0;
        right: 0;
        background: var(--white);
        padding: 24px;
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
        border-top: 1px solid var(--border-color);
    }
}
