/* Arad Font for Farsi */
@font-face {
    font-family: 'Arad';
    src: url('fonts/Arad-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
}

@font-face {
    font-family: 'Arad';
    src: url('fonts/Arad-Medium.ttf') format('truetype');
    font-weight: 500;
    font-style: normal;
}

@font-face {
    font-family: 'Arad';
    src: url('fonts/Arad-Bold.ttf') format('truetype');
    font-weight: 600;
    font-style: normal;
}

:root {
    --bg-color: #F1F1F1;
    --accent-color: #FF7716;
    --text-color: #333333;
    --font-main: 'Inter', sans-serif;
    --font-farsi: 'Arad', sans-serif;
}

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


html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--bg-color);
    color: var(--text-color);
    overflow-x: hidden;
    transition: background-color 0.8s ease;
    /* Smooth background transition */
}

body.bg-white {
    background-color: #FFFFFF;
}

/* Navigation */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem 4rem;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    background-color: transparent;
    /* Or semi-transparent if needed */
}

.nav-logo {
    flex: 0 0 auto;
}

.nav-logo-img {
    height: 40px;
    width: auto;
    filter: brightness(0) saturate(100%) invert(20%) sepia(0%) saturate(0%) hue-rotate(0deg) brightness(95%) contrast(90%);
    transition: filter 0.3s ease;
}

.nav-logo a {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.nav-logo-img {
    height: 40px;
    width: auto;
    filter: brightness(0) saturate(100%) invert(20%) sepia(0%) saturate(0%) hue-rotate(0deg) brightness(95%) contrast(90%);
    transition: filter 0.3s ease;
    z-index: 2;
    /* Ensure icon stays on top if needed */
}

.nav-logo-text {
    height: 50px;
    /* 2.5x larger (was 20px) */
    width: auto;
    max-width: 0;
    opacity: 0;
    margin-left: 0;
    overflow: hidden;
    filter: brightness(0);
    /* Make it black */
    /* Make it black */
    transition: max-width 0.5s ease, opacity 0.5s ease, margin-inline-start 0.5s ease;
}

.nav-logo-text.visible {
    max-width: 500px;
    /* Increased to accommodate larger logo */
    opacity: 1;
    margin-inline-start: 10px;
}

.nav-logo-img:hover {
    filter: brightness(0) saturate(100%) invert(48%) sepia(89%) saturate(2477%) hue-rotate(1deg) brightness(102%) contrast(102%);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 0;
    flex: 1;
    justify-content: space-evenly;
    max-width: 600px;
    margin: 0 auto;
}

.nav-links li a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    font-size: 0.9rem;
    letter-spacing: 0.05em;
    transition: color 0.3s ease;
}

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

.mobile-only {
    display: none;
}

.desktop-only {
    display: block;
}

.nav-social-desktop {
    display: flex;
    align-items: center;
    color: var(--text-color);
    transition: color 0.3s ease;
}

.nav-social-desktop:hover {
    color: var(--accent-color);
}

.nav-social-desktop svg {
    width: 20px;
    height: 20px;
}

.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 6px;
    cursor: pointer;
}

.mobile-menu-btn span {
    width: 25px;
    height: 2px;
    background-color: var(--text-color);
}

/* Language Selector */
.language-selector {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.mobile-lang-selector {
    display: none;
}

.lang-btn {
    background: transparent;
    border: 1px solid var(--text-color);
    color: var(--text-color);
    padding: 0.4rem 0.8rem;
    font-family: var(--font-main);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.lang-btn:hover {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
    color: white;
}

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

/* RTL Support */
body.rtl {
    direction: rtl;
    font-family: var(--font-farsi);
}

body.rtl .navbar {
    flex-direction: row-reverse;
}

body.rtl .nav-links {
    flex-direction: row-reverse;
}

/* Fix About Section for RTL */
/* Keep image on right (default grid order) by forcing LTR on container */
body.rtl .about-container {
    direction: ltr;
}

/* But make text content RTL */
body.rtl .about-text-wrapper {
    direction: rtl;
    text-align: right;
}

/* Align title to right */
body.rtl .about-text-wrapper h1 {
    text-align: right;
}

/* Hero Section */
.hero-section {
    height: 350vh;
    /* Increased height for longer scroll buffer */
    width: 100%;
    position: relative;
}

.hero-container {
    position: sticky;
    top: 0;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    width: 100%;
    height: 100vh;
    /* Viewport height */
    padding-top: 15vh;
    overflow: hidden;
    /* Ensure content doesn't overflow during zoom */
}

.hero-image-wrapper {
    opacity: 0;
    /* Start hidden */
    transform: translateY(20px);
    transition: opacity 1.5s ease-out, transform 1.5s ease-out;
    z-index: 1;
    width: 100%;
    max-width: 500px;
    /* Fixed max width to maintain proportions */
}

.hero-img {
    width: 100%;
    height: auto;
    display: block;
    /* Optional: mix-blend-mode if the image needs to blend with bg */
}

.hero-logo-wrapper {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    opacity: 0;
    /* Start hidden */
    z-index: 2;
    width: 100%;
    max-width: 750px;
    /* Fixed max width to maintain proportions */
    transition: opacity 1.5s ease-out, transform 1.5s ease-out;
}

.hero-text-logo {
    width: 100%;
    height: auto;
    filter: brightness(0) saturate(100%) invert(48%) sepia(89%) saturate(2477%) hue-rotate(1deg) brightness(102%) contrast(102%);
}

/* Animation Classes */
.fade-in-image {
    opacity: 1;
    transform: translateY(0);
}

.fade-in-logo {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* Responsive */
@media (max-width: 768px) {
    .navbar {
        padding: 1.5rem 2rem;
    }

    .language-selector {
        display: none;
    }

    .desktop-only {
        display: none;
    }

    .mobile-only {
        display: block;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        height: 100vh;
        width: 70%;
        max-width: 300px;
        background-color: var(--bg-color);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 2rem;
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
        transition: right 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
        z-index: 99;
        padding: 2rem 0;
    }

    .nav-links.active {
        right: 0;
    }

    .nav-links li {
        opacity: 0;
        transform: translateX(50px);
        transition: opacity 0.3s ease, transform 0.3s ease;
    }

    .nav-links.active li {
        opacity: 1;
        transform: translateX(0);
    }

    .nav-links.active li:nth-child(1) {
        transition-delay: 0.1s;
    }

    .nav-links.active li:nth-child(2) {
        transition-delay: 0.2s;
    }

    .nav-links.active li:nth-child(3) {
        transition-delay: 0.3s;
    }

    /* Mobile language selector inside menu */
    .mobile-lang-selector {
        display: flex;
        gap: 0.5rem;
        margin-top: 2rem;
        opacity: 0;
        transform: translateX(50px);
        transition: opacity 0.3s ease, transform 0.3s ease;
    }

    .nav-links.active .mobile-lang-selector {
        opacity: 1;
        transform: translateX(0);
        transition-delay: 0.4s;
    }

    .mobile-menu-btn {
        display: flex;
        z-index: 100;
    }

    .mobile-menu-btn span {
        transition: all 0.3s ease;
    }

    .mobile-menu-btn.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }

    .mobile-menu-btn.active span:nth-child(2) {
        opacity: 0;
    }

    .mobile-menu-btn.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }

    .hero-image-wrapper {
        max-width: 80%;
    }

    .hero-logo-wrapper {
        width: 90%;
    }
}

/* Content Sections */
.content-section {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 4rem 2rem;
    position: relative;
    z-index: 10;
    background-color: inherit;
    /* Inherit body background to show transition and cover hero */
}

.section-container {
    max-width: 1200px;
    width: 100%;
    text-align: center;
}

#about {
    opacity: 0;
    transition: opacity 1s ease;
    padding: 0;
    /* Remove padding to allow image to touch edge */
}

