/* =============================================== */
/* --- Farhikhtegan Holding - Final Stylesheet --- */
/* =============================================== */

/* --- FONT FACE --- */
@font-face {
  font-family: 'Vazirmatn';
  src: url('font/fa/vazir/Vazirmatn[wght].woff2') format('woff2-variations');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* --- THEME & COLOR VARIABLES --- */
:root {
    /* Main Colors */
    --background-color: #0d0d1a;
    --primary-text-color: #ffffff;
    --secondary-text-color: #cccccc;
    --accent-color: #00bfff; /* Deep Sky Blue */
    --glow-color: rgba(0, 191, 255, 0.8);
    --sun-glow-color-1: rgba(255, 223, 0, 0.7);
    --sun-glow-color-2: rgba(255, 165, 0, 0.5);

    /* Glass Effect */
    --glass-bg: rgba(15, 15, 30, 0.7);
    --glass-border: rgba(255, 255, 255, 0.15);

    /* Components */
    --header-footer-bg: var(--glass-bg);
    --header-footer-border: var(--glass-border);
    --nav-link-color: var(--secondary-text-color);
    --nav-link-highlight-color: var(--primary-text-color);
    --nav-link-active-glow: 0 0 10px var(--glow-color);
    --button-disabled-bg: #555;
    --button-disabled-color: #999;
    --input-bg: rgba(0,0,0,0.2);

    /* Fonts */
    --font-fa: 'Vazirmatn', sans-serif;
    --font-en: 'Poppins', sans-serif;
    
    /* Layout */
    --header-height: 70px;
    --footer-height: 60px; /* Adjusted for mobile nav */
    --section-top-spacing: 2rem;
}

/* --- GLOBAL & RESET --- */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; }
html, body { height: 100%; overflow: hidden; scroll-behavior: smooth; background-color: var(--background-color); }
body { color: var(--primary-text-color); font-family: var(--font-en); font-weight: 400; font-synthesis: none; }
body.no-scroll { overflow: hidden; }
html[lang="fa"] body, html[lang="fa"] input, html[lang="fa"] textarea, html[lang="fa"] button, html[lang="fa"] p, html[lang="fa"] a, html[lang="fa"] h1, html[lang="fa"] h2, html[lang="fa"] h3, html[lang="fa"] h4 { 
    font-family: var(--font-fa) !important; 
    font-weight: 400; 
}
h1, h2, h3, h4, .field, .submit-btn, .card-btn, nav a { font-weight: 700; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }

/* --- MAIN LAYOUT & BACKGROUND --- */
.main-container {
    height: 100%;
    overflow-y: scroll;
    position: relative;
    z-index: 1;
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.main-container::-webkit-scrollbar {
    display: none;
}

section {
    min-height: 100vh;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    padding: var(--header-height) 24px calc(var(--footer-height) + 40px) 24px; /* Space for scroll button */
    overflow: hidden;
}
section#about {
    min-height: 100vh;
    height: auto;
    justify-content: center;
}
section#companies, section#contact { 
    justify-content: flex-start; 
}
.hero-content, .about-container, .companies-container, .contact-container { 
    padding-top: var(--section-top-spacing); 
    width: 100%; 
    box-sizing: border-box; 
}
.about-container { max-width: 1100px; }
.companies-container { max-width: 1080px; margin-top: -2rem; }
.contact-container { max-width: 1200px; }


/* --- BACKGROUND --- */
#liquid-background { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 0; }
.fallback-background {
  background: linear-gradient(-45deg, #0d0d1a, #1a1a3d, #0d0d1a, #2a2a5f);
  background-size: 400% 400%;
  animation: gradientBG 15s ease infinite;
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  z-index: 0;
}
@keyframes gradientBG { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }

/* --- HEADER --- */
#main-header {
    position: fixed; top: 0; left: 0; width: 100%; z-index: 1000;
    display: flex; justify-content: space-between; align-items: center;
    padding: 0 30px; background: var(--header-footer-bg);
    backdrop-filter: blur(15px); -webkit-backdrop-filter: blur(15px);
    border-bottom: 1px solid var(--header-footer-border);
    height: var(--header-height);
}
.header-column { display: flex; align-items: center; flex: 1; }
.nav-column { justify-content: flex-start; }
.logo-column { flex: 0 1 auto; position: absolute; left: 50%; transform: translateX(-50%); }
.controls-column { justify-content: flex-end; gap: 1rem; }

