/* Reset default margins and paddings */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --color-bg-canvas: #0b1116;
    --color-bg-surface: #121a21;
    --color-bg-elevated: #18232c;
    --color-text-primary: #eaf1f5;
    --color-text-secondary: #9eabb7;
    --color-border: #2b3945;
    --color-accent-primary: #5fb7c8;
    --button-text: #121a21;
    --parallax-overlay: rgba(11, 17, 22, 0.72);
    --social-icon-filter: brightness(0) invert(1);
    --social-icon-hover-filter: brightness(0) invert(0.78);
}

/* Typography Improvements */
body {
    background-color: var(--color-bg-canvas);
    color: var(--color-text-primary);
    font-family: 'Montserrat', sans-serif;
    overflow-x: hidden;
    line-height: 1.5;
}

h1, h2, h3 {
    font-weight: 700;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
}

header h1 {
    font-size: 1.8em;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 25px;
}

nav a {
    color: var(--color-text-primary);
    text-decoration: none;
    font-size: 1em;
    transition: color 0.3s;
}

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

.language-switcher {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: flex-end;
    flex-wrap: nowrap;
    position: absolute;
    top: 20px;
    right: 20px;
    margin-top: 0;
    padding: 10px 12px;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    background: rgba(11, 17, 22, 0.82);
    backdrop-filter: blur(10px);
    z-index: 3;
    max-width: calc(100vw - 40px);
}

.language-switcher label {
    font-size: 0.9em;
    color: #cccccc;
    white-space: nowrap;
}

.language-switcher select {
    background-color: #1e1e1e;
    color: #ffffff;
    border: 1px solid #666666;
    border-radius: 8px;
    padding: 6px 10px;
    font-family: 'Montserrat', sans-serif;
    max-width: min(100%, 22rem);
}

.language-switcher select:focus {
    outline: 2px dashed #ff6b6b;
    outline-offset: 3px;
}

/* Parallax Section */
#parallax {
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    padding: 200px 20px;
    text-align: center;
    position: relative;
}

#parallax::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--parallax-overlay);
}

.parallax-content {
    position: relative;
    z-index: 1;
}

.parallax-content h2 {
    font-size: 2.5em;
    margin-bottom: 20px;
}

.parallax-content p {
    font-size: 1.2em;
    max-width: 700px;
    margin: 0 auto 30px;
}

/* Buttons */
.buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    margin-top: 30px;
}

.button {
    padding: 15px 30px;
    background-color: var(--color-accent-primary);
    color: var(--button-text);
    text-decoration: none;
    border-radius: 30px;
    font-size: 1em;
    transition: transform 0.3s, filter 0.3s;
}

.button:hover {
    filter: brightness(1.08);
    transform: translateY(-5px);
}

/* Main Content */
main {
    padding: 60px 20px;
}

main section {
    margin-bottom: 80px;
}

main h2 {
    font-size: 2em;
    text-align: center;
    margin-bottom: 30px;
}

main p {
    font-size: 1.1em;
    max-width: 800px;
    margin: 0 auto 20px;
    text-align: center;
}

.product-image {
    display: block;
    width: 100%;
    max-width: 600px;
    margin: 40px auto;
    border-radius: 10px;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.1);
}

/* Features */
#features ul {
    list-style: none;
    margin-top: 30px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

#features li {
    margin-bottom: 20px;
    font-size: 1.1em;
    display: flex;
    align-items: flex-start;
}

#features li strong {
    margin-inline-end: 0.35rem;
}

#features li::before {
    content: '';
    width: 10px;
    height: 10px;
    background-color: var(--color-accent-primary);
    border-radius: 50%;
    margin-right: 15px;
    margin-top: 8px;
}

html[dir="rtl"] body {
    direction: rtl;
}

html[dir="rtl"] .language-switcher {
    right: auto;
    left: 20px;
    flex-direction: row-reverse;
}

html[dir="rtl"] #features li {
    text-align: right;
}

html[dir="rtl"] #features li::before {
    margin-right: 0;
    margin-left: 15px;
}

