/* Define your custom font */
@font-face {
    font-family: 'VazirMedium';
    src: url('../font/Vazir-Medium-FD-WOL.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
}

/* تعریف متغیرهای رنگی برای تم روشن و تاریک */
:root {
    --bg-color: #121212;
    --card-bg: #1e1e1e;
    --text-main: #f5f5f5;
    --text-muted: #aaaaaa;
    --border-color: #333333;
    --primary-color: #00a8ff;
    --primary-hover: #008ecc;
    --btn-outline-bg: #1e1e1e;
    --header-bg: #181818;
}

/* رنگ‌های تم تاریک */
[data-theme="light"] {
    --bg-color: #f9fbfd;
    --card-bg: #ffffff;
    --text-main: #222222;
    --text-muted: #777777;
    --border-color: #eaeaea;
    --primary-color: #00a8ff;
    --primary-hover: #008ecc;
    --btn-outline-bg: #ffffff;
    --header-bg: #ffffff;
}

/* تنظیمات پایه */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'VazirMedium', Tahoma, Arial, sans-serif;
    direction: ltr;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    transition: background-color 0.3s ease, color 0.3s ease;
    padding: 5px 10px;
}

/* --- استایل هدر --- */
.header {
    background-color: var(--header-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 0 5%;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid var(--border-color);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.trust-badges {
    display: flex;
    gap: 5px;
}

.badge {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    background-color: var(--border-color);
}

.badge.green { color: #00c853; background-color: #e8f5e9; }

.header-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
}
/* استایل برای آیکون‌های روبیکا و بله */
.badge-icon {
    width: 30px;
    height: 30px;
    object-fit: contain;
}

/* استایل عکس داخل دکمه‌های تغییر نما */
.icon-btn img {
    width: 24px;
    height: 24px;
    display: block;
    transition: all 0.3s;
}

/* برای اینکه در حالت دارک مود، اگر آیکون‌ها مشکی هستند دیده شوند
   (اگر آیکون‌ها PNG مشکی هستند، با این فیلتر در دارک مود سفید می‌شوند) */
[data-theme="dark"] .icon-btn img,
[data-theme="dark"] #theme-toggle {
    filter: invert(1);
}

.nav-links {
    display: flex;
    gap: 20px;
}

.nav-link {
    text-decoration: none;
    color: var(--text-muted);
    font-weight: bold;
    padding-bottom: 10px;
    border-bottom: 2px solid transparent;
    transition: all 0.3s;
    text-align: right;
}

.nav-link.active {
    color: var(--text-main);
    border-bottom-color: var(--text-main);
}

.view-toggles {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* تنظیمات پایه دکمه‌های آیکون‌دار بدون پس‌زمینه */
.icon-btn {
    font-size: 2em;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 5px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.2s; /* یک افکت نرم برای کلیک/هاور */
}

/* حذف رنگ پس‌زمینه در زمان هاور یا انتخاب شدن */
.icon-btn.active, .icon-btn:hover {
    background: transparent;
    /* در صورت تمایل می‌توانید افکت بزرگ‌نمایی ملایمی به جای بک‌گراند داشته باشید */
    /* transform: scale(1.1); */
}

.divider {
    width: 1px;
    height: 20px;
    background-color: var(--border-color);
    margin: 0 5px;
}

/* --- استایل محتوای اصلی --- */
.main-content {
    padding: 40px 5%;
}

.section-title {
    text-align: center;
    font-size: 24px;
    margin-bottom: 40px;
}

/* --- گرید کارت‌ها --- */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

/* تغییر ساختار در نمای موبایل (شبیه‌ساز) */
.portfolio-grid.mobile-view .card-img-wrapper {
    width: 40%;
    margin: 0 auto;
    border-radius: 20px; /* ایجاد ظاهر شبیه به گوشی */
    border: 4px solid var(--border-color);
}

/* --- استایل کارت نمونه کار --- */
.portfolio-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.02);
    transition: transform 0.3s, box-shadow 0.3s;
}