html[dir="rtl"] .nav-column { order: 1; justify-content: flex-start; }
html[dir="rtl"] .logo-column { order: 2; }
html[dir="rtl"] .controls-column { order: 3; justify-content: flex-end; }

.header-logo-link {
    display: inline-block;
    padding: 5px;
    border-radius: 50%;
    animation: sun-glow 3s infinite ease-in-out;
}
@keyframes sun-glow {
    0%, 100% {
        box-shadow: 0 0 15px var(--sun-glow-color-1), 0 0 25px var(--sun-glow-color-2);
    }
    50% {
        box-shadow: 0 0 30px var(--sun-glow-color-1), 0 0 45px var(--sun-glow-color-2);
    }
}
.header-logo-link img { height: 50px; width: auto; }
.main-nav ul { list-style: none; display: flex; gap: 2.5rem; }
.main-nav a { color: var(--nav-link-color); font-size: 0.95rem; font-weight: 700; transition: color 0.3s, text-shadow 0.3s; text-shadow: 0 0 0 rgba(0, 191, 255, 0); }
.main-nav a:hover { color: var(--nav-link-highlight-color); }
.main-nav a.active { color: var(--nav-link-highlight-color); text-shadow: var(--nav-link-active-glow); }
.lang-btn { background: none; border: none; padding: 8px; cursor: pointer; display: flex; align-items: center; gap: 8px; font-size: 14px; }
.lang-btn img { width: 20px; height: 15px; border-radius: 3px; }
.hamburger-menu { display: none; }
.mobile-nav-overlay { display: none; }

/* --- FOOTER (FIXED) --- */
#main-footer { position: fixed; bottom: 0; left: 0; width: 100%; z-index: 999; display: flex; justify-content: center; align-items: center; color: var(--secondary-text-color); font-size: 0.9rem; }
#main-footer .desktop-footer-text {
    height: var(--footer-height);
    display: flex;
    justify-content: center;
    align-items: center;
    background: var(--header-footer-bg);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--header-footer-border);
    width: 100%;
}
.mobile-footer-nav { display: none; }

/* --- REVEAL ANIMATIONS --- */
.reveal { opacity: 0; transform: translateY(40px); transition: opacity 0.8s ease-out, transform 0.8s ease-out; }
.reveal.active { opacity: 1; transform: translateY(0); }
.reveal.delay-1 { transition-delay: 0.2s; }
.reveal.delay-2 { transition-delay: 0.4s; }

/* --- GENERAL SECTION STYLES --- */
.section-title-separator { display: flex; align-items: center; text-align: center; width: 100%; max-width: 1100px; margin-bottom: 2rem; }
.section-title-separator::before, .section-title-separator::after { content: ''; flex: 1; border-bottom: 1px solid var(--glass-border); }
.section-title-separator:not(:empty)::before { margin-right: 1.5rem; }
html[dir="rtl"] .section-title-separator:not(:empty)::before { margin-right: 0; margin-left: 1.5rem; }
.section-title-separator:not(:empty)::after { margin-left: 1.5rem; }
html[dir="rtl"] .section-title-separator:not(:empty)::after { margin-left: 0; margin-right: 1.5rem; }

