:root {
    --primary: #1A73E8;
    --bg: #FFFFFF;
    --text: #202124;
    --text-light: #5F6368;
    --border: #DADCE0;
}
/* اعمال فونت وزیرمتین به تمام input و textarea */
input[type="text"],
input[type="search"],
input[type="tel"],
input[type="url"],
input[type="email"],
input[type="password"],button,
textarea {
    font-family: 'Vazirmatn', sans-serif !important;
}
* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
}

body {
    font-family: 'Vazirmatn', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    padding-top: 70px;         /* فضای زیر هدر ثابت در موبایل */
    padding-bottom: 70px;      /* برای باتم نویگیشن موبایل */
}

header {
    background: white;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    border-bottom: 1px solid var(--border);
}

.top-bar {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    gap: 12px;
    justify-content: flex-end;
    max-width: 1200px;
    margin: 0 auto;
    position: relative; /* برای موقعیت‌دهی دقیق جستجو در دسکتاپ */
}

.search-box {
    flex: 1;
    background: #f1f3f4;
    border-radius: 5px;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
    z-index: 10002;
}

.search-box input {
    border: none;
    outline: none;
    background: none;
    width: 100%;
    font-size: 15px;
}

/* اسلایدر بنرها - حالت موبایل (scroll-snap) */
.slider-container { 
    padding: 16px 0 0; 
}
.slider {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    gap: 12px;
    padding: 0 16px;
}
.slider::-webkit-scrollbar { 
    display: none; 
}

.banner-card {
    min-width: calc(90% - 12px);
    max-width: calc(90% - 12px);
    border-radius: 18px;
    overflow: hidden;
   
    scroll-snap-align: center;
    flex-shrink: 0;
}
.banner-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.section-title {
    padding: 20px 16px 8px;
    font-size: 20px;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.see-all {
    font-size: 14px;
    color: var(--primary);
    cursor: pointer;
}

.app-row {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding: 8px 16px 20px;
    scrollbar-width: none;
}
.app-row::-webkit-scrollbar { 
    display: none; 
}

.app-card {
    min-width: 110px;
    text-align: center;
    transition: all 0.2s;
    cursor: pointer;
}


.app-icon {
    width: 110px;
    height: 110px;
    object-fit: cover;
    border-radius: 24px;
}

.app-name {
    margin-top: 12px;
    font-weight: 500;
    font-size: 14px;
}

/* صفحات جزئیات و همه برنامه‌ها */
#all-apps,
#app-detail,
#news-detail {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: white;
    z-index: 2000;
    overflow-y: auto;
    display: none;
}

#all-apps.active,
#app-detail.active,
#news-detail.active {
    display: block;
}

/* لیست همه برنامه‌ها */
.app-list-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
}
.app-list-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    object-fit: cover;
}
.app-list-name {
    font-weight: 500;
    font-size: 16px;
}

/* جزئیات اپلیکیشن */
.detail-app-info {
    display: flex;
    gap: 20px;
    align-items: center;
}
.detail-icon {
    width: 100px;
    height: 100px;
    border-radius: 20px;
    object-fit: cover;
}
.detail-title h1 {
    font-size: 26px;
    margin-bottom: 6px;
}
.detail-title p {
    color: var(--text-light);
}
.detail-desc {
    line-height: 1.8;
    color: #444;
    margin-top: 30px;
}

.install-fixed {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 16px;
    background: white;
    border-top: 1px solid var(--border);
    text-align: center;
    z-index: 10;
}
.install-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 14px 0;
    width: 90%;
    max-width: 400px;
    border-radius: 5px;
    font-size: 17px;
    font-weight: 500;
    cursor: pointer;
}

/* شیت تماس */
.contact-backdrop {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(8px);
    display: none;
    z-index: 2999;
}
.contact-backdrop.active { 
    display: block; 
}

.contact-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-radius: 24px 24px 0 0;
    padding: 32px 20px;
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
    z-index: 3000;
}
.contact-sheet.active { 
    transform: translateY(0); 
}