.portfolio-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.06);
}

/* با این کلاس، عکس داخل کادر قابلیت اسکرول پیدا می‌کند */
.card-img-wrapper {/* ارتفاع ثابت برای ایجاد اسکرول */
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    margin-bottom: 20px;
    transition: all 0.4s ease;
}

/* استایل اسکرول‌بار سفارشی و زیبا */
.card-img-wrapper::-webkit-scrollbar {
    width: 6px;
}
.card-img-wrapper::-webkit-scrollbar-track {
    background: transparent;
}
.card-img-wrapper::-webkit-scrollbar-thumb {
    background-color: #cccccc;
    border-radius: 10px;
}

.portfolio-img {
    width: 100%;
    display: block;
    height: auto;
}

/* --- بخش متون و دکمه‌های کارت --- */
.card-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-family: inherit;
    font-weight: bold;
    flex: 1;
    transition: background 0.3s;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

.btn-outline {
    background-color: var(--btn-outline-bg);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    padding: 10px 15px;
    border-radius: 25px;
    cursor: pointer;
    font-family: inherit;
    flex: 1;
    transition: background 0.3s;
}

.btn-outline:hover {
    background-color: var(--border-color);
}

.btn-icon {
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--primary-color);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 18px;
    transition: background 0.3s;
}

.btn-icon:hover {
    background-color: var(--border-color);
}

.card-text {
    text-align: right;
}

.card-text h3 {
    font-size: 16px;
    margin-bottom: 5px;
    color: var(--text-main);
}

.card-text p {
    font-size: 13px;
    color: var(--text-muted);
}

/* --- ریسپانسیو (واکنش‌گرا برای گوشی  کاربران) --- */
@media screen and (max-width: 1024px) {
    .portfolio-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media screen and (max-width: 768px) {
    .header-top, .header-bottom {
        flex-direction: column;
        gap: 15px;
    }
    .portfolio-grid {
        grid-template-columns: 1fr;
    }
    .portfolio-grid.mobile-view .card-img-wrapper {
        width: 70%; /* در گوشی پهنای کامل میگیرد */
    }
}


/* =========================================
   استایل‌های مربوط به صفحه اپلیکیشن مدیریت سایت
   ========================================= */

.app-presentation {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 50px;
    margin-top: 40px;
    min-height: 600px;
}

/* --- کانتینرهای اصلی بخش متن --- */
.app-text-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start; /* در حالت rtl این یعنی چسبیدن کامل به راست */
    width: 100%;
}

.app-tabs {
    display: flex;
    flex-direction: column;
    align-items: flex-end; /* کلیدها را به راست هل می‌دهد */
    width: 100%;
    gap: 0; /* فاصله اضافی را حذف می‌کنیم تا با margin کنترل شود */
}

/* --- تنظیمات مربوط به دکمه ها و توضیحات (طرح آکاردئونی) --- */
.tab-wrapper {
    display: flex;
    flex-direction: column;
    align-items: flex-end; /* محتوای هر تب دقیقاً به راست بچسبد */
    margin-bottom: 20px;
    width: 100%;
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--primary-color);
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    padding: 8px 25px;
    border-radius: 25px;
    transition: all 0.3s ease;
    text-align: right; /* اجبار به راست‌چین شدن متن کلید */
    font-family: inherit;
}

.tab-btn.active {
    background-color: var(--primary-color);
    color: white;
}

.tab-desc {
    display: none;
    font-size: 16px;
    line-height: 2.2;
    color: var(--text-main);
    text-align: right; /* راست‌چین کردن دقیق متن به جای justify */
    max-width: 90%; /* کمی فاصله از چپ می‌گیرد تا به عکس گوشی نچسبد */
    margin-top: 15px;
    padding-right: 25px; /* کمی تورفتگی نسبت به دکمه برای زیبایی بیشتر */
    animation: slideDown 0.4s ease-out forwards;
}