/* --- HERO SECTION --- */
#hero { display: flex; justify-content: center; align-items: center; }
.hero-logo-container { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 1; }
.hero-logo { width: 120px; margin: 0 auto; /* Animation is now triggered by JS */ }
@keyframes zoomAndRotate { from { transform: scale(0.3) rotate(-360deg); opacity: 0; } to { transform: scale(3) rotate(0deg); opacity: 1; } }
.hero-text-container { opacity: 0; text-align: center; position: absolute; bottom: calc(var(--footer-height) + 8%); left: 50%; transform: translateX(-50%); width: 100%; z-index: 2; }
.hero-title { opacity: 0; font-size: 1.8rem; margin-bottom: 1rem; }
.hero-subtitle { font-size: 1.1rem; min-height: 2.5rem; }
.cursor { display: none; width: 2px; height: 1.2rem; background-color: var(--accent-color); animation: blink 0.7s infinite; vertical-align: middle; }
@keyframes blink { 50% { opacity: 0; } }

/* --- ABOUT SECTION --- */
.about-intro-text { margin-bottom: 2rem; }
.about-intro-text p { text-align: justify; line-height: 1.8; }
.about-main-grid { display: grid; grid-template-columns: 1fr 1.5fr; gap: 3rem; align-items: center; margin-bottom: 2rem; }
html[dir="rtl"] .about-main-grid { grid-template-columns: 1.5fr 1fr; }
.about-slider-column { position: relative; border-radius: 15px; overflow: hidden; box-shadow: 0 10px 40px rgba(0,0,0,0.4); }
.about-image-swiper { width: 100%; height: 280px; }
.about-image-swiper .swiper-slide img { display: block; width: 100%; height: 100%; object-fit: cover; }
.about-image-swiper .swiper-pagination-bullet-active { background-color: var(--accent-color); }

/* --- TIMELINE --- */
.timeline { position: relative; padding: 10px 0; }
.timeline-item { display: flex; align-items: flex-start; position: relative; }
.timeline-item:not(:last-child) { padding-bottom: 2rem; }
.timeline-item::before { content: ''; position: absolute; width: 2px; background-color: var(--glass-border); top: 35px; bottom: -28px; left: 35px; z-index: 1; }
html[dir="rtl"] .timeline-item::before { left: auto; right: 35px; }
.timeline-item:last-child::before { display: none; }
.timeline-point { width: 70px; height: 70px; flex-shrink: 0; border-radius: 50%; background-color: var(--background-color); border: 3px solid var(--accent-color); box-shadow: 0 0 15px var(--glow-color); display: flex; justify-content: center; align-items: center; z-index: 2; transition: transform 0.4s ease, box-shadow 0.4s ease; }
.timeline-year { font-size: 1.1rem; font-weight: 700; color: var(--primary-text-color); }
.timeline-content { padding: 0 20px; padding-top: 5px; }
html[dir="rtl"] .timeline-content { padding: 0 20px; }
.timeline-title { font-size: 1.1rem; color: var(--secondary-text-color); margin-bottom: 0.5rem; font-weight: 400; transition: font-weight 0.4s ease, color 0.4s ease; }
.timeline-content p { font-size: 0.95rem; color: var(--secondary-text-color); line-height: 1.7; text-align: justify; margin: 0; font-weight: 400; transition: font-weight 0.4s ease, color 0.4s ease; }
.timeline-item.active .timeline-title,
.timeline-item.active .timeline-content p { font-weight: 700; color: var(--primary-text-color); }

.about-core-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2.5rem; width: 100%; }
.core-item { background: transparent; border-radius: 10px; border: 1px solid var(--glass-border); text-align: center; transition: all 0.3s ease; padding: 1.5rem 1rem; position: relative; min-height: 80px; display: flex; justify-content: center; align-items: center; }
.core-item h3 { position: absolute; top: 0; left: 50%; transform: translate(-50%, -50%); background-color: var(--background-color); padding: 0.1rem 1rem; font-size: 1.1rem; color: var(--accent-color); white-space: nowrap; }
.core-item:hover { transform: translateY(-5px); background: var(--glass-bg); box-shadow: 0 5px 20px rgba(0,0,0,0.2); }
.core-item p { font-size: 0.9rem; color: var(--secondary-text-color); text-align: center; padding: 0 0.5rem; }

