/* ======================================================== */
/* ===   Aftab Gostaran Alborz - Main Stylesheet - v5.5   === */
/* ======================================================== */
/*
 *   TABLE OF CONTENTS
 *   ---------------------------
 *   1.  Global Styles & Variables
 *   2.  Layout & Helpers
 *   3.  Header & Navigation
 *   4.  Hero Section
 *   5.  General Page Sections
 *   6.  Component-Specific Styles
 *   7.  Page-Specific Styles
 *   8.  Footer
 *   9.  Responsive Design & Bilingual Fixes
*/


/* 1. Global Styles & Variables
-------------------------------------------------- */
:root {
    /* Colors - Updated palette for "Aftab" brand identity */
    --primary-blue: #005A9C;      /* Deeper, more professional blue */
    --dark-blue: #003D6B;          /* Darker blue for main headings */
    --accent-orange: #FFA500;      /* Solar orange as the accent color */
    --secondary-gray: #6c757d;
    --light-gray: #f8f9fa;
    --border-color: #e9ecef;
    --white-color: #fff;
    --dark-text: #343a40;
    --footer-bg: #212529;
    --footer-text: #adb5bd;

    /* Shadows & Borders */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 15px rgba(0, 0, 0, 0.08);
    --border-radius-md: 8px;
    --border-radius-lg: 12px;

    /* Sizing - Increased logo size */
    --logo-size: 150px;
}

body {
    font-family: 'Vazirmatn', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.7;
    color: var(--dark-text);
    background-color: var(--white-color);
    margin: 0;

    /* Font Rendering Optimization */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* RTL and LTR base styles */
html[dir="rtl"] body { text-align: right; }
html[dir="ltr"] body { text-align: left; }


/* 2. Layout & Helpers
-------------------------------------------------- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

hr {
    border: 0;
    height: 1px;
    background-color: var(--border-color);
    margin: 40px 0;
}

.text-center {
    text-align: center;
}

/* Hide elements based on language */
body.lang-fa .english-only { display: none; }
body.lang-en .persian-only { display: none; }


/* 3. Header & Navigation
-------------------------------------------------- */
.main-header {
    background-color: var(--white-color);
    box-shadow: var(--shadow-sm);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.main-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 20px;
    font-weight: 700;
    color: var(--dark-blue);
    text-decoration: none;
}

.logo-img {
    width: var(--logo-size);
    height: var(--logo-size);
    object-fit: contain;
}

.main-menu ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 25px;
}

.main-menu a {
    text-decoration: none;
    color: var(--dark-text);
    font-weight: 600;
    padding: 5px 0;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
}

.main-menu a:hover, .main-menu li.active a {
    color: var(--primary-blue);
    border-bottom-color: var(--primary-blue);
}

.mobile-menu-toggle { display: none; }


/* 4. Hero Section
-------------------------------------------------- */
.hero {
    background: linear-gradient(135deg, rgba(0, 61, 107, 0.9), rgba(0, 90, 156, 0.9));
    color: var(--white-color);
    padding: 100px 0;
    text-align: center;
}

.hero-content h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 20px;
}

.hero-content p {
    font-size: 1.25rem;
    max-width: 800px;
    margin: 0 auto 30px;
    opacity: 0.9;
}

.hero-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}


/* 5. General Page Sections
-------------------------------------------------- */
.section {
    padding: 80px 0;
}

.section-gray {
    background-color: var(--light-gray);
}

.section-title {
    text-align: center;
    margin-bottom: 60px;
}

.section-title h2 {
    font-size: 2.5rem;
    margin-bottom: 15px;
    color: var(--dark-blue);
}

.section-title p {
    font-size: 1.1rem;
    color: var(--secondary-gray);
    max-width: 700px;
    margin: 0 auto;
}


/* 6. Component-Specific Styles
-------------------------------------------------- */