/* صفحه پروفایل */
.profile-page {
    padding: 30px 20px;
}
.profile-option {
    background: #fff;
    padding: 18px;
    margin: 12px 0;
    border-radius: 10px;
    text-align: right;
    font-size: 16px;
    border:1px solid #d2d2d2;
    cursor: pointer;
}
.profile-option:last-child,
.profile-option.logout {
    background: #ffebee;
    color: #c62828;
}

/* اخبار */
.news-item {
    padding: 16px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
}
.news-title { 
    font-weight: 600; 
    font-size: 16px; 
}
.news-date { 
    font-size: 12px; 
    color: #999; 
    margin-top: 6px; 
}

/* باتم نویگیشن موبایل */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    display: flex;
    justify-content: space-around;
    padding: 10px 0;
    border-top: 1px solid var(--border);
    z-index: 1000;
}
.nav-item {
    text-align: center;
    color: var(--text-light);
    font-size: 11px;
    cursor: pointer;
    padding: 6px;
}
.nav-item i { 
    font-size: 26px; 
    display: block; 
    margin-bottom: 4px; 
}
.nav-item.active { 
    color: var(--primary); 
    font-weight: 600; 
}

/* صفحات اصلی */
.page { 
    display: none; 
}
.page.active { 
    display: block; 
}

/* منوی دسکتاپ در موبایل مخفی */
.desktop-nav {
    display: none;
}

/* هدر کامل در صفحات جزئیات فقط در دسکتاپ */
.detail-header-desktop {
    display: none;
    background: white;
    position: sticky;
    top: 0;
    z-index: 999;
    border-bottom: 1px solid var(--border);
}

/* دکمه برگشت شناور */
.detail-back-floating {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 3001;
    background: white;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    color: #555;
    border: none;
    cursor: pointer;
}

/* پایه برای Swiper در دسکتاپ */
.desktop-swiper {
    display: none;
}

/* زیرصفحات پروفایل */
.profile-subpage {
    display: none;
}
.profile-subpage.active {
    display: block;
}

/* ==================== حالت موبایل (≤ 767px) ==================== */
@media (max-width: 767px) {
    body.detail-page-active #mainHeader,
    body.profile-page-active #mainHeader {
        display: none !important;
    }

    body.detail-page-active .search-overlay,
    body.profile-page-active .search-overlay {
        top: 0 !important;
    }

    body.detail-page-active .detail-content,
    body.profile-page-active .detail-content {
        padding-top: 90px !important;
    }

    body.detail-page-active #all-apps h2,
    body.profile-page-active #all-apps h2 {
        padding-top: 80px !important;
    }

    /* مخفی کردن Swiper در موبایل */
    .desktop-swiper {
        display: none !important;
    }
}