/* --- COMPANIES SECTION --- */
.companies-container { padding-bottom: 2rem; }
.swiper-container-wrapper { position: relative; }
.swiper { width: 100%; padding-bottom: 0; overflow: visible; }
.swiper-slide { background: transparent; border: none; backdrop-filter: none; width: 100%; height: auto; display: flex; align-items: stretch; }
.company-card-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; width: 100%; background: var(--glass-bg); padding: 1.5rem; border-radius: 15px; border: 1px solid var(--glass-border); backdrop-filter: blur(12px); min-height: 380px; }
.company-details-wrapper { display: flex; flex-direction: column; text-align: center; }
.company-logo-container-top { margin-bottom: 0.5rem; }
.company-logo-top { max-width: 60px; max-height: 60px; margin: 0 auto; }
.company-details-wrapper .company-name { font-size: 1.3rem; margin-bottom: 0.5rem; color: var(--accent-color); }
.company-details-wrapper .field { font-size: 1rem; margin-bottom: 1rem; }
.company-details-wrapper .description { text-align: justify; line-height: 1.6; flex-grow: 1; font-size: 0.9rem; }
.company-media-wrapper { display: flex; flex-direction: column; gap: 1rem; }
.company-photo-container { flex-grow: 1; display: flex; justify-content: center; align-items: center; min-height: 220px; }
.company-photo-main { width: 100%; height: 100%; object-fit: cover; border-radius: 10px; }
.card-contact-info { margin-top: auto; padding-top: 1rem; }
.card-contact-info .address-line { font-size: 0.85rem; text-align: center; margin-bottom: 0.5rem; }
.card-contact-info .social-icons { display: flex; justify-content: center; gap: 1rem; }
.card-contact-info .social-icons a svg { width: 22px; height: 22px; fill: var(--secondary-text-color); transition: fill 0.3s; }
.card-contact-info .social-icons a:hover svg { fill: var(--accent-color); }
.card-btn { background-color: var(--accent-color); color: var(--primary-text-color); border: none; padding: 10px; border-radius: 8px; text-align: center; margin-top: 1rem; transition: all 0.3s ease; font-size: 0.9rem; }
.card-btn:hover { box-shadow: 0 0 15px var(--glow-color); }
.desktop-only { display: flex; }
.swiper-button-next, .swiper-button-prev { color: var(--accent-color); background-color: rgba(255, 255, 255, 0.1); backdrop-filter: blur(5px); width: 44px; height: 44px; border-radius: 50%; transition: all 0.3s ease; animation: pulse-glow 2.5s infinite; }
@keyframes pulse-glow { 0%, 100% { box-shadow: 0 0 10px rgba(0,0,0,0); } 50% { box-shadow: 0 0 20px var(--glow-color); } }
.swiper-button-next:hover, .swiper-button-prev:hover { background-color: var(--accent-color); color: white; box-shadow: 0 0 15px var(--glow-color); animation: none; }
.swiper-button-next:after, .swiper-button-prev:after { font-size: 1.2rem; font-weight: 900; }
.swiper-button-prev { left: -60px; }
.swiper-button-next { right: -60px; }