/* --- Buttons --- */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: var(--border-radius-md);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px solid transparent;
}
.btn-primary {
    background-color: var(--accent-orange);
    color: var(--white-color);
    border-color: var(--accent-orange);
}
.btn-primary:hover {
    background-color: #E69500;
    border-color: #E69500;
    transform: translateY(-2px);
}
.btn-secondary {
    background-color: var(--white-color);
    color: var(--primary-blue);
    border-color: var(--primary-blue);
}
.btn-secondary:hover {
    background-color: var(--primary-blue);
    color: var(--white-color);
    transform: translateY(-2px);
}
.btn-lg {
    padding: 15px 30px;
    font-size: 1.1rem;
}

/* --- Cards (Service & Equipment) --- */
.service-card {
    background-color: var(--white-color);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    padding: 30px;
    text-align: center;
    border: 1px solid var(--border-color);
}
.service-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-md);
}
.service-icon img {
    width: 60px;
    height: 60px;
    margin-bottom: 20px;
}
.service-card h3 {
    font-size: 1.5rem;
    color: var(--dark-blue);
    margin-bottom: 15px;
}
.service-card ul {
    list-style: none;
    padding: 0;
    margin-top: 20px;
}
html[dir="rtl"] .service-card ul { text-align: right; }
html[dir="ltr"] .service-card ul { text-align: left; }
.service-card ul li {
    margin-bottom: 10px;
    position: relative;
    padding-right: 25px;
}
html[dir="ltr"] .service-card ul li { padding-left: 25px; padding-right: 0; }
.service-card ul li::before {
    content: '✓';
    color: var(--primary-blue);
    position: absolute;
    right: 0;
}
html[dir="ltr"] .service-card ul li::before { left: 0; right: auto; }


/* 7. Page-Specific Styles
-------------------------------------------------- */

/* --- Home Page --- */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
}

/* --- Web Design Page --- */
.portfolio-horizontal-scroll,
.process-horizontal-scroll {
    overflow-x: auto;
    padding-bottom: 20px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}
.portfolio-horizontal-scroll::-webkit-scrollbar,
.process-horizontal-scroll::-webkit-scrollbar {
    height: 8px;
}
.portfolio-horizontal-scroll::-webkit-scrollbar-track,
.process-horizontal-scroll::-webkit-scrollbar-track {
    background: var(--light-gray);
}
.portfolio-horizontal-scroll::-webkit-scrollbar-thumb,
.process-horizontal-scroll::-webkit-scrollbar-thumb {
    background: var(--primary-blue);
    border-radius: 4px;
}

.portfolio-grid-scrolling {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(320px, 350px);
    gap: 30px;
}
.portfolio-item-scrolling {
    height: 400px;
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    position: relative;
    box-shadow: var(--shadow-md);
    cursor: pointer;
    background-size: cover;
    background-position: center;
    transition: transform 0.3s ease;
    color: white;
    animation: scroll-vertical 15s ease-in-out infinite alternate;
}
@keyframes scroll-vertical {
    from { background-position-y: 0%; }
    to   { background-position-y: 100%; }
}
.portfolio-item-scrolling:hover {
    transform: scale(1.03);
    animation-play-state: paused;
}
.portfolio-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0) 100%);
    padding: 40px 20px 20px;
}
.portfolio-overlay h3 { margin: 0; font-size: 1.5rem; }

.website-types-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}
.website-type-item {
    background: var(--light-gray);
    padding: 25px;
    text-align: center;
    border-radius: var(--border-radius-lg);
    border: 2px solid var(--border-color);
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 80px;
    font-size: 1.1rem;
}
.website-type-item:hover {
    background: var(--primary-blue);
    color: var(--white-color);
    border-color: var(--primary-blue);
    transform: translateY(-5px) scale(1.02);
    box-shadow: var(--shadow-md);
}