.tab-desc.active {
    display: block;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- بزرگ کردن تصویر گوشی --- */
.app-screen-img {
    max-width: 380px; /* قبلا 280 بود، الان بزرگتر شد */
    width: 100%;
    height: auto;
    display: block;
    border-radius: 40px; /* اگر نیاز بود گوشه ها گرد شود */
}

/* در صورت نیاز به تنظیم لوگوی پس زمینه گوشی */
.app-bg-shape {
    position: absolute;
    width: 750px; /* متناسب با سایز جدید گوشی */
    height: auto;
    z-index: -1;
    top: 50%;
    left: 65%;
    transform: translate(-50%, -50%);
}



/* تنظیمات بخش تصویری (چپ) */
.app-visual-section {
    flex: 1;
    display: flex;
    justify-content: center;
    position: relative;
}

[data-theme="dark"] .app-bg-shape {
}

.app-phone-container {
    filter: drop-shadow(0 20px 30px rgba(0,0,0,0.1));
    justify-content: end;
}

/* کلاس برای انیمیشن تغییر عکس */
.fade-transition {
    transition: opacity 0.4s ease-in-out;
}

.fade-out {
    opacity: 0;
}

/* --- ریسپانسیو برای صفحه اپلیکیشن (موبایل) --- */
@media screen and (max-width: 768px) {
    .app-presentation {
        flex-direction: column; /* متن‌ها بالا، تصویر پایین */
        text-align: center;
    }

    .app-text-section {
        align-items: center;
    }

    .tab-btn {
        text-align: center;
    }

    .app-description {
        text-align: center;
    }

    .app-bg-shape {
        width: 300px;
        height: 300px;
    }
}



/* =========================================
   استایل‌های مربوط به مودال‌ها و فرم مشاوره
   ========================================= */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw; /* پوشش کل عرض مرورگر */
    height: 100vh; /* پوشش کل ارتفاع مرورگر */
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    z-index: 9999;
    display: none; /* در حالت عادی پنهان است */
    justify-content: center; /* وسط‌چین افقی */
    align-items: center; /* وسط‌چین عمودی */
    direction: rtl;
}

/* نکته مهم: وقتی مودال باز می‌شود باید flex باشد تا وسط‌چین کار کند */
.modal-overlay.show {
    display: flex;
    opacity: 1;
    animation: fadeIn 0.3s ease-in-out forwards;
}

.modal-box *{

    direction: rtl;
}


.modal-overlay.show .modal-box {
    transform: translateY(0);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.close-modal {
    position: absolute;
    top: 20px; left: 20px;
    background: transparent;
    border: none;
    font-size: 28px;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.3s;
}

.close-modal:hover { color: #ff4757; }

.modal-title { font-size: 22px; color: var(--primary-color); margin-bottom: 5px; text-align: start;}
.modal-subtitle { font-size: 14px; color: var(--text-muted); margin-bottom: 25px; text-align: start;}
#c_name { text-align: end;}

.form-group-row {
    display: flex; gap: 15px; margin-bottom: 15px;
    align-items: flex-end; /* راست چین کزدن */
}
.form-group label { font-size: 14px; margin-bottom: 8px; font-weight: bold; color: var(--text-main);}
.required { color: #ff4757; }

.form-group input[type="text"], .form-group input[type="tel"] {
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--bg-color);
    color: var(--text-main);
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: border 0.3s;
}
.form-group input:focus { border-color: var(--primary-color); }

.section-label { font-size: 15px !important; color: var(--primary-color) !important; border-bottom: 1px dashed var(--border-color); padding-bottom: 5px; margin-top: 10px;}

/* استایل چک‌باکس‌های اختصاصی */
.checkbox-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 10px;
}

.custom-checkbox, .custom-radio {
    display: flex;
    align-items: flex-end; /* راست چین کزدن */
    gap: 10px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-main);
    user-select: none;
}

.custom-checkbox input, .custom-radio input { display: none; }