/* --- CONTACT SECTION --- */
.contact-page-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; width: 100%; align-items: flex-start; }
.contact-form-wrapper { background: var(--glass-bg); padding: 2rem; border-radius: 15px; border: 1px solid var(--glass-border); }
#contact-form { display: flex; flex-direction: column; gap: 1rem; height: 100%; }
.contact-form-wrapper input, .contact-form-wrapper textarea { width: 100%; background: var(--input-bg); border: 1px solid var(--glass-border); padding: 12px; border-radius: 8px; color: var(--primary-text-color); font-size: 1rem; }
.contact-form-wrapper input[type="email"], .contact-form-wrapper input[type="tel"] { direction: ltr; text-align: left; }
.contact-form-wrapper textarea { resize: vertical; flex-grow: 1; }
.contact-form-wrapper input:focus, .contact-form-wrapper textarea:focus { outline: none; border-color: var(--accent-color); box-shadow: 0 0 10px var(--glow-color); }
.submit-btn { padding: 16px; font-size: 1.1rem; border: none; border-radius: 8px; cursor: pointer; transition: all 0.3s ease; }
.submit-btn:enabled { background-color: var(--accent-color); color: var(--primary-text-color); }
.submit-btn:enabled:hover { box-shadow: 0 0 15px var(--glow-color); }
.submit-btn:disabled { background-color: var(--button-disabled-bg); color: var(--button-disabled-color); cursor: not-allowed; }
.map-and-info { display: flex; flex-direction: column; gap: 1rem; }
#map { flex-grow: 1; min-height: 250px; border-radius: 15px; overflow: hidden; border: 1px solid var(--glass-border); }
.contact-info-item { display: flex; align-items: center; gap: 10px; font-size: 0.9rem; transition: color 0.3s ease; margin-bottom: 0.5rem; }
.contact-info-item:hover { color: var(--primary-text-color); }
.contact-info-item svg { width: 24px; height: 24px; fill: var(--accent-color); flex-shrink: 0; }
.contact-details-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.contact-details-col { display: flex; flex-direction: column; }
.modal { position: fixed; z-index: 1001; left: 0; top: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.7); display: flex; justify-content: center; align-items: center; opacity: 0; visibility: hidden; transition: opacity 0.3s ease, visibility 0.3s ease; }
.modal.show { opacity: 1; visibility: visible; }
.modal-content { background: var(--glass-bg); backdrop-filter: blur(15px); -webkit-backdrop-filter: blur(15px); padding: 30px; border: 1px solid var(--glass-border); width: 90%; max-width: 500px; border-radius: 15px; text-align: center; box-shadow: 0 0 30px rgba(0, 0, 0, 0.5); transform: scale(0.9); transition: transform 0.3s ease; margin: 1rem; }
.modal.show .modal-content { transform: scale(1); }
.modal-content h3 { color: var(--accent-color); margin-bottom: 1rem; font-size: 1.5rem; }
.modal-content p { line-height: 1.6; text-align: center; }
.close-btn { color: #aaa; float: right; font-size: 28px; font-weight: bold; cursor: pointer; transition: color 0.3s; }
html[dir="rtl"] .close-btn { float: left; }
.close-btn:hover, .close-btn:focus { color: white; }

/* --- SCROLL DOWN BUTTON --- */
.scroll-down-btn { position: absolute; bottom: var(--footer-height); left: 50%; transform: translateX(-50%); width: 20px; height: 30px; background: transparent; border: none; cursor: pointer; z-index: 10; }
.scroll-down-btn::before { content: ''; position: absolute; top: 50%; left: 50%; width: 10px; height: 10px; border-left: 2px solid var(--sun-glow-color-1); border-bottom: 2px solid var(--sun-glow-color-1); transform: translate(-50%, -75%) rotate(-45deg); animation: flasher 1.5s infinite; }
@keyframes flasher { 0%, 100% { box-shadow: 0 0 4px var(--sun-glow-color-1), 0 0 8px var(--sun-glow-color-2); opacity: 0; } 50% { box-shadow: 0 0 12px var(--sun-glow-color-1), 0 0 18px var(--sun-glow-color-2); opacity: 1; } }
.scroll-up-btn::before { transform: translate(-50%, -25%) rotate(135deg); }

/* --- RESPONSIVE STYLES --- */
@media (max-width: 900px) {
    .main-nav, .hamburger-menu, .mobile-nav-overlay { display: none; }
    #main-header { justify-content: center; }
    .header-column.logo-column { position: relative; transform: none; left: 0; }
    .header-column.nav-column, .header-column.controls-column { display: none; }
    #main-footer .desktop-footer-text { display: none; }
    .mobile-footer-nav { display: flex; position: fixed; bottom: 0; left: 0; width: 100%; height: var(--footer-height); background: var(--header-footer-bg); backdrop-filter: blur(15px); -webkit-backdrop-filter: blur(15px); border-top: 1px solid var(--header-footer-border); justify-content: space-around; align-items: center; z-index: 1000; }
    .mobile-nav-item { display: flex; flex-direction: column; align-items: center; color: var(--secondary-text-color); font-size: 0.7rem; gap: 4px; transition: color 0.3s; }
    .mobile-nav-item svg { width: 24px; height: 24px; fill: var(--secondary-text-color); transition: fill 0.3s; }
    #mobile-lang-flag { width: 24px; height: 18px; border-radius: 3px; object-fit: cover; }
    .mobile-nav-item span { font-weight: 500; }
    .mobile-nav-item.active { color: var(--accent-color); }
    .mobile-nav-item.active svg { fill: var(--accent-color); }
    .about-main-grid, .about-core-grid { grid-template-columns: 1fr; }
    .about-slider-column { max-width: 400px; margin: 0 auto; }
    .company-card-grid { grid-template-columns: 1fr; padding: 1.5rem; }
    .company-media-wrapper.desktop-only { display: none; }
    .swiper-button-prev, .swiper-button-next { display: none; }

    /* --- HERO SECTION MOBILE --- */
    .hero-logo-container { top: 45%; }
    .hero-logo { width: 90px; }
    @keyframes zoomAndRotateMobile { from { transform: scale(0.3) rotate(-360deg); opacity: 0; } to { transform: scale(2.25) rotate(0deg); opacity: 1; } }
    .hero-logo { animation-name: zoomAndRotateMobile !important; }
    .hero-text-container { bottom: calc(var(--footer-height) + 15%); }
    html[lang="en"] .hero-title { font-size: 1.6rem; }

    /* --- CONTACT SECTION MOBILE --- */
    .contact-page-grid { grid-template-columns: 1fr; }
    .map-and-info { order: -1; } 
    .contact-info-wrapper { width: 100%; }
    .contact-address-item { margin-bottom: 1rem; padding-bottom: 1rem; border-bottom: 1px solid var(--glass-border); }
    .contact-details-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
    .contact-details-col { display: flex; flex-direction: column; gap: 0.5rem; }
    html[dir="rtl"] .contact-info-item, html[dir="rtl"] .contact-details-col { align-items: flex-start; text-align: right; }
    html[dir="ltr"] .contact-info-item, html[dir="ltr"] .contact-details-col { align-items: flex-start; text-align: left; }

    /* Timeline Responsive */
    .timeline { padding-left: 20px; }
    html[dir="rtl"] .timeline { padding-left: 0; padding-right: 20px; }
    .timeline-item { padding-left: 90px; }
    html[dir="rtl"] .timeline-item { padding-left: 0; padding-right: 90px; }
    .timeline-item::before { left: 30px; }
    html[dir="rtl"] .timeline-item::before { left: auto; right: 30px; }
    .timeline-point { left: 30px; }
    html[dir="rtl"] .timeline-point { left: auto; right: 30px; }
}

@media (max-width: 600px) {
    .contact-details-grid { grid-template-columns: 1fr; } /* Stack columns on very small screens */
}

@media (min-width: 901px) {
    .mobile-footer-nav { display: none !important; }
    .hero-logo { animation-name: zoomAndRotate; }
}

@media (min-width: 768px) {
    .section-title-separator { font-size: 2.25rem; }
}

@media (min-width: 1024px) {
    .swiper-slide { transform: scale(0.9); opacity: 0.7; transition: transform 0.5s, opacity 0.5s; }
    .swiper-slide-active { transform: scale(1); opacity: 1; }
}