/* ==================== حالت دسکتاپ (≥ 768px) ==================== */
@media (min-width: 768px) {
    body {
        padding-top: 70px;
        padding-bottom: 0;
    }

    .top-bar {
        justify-content: space-between;
        padding: 12px 20px;
    }

    .search-box {
        flex: 0 1 400px;
        max-width: 400px;
    }

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

    .desktop-nav .nav-item {
        font-size: 16px;
        font-weight: 500;
        color: var(--text-light);
        cursor: pointer;
        padding: 8px 16px;
        border-radius: 8px;
        transition: all 0.2s;
    }

    .desktop-nav .nav-item:hover {
        background: #f1f3f4;
        color: var(--primary);
    }

    .desktop-nav .nav-item.active {
        color: var(--primary);
        font-weight: 600;
        background: #e3f2fd;
    }

    .bottom-nav {
        display: none;
    }

    .detail-header-desktop {
        display: block;
    }

    .detail-back-floating {
        display: none !important;
    }

    /* مخفی کردن اسلایدر موبایل در دسکتاپ */
    #mainSlider {
        display: none !important;
    }

    /* اسلایدر دسکتاپ */
    .desktop-swiper {
        display: block !important;
        height: 560px;
        max-width: 1200px;
        margin: 20px auto;
        border-radius: 20px;
        overflow: hidden;
    }

    .desktop-swiper .swiper-slide {
        width: 100% !important;
        max-width: 100% !important;
        flex-shrink: 0;
    }

    .desktop-swiper .swiper-wrapper {
        align-items: center;
    }

    .desktop-swiper .banner-card {
        width: 100%;
        height: 100%;
    }

    .desktop-swiper .banner-card img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .banner-card {
        min-width: unset !important;
        max-width: unset !important;
    }

    /* دکمه‌های ناوبری Swiper */
    .desktop-swiper .swiper-button-next,
    .desktop-swiper .swiper-button-prev {
        width: 48px;
        height: 48px;
        background: rgba(255, 255, 255, 0.95);
        border-radius: 50%;
        backdrop-filter: blur(12px);
        color: #333;
        margin: 0;
        top: auto !important;
        bottom: 60px;
        transform: none !important;
        transition: all 0.3s ease;
    }

    .desktop-swiper .swiper-button-next {
        right: 108px;
        left: auto;
    }

    .desktop-swiper .swiper-button-prev {
        right: 50px;
        left: auto;
    }

    .desktop-swiper .swiper-button-next:after,
    .desktop-swiper .swiper-button-prev:after {
        font-size: 20px;
        font-weight: bold;
    }

    .desktop-swiper .swiper-button-next:hover,
    .desktop-swiper .swiper-button-prev:hover {
        background: white;
        transform: scale(1.1);
    }

    /* وسط‌چین کردن محتوا */
    #home .section-title,
    .app-row,
    #category-sections {
        max-width: 1200px;
        margin-left: auto;
        margin-right: auto;
        padding-left: 20px;
        padding-right: 20px;
    }

    .app-row {
        flex-wrap: wrap;
        justify-content: flex-start;
    }

    .app-card {
        min-width: 140px;
    }

    .detail-content {
        padding-top: 20px !important;
    }

    #all-apps h2 {
        padding-top: 0 !important;
        margin: 20px 0;
    }

    /* مخفی کردن دکمه نصب و شیت تماس در دسکتاپ */
    .install-fixed,
    .contact-sheet,
    .contact-backdrop {
        display: none !important;
    }

    /* نمایش باکس تماس دسکتاپ */
    .desktop-contact-box {
        display: block;
        position: sticky;
        top: 100px;
        align-self: flex-start;
        max-height: calc(100vh - 120px);
        overflow-y: auto;
    }
}

/* استایل بخش نظرات */
.comments-section {
    margin-top: 60px;
    padding-top: 40px;
    border-top: 1px solid #ddd;
}

.comments-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 24px;
    color: #202124;
}

.comment-form {
    background: #f8f9fa;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 32px;
}

.comment-form textarea {
    width: 100%;
    border: 1px solid #dadce0;
    border-radius: 12px;
    padding: 16px;
    font-size: 15px;
    font-family: inherit;
    resize: vertical;
    min-height: 120px;
    outline: none;
}

.comment-form .form-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 12px;
}

.comment-form button {
    background: var(--primary);
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 5px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
}

.comments-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.comment-item {
    background: #f8f9fa;
    border-radius: 16px;
    padding: 20px;
    border: 1px solid #eee;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.comment-user {
    font-weight: 600;
    font-size: 16px;
}

.comment-date {
    font-size: 13px;
    color: #999;
}

.comment-text {
    line-height: 1.7;
    color: #444;
}

.no-comments {
    text-align: center;
    color: #999;
    padding: 60px 20px;
    font-size: 16px;
}
@media (max-width: 767px) {
    body.profile-page-active .bottom-nav {
        display: none !important;
    }
    
    body.profile-page-active .profile-mobile-header {
        display: block !important;
    }
}
/* مخفی کردن عنوان در دسکتاپ */
@media (min-width: 768px) {
    #all-apps .detail-content h2 {
        display: none !important;
    }
}

/* بهبود ظاهر عنوان در موبایل (اختیاری) */
@media (max-width: 767px) {
    #all-apps .detail-content h2 {
        font-size: 24px;
        padding-top: 80px !important;
        margin-bottom: 20px;
    }
}