.checkmark {
    width: 20px; height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    display: flex; justify-content: center;
    align-items: flex-end; /* راست چین کزدن */
    transition: all 0.2s;
    background: var(--bg-color);
}

.custom-checkbox input:checked + .checkmark {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}
.custom-checkbox input:checked + .checkmark::after {
    content: '✔'; color: white; font-size: 12px;
}

/* استایل رادیو باتن اختصاصی */
.radio-group { display: flex; flex-wrap: wrap; gap: 15px; margin-top: 10px; }
.radio-mark {
    width: 18px; height: 18px;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    display: flex; justify-content: center; align-items: center;
    transition: all 0.2s;
    background: var(--bg-color);
}
.custom-radio input:checked + .radio-mark { border-color: var(--primary-color); }
.custom-radio input:checked + .radio-mark::after {
    content: ''; width: 10px; height: 10px;
    background: var(--primary-color); border-radius: 50%;
}


/* =========================================
   استایل‌های مربوط به مودال‌ها و فرم مشاوره
   ========================================= */

.modal-box {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 20px;
    width: 90%;
    max-width: 400px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    border: 1px solid var(--border-color);
    text-align: center;
    direction: rtl;
    margin: auto; /* اطمینان مضاعف برای وسط ماندن باکس */
}

.form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 20px;
    align-items: center; /* وسط‌چین کردن عناصر داخل فرم */
    width: 100%;
}

.form-group label {
    text-align: center;
    width: 100%;
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: bold;
    color: var(--text-main);
}

.form-group input[type="text"], .form-group input[type="tel"] {
    width: 100%;
    max-width: 280px; /* محدود کردن عرض اینپوت برای زیبایی بیشتر در حالت وسط‌چین */
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--bg-color);
    color: var(--text-main);
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: border 0.3s;
    text-align: center; /* وسط‌چین کردن متن تایپ شده */
    direction: ltr;
}

.form-group input[type="tel"] {
    direction: ltr; /* برای تایپ صحیح اعداد انگلیسی و موبایل */
}

.form-group input:focus {
    border-color: var(--primary-color);
}

.btn-submit {
    max-width: 280px;
    margin: 10px auto 0 auto;
    display: block;
}
.btn-submit {
    background-color: var(--primary-color);
    color: white; border: none;
    padding: 15px; width: 100%;
    border-radius: 12px; font-size: 16px; font-weight: bold;
    cursor: pointer; margin-top: 20px; transition: 0.3s; font-family: inherit;
}
.btn-submit:hover { background-color: var(--primary-hover); }


@media screen and (max-width: 768px) {
    .form-group-row { flex-direction: column; gap: 0; }
    .checkbox-grid { grid-template-columns: 1fr; }
}


/* =========================================
   استایل‌های مربوط Footer
   ========================================= */
.footer { padding: 40px 0; background: var(--header-bg); border-top: 1px solid var(--border-color); margin-top: 50px; }
.logo-carousel-section { padding: 20px 5%; overflow: hidden; }
.logo-carousel-section h3 { text-align: center; margin: 30px 0; color: var(--text-muted); }

/* کانتینر اصلی */
.carousel-wrapper {
    overflow: hidden;
    width: 100%;
    position: relative;
    display: flex;
}

/* کانتینر داخلی که لوگوها را نگه می‌دارد */
.carousel-container {
    display: flex;
    white-space: nowrap;
    /* انیمیشن را اینجا تعریف می‌کنیم */
    animation: scrollAnimation linear infinite;
}

/* هر لوگو */
.logo-item {
    flex-shrink: 0; /* جلوگیری از تغییر سایز لوگو */
    margin: 0 30px; /* فاصله دقیق بین لوگوها بدون ایجاد فضای خالی اضافه */
    display: flex;
    align-items: center;
}

.logo-item img {
    height: 60px;
    object-fit: contain;
    filter: grayscale(1);
    transition: 0.3s;
}

.logo-item img:hover { filter: grayscale(0); }

