/* filename: style.css */

/* IMPORTANT: in your HTML head add:
   <meta name="viewport" content="width=device-width, initial-scale=1">
*/

/* فونت فارسی */
@import url('https://cdn.jsdelivr.net/gh/rastikerdar/vazirmatn@v33.003/Vazirmatn-font-face.css');

/* Reset و تنظیمات پایه */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Vazirmatn', sans-serif;
    background-color: #f9fafb;
    color: #1f2937;
    line-height: 1.6;
    direction: rtl;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background-color: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    gap: 16px;
    /* allow wrapping on small widths so items don't overflow */
    flex-wrap: nowrap;
}

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

.logo img {
    height: 60px;
    width: auto;
    border-radius: 8px;
    flex-shrink: 0;
}

.logo-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.logo-title {
    font-size: 18px;
    font-weight: 700;
    color: #1f2937;
    line-height: 1.2;
}

.logo-subtitle {
    font-size: 12px;
    color: #6b7280;
    line-height: 1.3;
}

.nav-desktop {
    display: flex;
    gap: 24px;
    align-items: center;
}

.nav-link {
    padding: 8px 16px;
    border-radius: 8px;
    text-decoration: none;
    color: #4b5563;
    font-weight: 500;
    transition: all 0.3s;
}

.nav-link:hover {
    background-color: #f3f4f6;
}

.nav-link.active {
    background-color: #003B73;
    color: white;
}