.process-steps-horizontal {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(220px, 1fr);
    gap: 25px;
    text-align: center;
}
.process-step .step-icon img { width: 50px; height: 50px; margin-bottom: 15px; }
.process-step h4 { font-size: 1.1rem; }
.process-step p { font-size: 0.95rem; }

.faq-container { max-width: 800px; margin: 0 auto; }
.faq-item { border-bottom: 1px solid var(--border-color); }
.faq-question {
    width: 100%;
    background: none;
    border: none;
    padding: 20px 0;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
html[dir="rtl"] .faq-question { text-align: right; }
html[dir="ltr"] .faq-question { text-align: left; }
.faq-icon { font-size: 1.5rem; color: var(--primary-blue); }
.faq-answer { max-height: 0; overflow: hidden; transition: max-height 0.3s ease-out; }
.faq-answer p { padding: 0 0 20px; margin: 0; }

/* --- About Page --- */
.service-focus-area { display: flex; align-items: flex-start; gap: 30px; }
.service-focus-icon { flex-shrink: 0; }
.service-focus-icon img { width: 80px; height: 80px; }
.service-focus-details h2 { font-size: 1.8rem; margin-top: 0; margin-bottom: 15px; color: var(--dark-blue); }
.service-focus-details p { line-height: 1.9; }
.equipment-list-about { list-style: none; padding: 0; margin-top: 20px; }
.equipment-list-about li { margin-bottom: 12px; font-weight: 500; position: relative; }
html[dir="rtl"] .equipment-list-about li { padding-right: 25px; }
html[dir="ltr"] .equipment-list-about li { padding-left: 25px; }
.equipment-list-about li::before {
    content: '✓';
    color: var(--primary-blue);
    position: absolute;
}
html[dir="rtl"] .equipment-list-about li::before { right: 0; }
html[dir="ltr"] .equipment-list-about li::before { left: 0; }

/* IMPROVEMENT: Removed text-align from here, will be handled globally */
.content-section .about-intro-text {
    font-size: 1.1rem;
}

/* --- Lab Equipment Page --- */
.equipment-cards-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    margin-top: 40px;
}
.equipment-card {
    background-color: var(--white-color);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    overflow: hidden;
    flex: 1 1 300px;
    display: flex;
    flex-direction: column;
}
.equipment-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-md);
}
.equipment-card img {
    width: 100%;
    height: 250px;
    object-fit: contain;
}
.equipment-card .card-content {
    padding: 25px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}
.equipment-card .card-content h4 {
    margin-top: 0;
    color: var(--dark-blue);
    font-size: 1.25rem;
}
.equipment-card .card-content p {
    flex-grow: 1;
}

/* IMPROVEMENT: Removed text-align from here, will be handled globally */
[data-translate="hero_desc_medical"] {
    margin-right: auto;
    margin-left: auto;
}

/* --- Contact Page --- */
.contact-and-map-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 40px;
    align-items: flex-start;
}

.contact-details h2 {
    font-size: 2rem;
    color: var(--dark-blue);
    margin-bottom: 10px;
}
.contact-subtitle {
    font-size: 1.1rem;
    color: var(--secondary-gray);
    margin-bottom: 30px;
}
.contact-info-item {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 20px;
}
.contact-info-item .icon {
    font-size: 1.5rem;
    color: var(--primary-blue);
    margin-top: -5px;
}
.contact-info-item strong { display: block; margin-bottom: 3px; }
.contact-info-item a { color: var(--primary-blue); text-decoration: none; }
.contact-info-item a:hover { text-decoration: underline; }

.map-container {
    width: 100%;
    height: 500px;
    position: relative;
}
.map-container iframe {
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-md);
    width: 100%;
    height: 100%;
}