@keyframes scrollAnimation {
    0% { transform: translateX(0%); }
    100% { transform: translateX(-50%); } /* چون لیست را دوبرابر می‌کنیم، 50% کافیست */
}
.footer-bottom { text-align: center; padding: 20px; font-size: 13px; color: var(--text-muted); }

/* =========================================
   استایل‌های ویجت شماره تماس هدر
   ========================================= */

.contact-widget {
    position: relative;
    display: flex;
    align-items: center;
    direction: rtl;
}

.primary-contact {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-color);
    padding: 8px 15px;
    border-radius: 25px;
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.3s ease;
}

.primary-contact:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.phone-icon {
    font-size: 16px;
    margin-left: -5px;
}

.phone-number {
    font-weight: bold;
    color: var(--text-main);
    font-size: 15px;
    letter-spacing: 1px;
}

.social-links {
    display: flex;
    align-items: center;
    gap: 8px;
    border-right: 1px solid var(--border-color);
    padding-right: 10px;
}

.social-links a {
    display: flex;
    align-items: center;
    transition: transform 0.2s;
}

.social-links a:hover {
    transform: scale(1.15);
}

.dropdown-arrow {
    font-size: 10px;
    color: var(--text-muted);
    transition: transform 0.3s ease;
    margin-right: 5px;
}

/* انیمیشن چرخش فلش هنگام باز شدن */
.contact-widget.open .dropdown-arrow {
    transform: rotate(180deg);
}

/* استایل لیست شماره‌های مخفی */
.secondary-contacts {
    position: absolute;
    top: 120%;
    right: 0;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 160px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 100;
}

/* نمایش لیست هنگام اضافه شدن کلاس open */
.contact-widget.open .secondary-contacts {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.secondary-contacts a {
    text-decoration: none;
    color: var(--text-main);
    font-weight: bold;
    font-size: 14px;
    text-align: right; /* برای چپ‌چین شدن شماره‌ها در حالت RTL */
    padding: 10px;
    border-radius: 8px;
    transition: 0.2s;
    letter-spacing: 1px;
}

.secondary-contacts a:hover {
    background: var(--bg-color);
    color: var(--primary-color);
}

/* ریسپانسیو برای گوشی‌های موبایل */
@media screen and (max-width: 768px) {
    .header-right {
        flex-direction: column;
        width: 100%;
        gap: 15px;
    }
    .secondary-contacts {
        right: 50%;
        transform: translateX(50%) translateY(-10px);
    }
    .contact-widget.open .secondary-contacts {
        transform: translateX(50%) translateY(0);
    }
}

a{text-decoration: none;}

/* =========================================
   استایل‌های بخش شماره تماس در فوتر
   ========================================= */

.footer-contacts {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 30px;
    padding: 20px 5%;
    margin-bottom: 20px;
    border-top: 1px dashed var(--border-color); /* یک خط جداکننده ملایم در بالای شماره‌ها */
    padding-top: 30px;
    direction: rtl;
}

.footer-phone {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-color);
    padding: 10px 20px;
    border-radius: 15px;
    border: 1px solid var(--border-color);
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.footer-phone:hover {
    transform: translateY(-5px); /* افکت هاور با حرکت ملایم به سمت بالا */
    border-color: var(--primary-color);
    box-shadow: 0 5px 15px rgba(0,0,0,0.03);
}

.footer-phone span {
    color: var(--text-muted);
    font-size: 13px;
    font-weight: bold;
    direction: rtl;
}

.footer-phone a {
    color: var(--text-main);
    font-weight: bold;
    text-decoration: none;
    font-size: 15px;
    letter-spacing: 1px;
    transition: color 0.3s;
}

.footer-phone:hover a {
    color: var(--primary-color);
}

/* ریسپانسیو برای حالت موبایل */
@media screen and (max-width: 768px) {
    .footer-contacts {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }

    .footer-phone {
        width: 100%;
        max-width: 300px;
        justify-content: space-between; /* پخش کردن متن و شماره در دو سمت کادر */
    }
}