/* Testimonials */
.testimonial {
    background-color: var(--color-bg-elevated);
    padding: 30px;
    border-radius: 10px;
    margin-bottom: 30px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

.testimonial p {
    font-style: italic;
    margin-bottom: 15px;
    font-size: 1.1em;
}

.testimonial span {
    font-size: 0.9em;
    color: var(--color-text-secondary);
}

/* Call to Action */
#call-to-action {
    text-align: center;
}

/* Contact Section */
#contact {
    text-align: center;
}

#contact p {
    margin-bottom: 20px;
}

/* Footer */
footer {
    text-align: center;
    padding: 40px 20px;
    background-color: var(--color-bg-canvas);
}

footer p {
    margin-bottom: 20px;
    font-size: 0.9em;
    color: var(--color-text-secondary);
}

.social-media {
    margin-bottom: 20px;
}

.social-media a {
    margin: 0 10px;
}

.social-media img {
    width: 24px;
    height: 24px;
    filter: var(--social-icon-filter);
    transition: filter 0.3s;
}

.social-media img:hover {
    filter: var(--social-icon-hover-filter);
}

.footer-nav a {
    color: var(--color-text-secondary);
    margin: 0 15px;
    font-size: 0.9em;
    text-decoration: none;
    transition: color 0.3s;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    header {
        flex-direction: column;
    }

    nav ul {
        flex-direction: column;
        gap: 15px;
        margin-top: 15px;
    }

    .language-switcher {
        top: 12px;
        right: 12px;
        max-width: calc(100vw - 24px);
    }

    .buttons {
        flex-direction: column;
    }

    h1 {
        font-size: 1.5em;
    }

    .parallax-content h2 {
        font-size: 2em;
    }
}

@media (max-width: 768px) {
    header {
        padding: 10px;
    }

    nav ul {
        flex-direction: column;
        gap: 10px;
    }

    nav a {
        font-size: 0.9em;
    }

    .parallax-content h2 {
        font-size: 1.8em;
    }

    .parallax-content p {
        font-size: 1em;
    }

    #parallax {
        padding: 150px 10px;
    }

    .buttons {
        flex-direction: column;
        gap: 10px;
    }

    .button {
        padding: 10px 20px;
        font-size: 0.9em;
    }
}

/* Animations */
html {
    scroll-behavior: smooth;
}

/* AOS Animations */
[data-aos] {
    opacity: 0;
    transition-property: opacity, transform;
}

[data-aos].aos-animate {
    opacity: 1;
}

/* Accessibility Enhancements */
nav a:focus,
.button:focus,
.footer-nav a:focus {
    outline: 2px dashed var(--color-accent-primary);
    outline-offset: 4px;
}

body, html {
    height: 100%;
    margin: 0;
}

#particles-js {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: -1;
}

header {
    min-height: 100vh; /* Full viewport height */
    display: flex;
    flex-direction: column;
    justify-content: flex-end; /* Align links to the bottom */
    align-items: center;
    padding-bottom: 30px; /* Space from bottom for links */
    text-align: center;
    background: transparent; /* Ensure transparency for particles */
    position: relative;
}

@media (max-width: 768px) {
    header {
        /* Keep header visible with iOS Smart App Banner/safe-area UI, while positioning content lower. */
        min-height: calc(100svh - (env(safe-area-inset-top, 0px) + 32px));
        justify-content: flex-end;
        padding-top: calc(env(safe-area-inset-top, 0px) + 8px);
        padding-bottom: 24px;
    }

    html[dir="rtl"] .language-switcher {
        left: 12px;
    }
}

@media (max-width: 768px) {
    /* Features Section Adjustments */
    #features ul {
        padding: 0 15px;
        margin: 20px 0;
    }

    #features li {
        display: block; /* Stack items vertically */
        margin-bottom: 15px; /* Reduce spacing for better fit */
        font-size: 1em; /* Adjust font size for smaller screens */
    }

    #features li::before {
        width: 8px;
        height: 8px;
        margin-top: 0; /* Align the circle with text */
        margin-right: 10px;
    }

    #features h2 {
        font-size: 1.6em; /* Reduce heading size */
        margin-bottom: 15px; /* Adjust spacing below heading */
    }
}