/* 8. Footer
-------------------------------------------------- */
footer {
    background-color: var(--footer-bg);
    color: var(--footer-text);
    padding: 60px 0 20px;
}
.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}
.footer-column h3 {
    color: var(--white-color);
    margin-bottom: 20px;
    font-size: 1.2rem;
}
.footer-links, .footer-contact {
    list-style: none;
    padding: 0;
}
.footer-links li, .footer-contact li {
    margin-bottom: 12px;
}
.footer-links a, .footer-contact a {
    color: var(--footer-text);
    text-decoration: none;
    transition: color 0.3s ease;
}
.footer-links a:hover, .footer-contact a:hover {
    color: var(--white-color);
}
.copyright {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #495057;
}


/* 9. Responsive Design & Bilingual Fixes
-------------------------------------------------- */
@media (max-width: 992px) {
    .website-types-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    :root {
        --logo-size: 50px;
    }

    .section { padding: 60px 0; }
    .hero { padding: 80px 0; }
    .hero-content h1 { font-size: 2.2rem; }

    .main-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background-color: var(--white-color);
        box-shadow: var(--shadow-md);
        flex-direction: column;
        padding: 20px;
        text-align: center;
    }
    .main-menu.show { display: flex; }
    .main-menu ul { flex-direction: column; gap: 15px; }
    .mobile-menu-toggle {
        display: block;
        background: none;
        border: none;
        font-size: 2rem;
        cursor: pointer;
        color: var(--dark-blue);
    }
    
    .service-focus-area {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
}

@media (max-width: 576px) {
    .website-types-grid {
        grid-template-columns: 1fr;
    }
}

/* --- Bilingual Text Alignment Fixes --- */
/* These rules handle text alignment for elements that need to change
   direction based on the selected language (fa/en). */

/* For English (LTR) language */
body.lang-en .hero-home .hero-content p,
body.lang-en .service-card p,
body.lang-en .process-step p,
body.lang-en .content-section .about-intro-text,
body.lang-en [data-translate="hero_desc_medical"] {
    text-align: left;
}

/* For Persian (RTL) language */
body.lang-fa .hero-home .hero-content p,
body.lang-fa .service-card p,
body.lang-fa .process-step p,
body.lang-fa .content-section .about-intro-text,
body.lang-fa [data-translate="hero_desc_medical"] {
    text-align: right;
}
/* ============================================= */
/* ===         Logo Size Correction          === */
/* ============================================= */

/*
 * این قانون اندازه لوگوی سفارشی وردپرس را کنترل می‌کند
 * و مطمئن می‌شود که از اندازه تعریف شده در متغیر --logo-size تجاوز نکند.
*/
.custom-logo-link img.custom-logo {
    width: var(--logo-size) !important;
    height: auto !important; /* ارتفاع به صورت خودکار تنظیم می‌شود تا نسبت تصویر حفظ شود */
    max-width: 100%;
}
/* ============================================= */
/* ===     Header Layout Correction (RTL)      === */
/* ============================================= */

/*
 * این کد چیدمان هدر را برای سایت‌های راست-به-چپ (RTL) اصلاح می‌کند
 * و تضمین می‌کند که لوگو در سمت راست و منو در سمت چپ قرار گیرد.
*/

/* 1. اطمینان از اینکه والد اصلی یک کانتینر Flexbox است */
.main-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* 2. تعیین ترتیب نمایش برای زبان فارسی (RTL) */
html[dir="rtl"] .main-header-content .logo {
    order: 1; /* لوگو اولین آیتم است (در RTL یعنی سمت راست) */
}

html[dir="rtl"] .main-header-content .header-right-side {
    order: 2; /* منو دومین آیتم است (در RTL یعنی سمت چپ) */
}

/* 3. تعیین ترتیب نمایش برای زبان انگلیسی (LTR) - برای آینده */
html[dir="ltr"] .main-header-content .logo {
    order: 1; /* در LTR، لوگو اولین آیتم است (یعنی سمت چپ) */
}

html[dir="ltr"] .main-header-content .header-right-side {
    order: 2; /* در LTR، منو دومین آیتم است (یعنی سمت راست) */
}