#about.fade-in-active {
    opacity: 1;
}

#about.fade-in-active {
    opacity: 1;
}

#about.fade-in-active {
    opacity: 1;
}

/* About Section Split Layout */
.about-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    max-width: 100%;
    /* Allow full width */
    padding: 0;
    /* Remove default padding */
    height: 100vh;
    /* Full viewport height */
}

.about-text-wrapper {
    padding: 4rem;
    padding-right: 2rem;
    max-width: 800px;
    margin-left: auto;
    /* Push to right of its cell */
}

.about-text-wrapper h1 {
    text-align: left;
    padding-bottom: 2rem;
    margin: 0;
    font-size: 2.5rem;
    /* Ensure consistent size */
    color: var(--text-color);
}

.about-content {
    text-align: justify;
    line-height: 1.6;
}

.about-content p {
    margin-bottom: 1.5rem;
    font-size: 1rem;
    color: var(--text-color);
}

.about-image-wrapper {
    height: 100%;
    width: 100%;
    overflow: hidden;
    align-self: stretch;
    /* Ensure it fills the grid cell height */
    display: flex;
    justify-content: flex-end;
    /* Align to right */
    align-items: flex-end;
    /* Align to bottom */
}

.about-img {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    /* Ensure full image is visible */
    display: block;
}

/* Mobile Responsive for About */
@media (max-width: 968px) {
    .about-container {
        grid-template-columns: 1fr;
        height: auto;
        padding-bottom: 4rem;
    }

    .about-text-wrapper {
        padding: 2rem;
        margin: 0 auto;
        order: 2;
        /* Text below image on mobile */
    }

    .about-image-wrapper {
        height: 50vh;
        order: 1;
        /* Image on top on mobile */
    }
}

/* Scroll Animation Classes */
.hero-scroll-animate {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    pointer-events: none;
    z-index: 1;
}

.hero-image-wrapper.fade-out {
    opacity: 0;
    transform: translateY(-50px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.hero-logo-wrapper.zoom-out {
    transform: translate(-50%, -50%) scale(20);
    opacity: 0;
    transition: transform 0.8s ease, opacity 0.8s ease;
}

/* Mobile menu overlay */
.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 98;
}

.menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Sticky Footer */
.sticky-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: var(--bg-color);
    /* Match body background */
    padding: 0.5rem 0;
    text-align: center;
    z-index: 90;
    /* Below mobile menu (99) and overlay (98) */
    font-size: 0.8rem;
    color: var(--text-color);
    opacity: 0.8;
}

/* Contact Form */
.contact-description {
    margin-bottom: 2rem;
    font-size: 1.1rem;
    color: var(--text-color);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

.contact-form {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    width: 100%;
}

.form-input {
    width: 100%;
    padding: 1rem;
    background: transparent;
    border: 1px solid var(--text-color);
    border-radius: 4px;
    font-family: var(--font-main);
    font-size: 1rem;
    color: var(--text-color);
    outline: none;
    transition: border-color 0.3s ease;
}

.form-input:focus {
    border-color: var(--accent-color);
}

.form-input::placeholder {
    color: var(--text-color);
    opacity: 0.7;
}

.submit-btn {
    padding: 1rem 2rem;
    background-color: var(--text-color);
    color: var(--bg-color);
    border: none;
    border-radius: 4px;
    font-family: var(--font-main);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    align-self: flex-start;
}

.submit-btn:hover {
    background-color: var(--accent-color);
    color: white;
}

.submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}