.btn-call {
    background-color: #FFA500;
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-call:hover {
    background-color: #FF8C00;
    transform: translateY(-2px);
}

.nav-mobile {
    display: none;
    gap: 6px;
    margin-top: 12px;
    padding-bottom: 8px;
    justify-content: flex-start;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.nav-mobile-link {
    padding: 6px 12px;
    border-radius: 8px;
    text-decoration: none;
    background-color: #f3f4f6;
    color: #4b5563;
    white-space: nowrap;
    font-weight: 500;
    font-size: 13px;
    transition: all 0.3s;
}

.nav-mobile-link.active {
    background-color: #003B73;
    color: white;
}

/* Hero Section */
.hero {
    position: relative;
    background: linear-gradient(135deg, #003B73 0%, #0051A3 50%, #003B73 100%);
    color: white;
    padding: 80px 0;
    overflow: hidden;
}

.hero-background {
    position: absolute;
    inset: 0;
    opacity: 0.1;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='1'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.hero-content {
    position: relative;
    z-index: 10;
    max-width: 800px;
    margin: 0 auto 48px;
    text-align: center;
    padding: 0 16px;
}

.hero-title {
    font-size: 48px;
    font-weight: 700;
    margin-bottom: 16px;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 24px;
    color: #e0f2fe;
    margin-bottom: 32px;
}

.hero-description {
    font-size: 18px;
    color: #bfdbfe;
}

/* Service cards */
.service-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    max-width: 1000px;
    margin: 0 auto;
    position: relative;
    z-index: 10;
}

.service-card {
    background-color: white;
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    transition: all 0.3s;
    cursor: pointer;
}

.service-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* icons/buttons styling unchanged */
.service-icon {
    width: 64px;
    height: 64px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    transition: all 0.3s;
}

.design-icon {
    background-color: #FFF3E0;
    color: #FF8C00;
}

.service-card:hover .design-icon {
    background-color: #FFA500;
    color: white;
}

.execution-icon {
    background-color: #E3F2FD;
    color: #003B73;
}

.service-card:hover .execution-icon {
    background-color: #003B73;
    color: white;
}

.service-title {
    font-size: 24px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 12px;
}

.service-description {
    color: #6b7280;
    margin-bottom: 24px;
    line-height: 1.7;
}

.service-btn {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s;
    text-decoration: none;
}

.design-btn {
    background-color: #003B73;
    color: white;
}

.design-btn:hover {
    background-color: #002a52;
    text-decoration: none;
}

.execution-btn {
    background-color: #FFA500;
    color: white;
}

.execution-btn:hover {
    background-color: #FF8C00;
    text-decoration: none;
}

/* Why Us Section */
.why-us {
    padding: 64px 0;
    background-color: white;
}

.section-title {
    font-size: 36px;
    font-weight: 700;
    text-align: center;
    color: #1f2937;
    margin-bottom: 16px;
}

.section-subtitle {
    font-size: 18px;
    text-align: center;
    color: #6b7280;
    margin-bottom: 48px;
    line-height: 1.8;
}

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 32px;
    max-width: 1000px;
    margin: 0 auto;
}

.feature {
    text-align: center;
}

.feature-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.blue-icon {
    background-color: #E3F2FD;
    color: #003B73;
}

.orange-icon {
    background-color: #FFF3E0;
    color: #FF8C00;
}

.feature-title {
    font-size: 20px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 8px;
}

.feature-description {
    color: #6b7280;
}

/* Projects Section */
.projects {
    padding: 64px 0;
    background-color: #f9fafb;
}

.projects-grid {
    display: flex;
    flex-wrap: nowrap;
    gap: 24px;
    overflow-x: auto;
    padding-bottom: 16px;
    scrollbar-width: thin;
    -ms-overflow-style: none;
    justify-content: center; /* اضافه کردن این خط برای وسط کردن کارت‌ها */
}

.projects-grid::-webkit-scrollbar {
    height: 8px;
}

.projects-grid::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.projects-grid::-webkit-scrollbar-thumb {
    background: #c0c0c0;
    border-radius: 10px;
}

.project-card {
    background-color: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s;
    flex: 0 0 calc(20% - 19.2px);
    max-width: calc(20% - 19.2px);
}

.project-card:hover {
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.15);
    transform: translateY(-4px);
}

.project-image {
    height: 220px;
    overflow: hidden;
    border-radius: 12px 12px 0 0;
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.project-card:hover .project-image img {
    transform: scale(1.08);
}

.project-content {
    padding: 20px;
}

.project-title {
    font-size: 18px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 8px;
    text-align: center;
}

.project-description {
    font-size: 14px;
    color: #6b7280;
}

/* CTA Section */
.cta {
    padding: 64px 0;
    background: linear-gradient(135deg, #003B73 0%, #0051A3 100%);
    color: white;
    text-align: center;
}

.cta-title {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 16px;
}

.cta-subtitle {
    font-size: 20px;
    color: #bfdbfe;
    margin-bottom: 32px;
}

.cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background-color: #FFA500;
    color: white;
    padding: 16px 32px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 18px;
    font-weight: 700;
    transition: all 0.3s;
}

.cta-btn:hover {
    background-color: #FF8C00;
    transform: translateY(-2px);
    text-decoration: none;
}

/* Footer - یکپارچه برای تمام صفحات */
.footer {
    background-color: #1f2937;
    color: white;
    padding: 48px 0 24px;
}

/* حفظ ساختار grid اصلی فوتر */
.footer-content {
    display: grid;
    grid-template-columns: 2fr 2fr;
    gap: 48px;
    margin-bottom: 32px;
}

/* مهم: اجازه بده ستون‌ها هنگام overflow رفتار عادی داشته باشند */
.footer-column {
    display: flex;
    flex-direction: column;
    min-width: 0; /* اضافه شد برای جلوگیری از پرتاب محتوا به خط بعد */
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.footer-logo img {
    height: 50px;
    width: auto;
    border-radius: 8px;
}

.footer-logo-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.footer-logo-title {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.2;
}

.footer-logo-subtitle {
    font-size: 11px;
    color: #9ca3af;
    line-height: 1.3;
}

.footer-description {
    font-size: 13px;
    color: #9ca3af;
    line-height: 1.8;
}

.footer-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 40px;
}

/* اصلی‌ترین قوانین برای لیست تماس فوتر */
.footer-contact {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap; /* پیش‌فرض: اجازه شکست برای موبایل / وسط‌های کوچک */
    gap: 20px;
    align-items: center;
}

/* هر آیتم تماس */
.footer-contact-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #9ca3af;
    font-size: 13px;
    line-height: 1.4;
}

/* آیکون‌ها */
.footer-contact-item svg {
    flex-shrink: 0;
}

/* متن داخل آیتم‌ها — برای جلوگیری از پاره شدن ردیف در دسکتاپ */
.footer-contact-item span,
.footer-contact-item > *:not(svg) {
    display: inline-block;
    max-width: 220px; /* اگر لازم بود کمتر یا بیشتر کن */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* جلوگیری از رنگ شدن لینک‌ها در فوتر (مرورگرها ممکنه آبی کنند) */
.footer a {
    color: inherit !important;
    text-decoration: none !important;
}

/* Footer bottom */
.footer-bottom {
    border-top: 1px solid #374151;
    padding-top: 24px;
    text-align: center;
    color: #9ca3af;
    font-size: 14px;
}

/* ===== رفتار دقیق: فقط در صفحه‌های بزرگ اصرار به یک ردیف داریم ===== */
@media (min-width: 769px) {
    .footer-contact {
        flex-wrap: nowrap; /* اصرار به یک ردیف در دسکتاپ */
        align-items: center;
    }
    .footer-contact-item span,
    .footer-contact-item > *:not(svg) {
        white-space: nowrap;
        max-width: 300px; /* کمی بازتر در دسکتاپ */
    }
}

/* -------------------- RESPONSIVE FIXES -------------------- */

/* تبلت: تا 1024px — (اصلاحات برای تبلت) */
@media (max-width: 1024px) {
    /* Header: نمایش ناوبری موبایل در تبلت و پنهان‌سازی ناوبری دسکتاپ */
    .nav-desktop { display: none; }
    .nav-mobile { display: flex; }

    /* بهتر است هدر اجازه شکست داشته باشد تا آیتم‌ها پایین نپرند */
    .header-content {
        padding: 12px 0;
        flex-wrap: wrap;
        align-items: center;
        justify-content: space-between;
    }

    /* در تبلت لوگوتکست را نمایش بدهیم اما با فونت کوچکتر */
    .logo img { height: 52px; }
    .logo-text { display: flex; }
    .logo-title { font-size: 16px; }
    .logo-subtitle { font-size: 11px; }

    /* Hero: کاهش فضای عمودی در تبلت */
    .hero { padding: 56px 0; }
    .hero-title { font-size: 36px; }
    .hero-subtitle { font-size: 18px; }
    .hero-description { font-size: 16px; }

    /* Service cards: دو ستون در تبلت برای بهتر دیده شدن */
    .service-cards {
        grid-template-columns: repeat(2, 1fr);
        max-width: 900px;
        gap: 20px;
    }
    .service-card { padding: 24px; }

    /* Projects: از wrapping استفاده کن تا کارت‌ها در تبلت نمایش مناسبی داشته باشند */
    .projects-grid {
        flex-wrap: wrap;
        overflow-x: visible;
        gap: 20px;
    }
    .project-card {
        flex: 0 0 calc(50% - 10px);
        max-width: calc(50% - 10px);
    }
    .project-image { height: 180px; }

    /* Footer: در تبلت دو ستون مساوی (بدون تغییر قواعد دسکتاپ) */
    .footer-content {
        grid-template-columns: 1fr 1fr;
        gap: 28px;
    }
}

/* موبایل: تا 768px — (اصلاحات موبایل) */
@media (max-width: 768px) {
    .nav-desktop { display: none; }
    .nav-mobile { display: flex; }
    .call-text { display: none; }

    .header-content { padding: 10px 0; flex-wrap: wrap; gap: 8px; }
    
    .logo img { height: 50px; }
    
    .logo-text { display: none; } /* تو خواسته بودی لوگوتکست دسکتاپ بمونه؛ موبایل مخفی می‌کنیم */

    .btn-call { padding: 8px 12px; font-size: 14px; }

    .hero-title { font-size: 32px; }
    .hero-subtitle { font-size: 18px; }
    .hero-description { font-size: 16px; }
    .hero { padding: 40px 0; }

    .section-title { font-size: 28px; }
    .cta-title { font-size: 26px; }
    .cta-subtitle { font-size: 16px; }

    .footer-content {
        gap: 24px;
        grid-template-columns: 1fr; /* ستون‌ها عمودی شوند در موبایل */
        margin-bottom: 24px;
    }
    
    .footer-logo {
        justify-content: center;
    }

    .footer-title {
        text-align: center;
    }

    /* موبایل: ستونی شدن آیتم‌های فوتر (رفتار قبلی حفظ شد) */
    .footer-contact {
        flex-direction: column;
        align-items: center;
        gap: 12px;
    }
    
    .footer-contact-item {
        font-size: 14px;
    }

    /* در موبایل متن کامل نمایش داده شود */
    .footer-contact-item span,
    .footer-contact-item > *:not(svg) {
        max-width: none;
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
    }

    /* Projects در موبایل نمایش کامل کارت افقی */
    .projects-grid {
        scroll-snap-type: x mandatory;
        padding-left: calc((100% - 80%) / 2); /* فاصله برابر از چپ (در RTL، سمت چپ صفحه) */
        padding-right: calc((100% - 80%) / 2); /* فاصله برابر از راست (در RTL، سمت راست صفحه) */
        direction: ltr; /* برای طبیعی کردن اسکرول و وسط کردن */
        justify-content: center; /* وسط کردن کارت‌ها */
        overflow-x: auto; /* اطمینان از اسکرول افقی */
    }

    .project-card {
        flex: 0 0 80%;
        max-width: 80%;
        scroll-snap-align: center; /* اسنپ به وسط */
    }
    
    .nav-mobile {
        gap: 10px; /* افزایش gap برای فاصله بهتر */
    }
    
    .nav-mobile-link {
        padding: 14px 24px; /* بزرگتر کردن padding در موبایل */
        font-size: 20px; /* افزایش اندازه فونت برای بزرگتر شدن متن */
        min-height: 52px; /* ارتفاع بیشتر */
    }

    /* Service cards: یک ستون در موبایل برای خوانایی */
    .service-cards {
        grid-template-columns: 1fr;
        max-width: 520px;
        gap: 16px;
    }
}

/* کوچک‌تر از 640px — ریزترها */
@media (max-width: 640px) {
    .projects-grid {
        padding-left: calc((100% - 88%) / 2);
        padding-right: calc((100% - 88%) / 2);
        direction: ltr; /* برای طبیعی کردن اسکرول و وسط کردن */
        justify-content: center; /* وسط کردن کارت‌ها */
    }

    .project-card {
        flex: 0 0 88%;
        max-width: 88%;
        scroll-snap-align: center;
    }
    
    .nav-mobile {
        gap: 10px;
    }
    
    .nav-mobile-link {
        padding: 12px 10px; /* بزرگتر از قبل */
        font-size: 14px; /* حداقل 18px برای موبایل کوچک */
        min-height: 50px;
    }

    .hero-title { font-size: 28px; }
    .hero-subtitle { font-size: 16px; }
    .hero { padding: 32px 0; }
}

/* حذف کامل خط زیر دکمه‌ها و لینک‌ها */
a, .form-submit, .service-btn, .cta-btn {
    text-decoration: none !important;
}

a:hover, .form-submit:hover, .service-btn:hover, .cta-btn:hover {
    text-decoration: none !important;
}