* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

html {
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

/* 🟢 اسنپ فقط زمانی فعال می‌شود که کلاس has-snap روی html باشد */
html.has-snap {
    scroll-snap-type: y mandatory;
}

::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

body {
    background-color: #000;
    color: #fff;
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    padding-bottom: 60px;
}

.profile-header {
    padding: 20px 16px 16px 16px;
    scroll-snap-align: start;
    scroll-snap-stop: always;
}

.feed-view {
    width: 100%;
    background-color: #000;
    position: relative;
}

.profile-main-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.profile-logo-options-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.avatar-container {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 2px solid #333;
    overflow: hidden;
    background: #111;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
    cursor: pointer;
}

.avatar-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-edit-overlay {
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.75);
    padding: 2px 8px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
    backdrop-filter: blur(2px);
}

.avatar-container:hover .avatar-edit-overlay {
    opacity: 1;
}

.avatar-edit-overlay svg {
    width: 14px;
    height: 14px;
    fill: #ffffff;
}

.profile-options-btn {
    display: none;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    backdrop-filter: blur(6px);
    font-size: 18px;
    font-weight: bold;
    transition: background 0.2s ease;
}

.profile-options-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.stats-container {
    display: flex;
    gap: 15px;
    text-align: center;
    flex-grow: 1;
    justify-content: space-evenly;
}

.stat-item .stat-value {
    font-size: 15px;
    font-weight: 700;
    display: block;
}

.stat-item .stat-label {
    font-size: 11px;
    color: #aaa;
}

/* 🟢 ردیف بالای بیو شامل نام فروشگاه/استاتوس در سمت راست و دکمه ارسال ریلز در سمت چپ */
.profile-top-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.profile-bio-left {
    flex-grow: 1;
}

.shop-name {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 4px;
}

.shop-details {
    font-size: 13px;
    color: #ccc;
    line-height: 1.5;
    margin-bottom: 8px;
}

/* 🟢 استایل دکمه دایره‌ای چسبیده به سمت چپ و زیر بخش وضعیت/استاتوس */
.create-reel-btn-container {
    display: none; /* پیش‌فرض مخفی تا مالکیت پروفایل تایید شود */
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
    margin-right: 12px;
}

.create-reel-circle {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff3b5c, #e6005c);
    border: 2px solid #333;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(255, 59, 92, 0.35);
    cursor: pointer;
    transition: transform 0.2s ease;
}

.create-reel-circle:active {
    transform: scale(0.92);
}

.create-reel-circle svg {
    width: 26px;
    height: 26px;
    fill: #fff;
}

.create-reel-label {
    font-size: 11px;
    color: #aaa;
    font-weight: 600;
    margin-top: 4px;
    text-align: center;
}

/* 🟢 استایل دکمه خروج دقیقا مشابه دکمه ارسال ریلز همراه با انیمیشن */
.logout-styled-circle {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff3b5c, #e6005c) !important;
    border: 2px solid #333 !important;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(255, 59, 92, 0.35) !important;
    cursor: pointer;
    transition: transform 0.2s ease !important;
}

.logout-styled-circle:active {
    transform: scale(0.92) !important;
}

/* 🟢 استایل کانتینر دکمه خروج در بوکمارک */
.logout-btn-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
    margin-right: 12px;
}

.action-buttons {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.btn-follow {
    flex: 1;
    padding: 8px;
    background-color: #ff3b5c;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.btn-follow.following {
    background-color: #222;
    color: #fff;
    border: 1px solid #444;
}

.profile-tabs {
    display: flex;
    border-top: 1px solid #222;
    border-bottom: 1px solid #222;
    background: #000;
    position: relative;
}

.tab-btn {
    flex: 1;
    padding: 12px;
    background: none;
    border: none;
    color: #777;
    cursor: pointer;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.tab-btn svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
}

.tab-btn.active {
    color: #fff;
    border-bottom: 2px solid #fff;
}

/* 🟢 ساختار گرید ۳ ستونه استاندارد اینستاگرام */
.grid-view {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 🟢 ۳ ستون ثابت */
    gap: 2px;
    padding: 2px 0;
}

.grid-item {
    position: relative;
    aspect-ratio: 3 / 4; /* 🟢 مستطیلی شدن کاورها (نمایش کامل ۴ ردیف در صفحه) */
    background-color: #111;
    cursor: pointer;
    overflow: hidden;
}

.grid-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.grid-item-views {
    position: absolute;
    bottom: 6px;
    right: 6px;
    font-size: 11px;
    background: rgba(0,0,0,0.6);
    padding: 2px 6px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
    backdrop-filter: blur(4px);
}

.grid-item-views svg {
    width: 12px;
    height: 12px;
    fill: #fff;
}

.feed-view {
    width: 100%;
    background-color: #000;
    position: relative;
}

.reel-card {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #000;
    overflow: hidden;
    scroll-snap-align: start;
    scroll-snap-stop: always;
}

.reel-card video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
}

.video-overlay-gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        rgba(0,0,0,0.45) 0%,
        rgba(0,0,0,0) 18%,
        rgba(0,0,0,0) 60%,
        rgba(0,0,0,0.85) 100%
    );
    pointer-events: none;
    z-index: 2;
}

.discount-ribbon {
    position: absolute;
    top: 28px;
    left: -38px;
    transform: rotate(-45deg);
    background: linear-gradient(135deg, #f39c12, #f1c40f);
    color: #000000;
    font-weight: 800;
    font-size: 12px;
    padding: 6px 40px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
    z-index: 15;
    text-align: center;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.reel-top-right-group {
    position: absolute;
    top: 20px;
    right: 16px;
    z-index: 15;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}

.reel-header-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.reel-header {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #ffffff;
    cursor: pointer;
    text-shadow: 0 1px 4px rgba(0,0,0,0.8);
    text-decoration: none;
}

.reel-follow-btn {
    background-color: #ff3b5c;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 5px 10px;
    font-size: 11px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
    box-shadow: 0 2px 6px rgba(0,0,0,0.4);
    white-space: nowrap;
}

.reel-follow-btn.following {
    background-color: rgba(255, 255, 255, 0.2);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(4px);
}

.reel-options-btn {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    backdrop-filter: blur(6px);
    font-size: 18px;
    font-weight: bold;
}

.reel-status-badge-overlay {
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    backdrop-filter: blur(6px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
    max-width: 200px;
    text-align: right;
    line-height: 1.4;
}

.profile-avatar-wrapper {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    border-radius: 50%;
    border: 1.5px solid #ffffff;
    overflow: hidden;
    background-color: transparent;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
    flex-shrink: 0;
}

.profile-avatar-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.user-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.username {
    font-weight: 600;
    font-size: 14px;
}

.shop-name-reel {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.85);
}

.action-bar-left {
    position: absolute;
    bottom: 85px;
    left: 14px;
    z-index: 12;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    color: #ffffff;
    width: 44px;
}

.action-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    line-height: 1;
    cursor: pointer;
    width: 100%;
    transition: transform 0.15s cubic-bezier(0.175, 0.885, 0.32, 1.27);
}

.action-item:active {
    transform: scale(1.25);
}

.action-icon {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.action-icon svg {
    width: 26px;
    height: 26px;
    fill: none;
    stroke: #ffffff;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
    transition: fill 0.2s ease, stroke 0.2s ease;
}

.action-item.liked svg {
    fill: #ff3b5c;
    stroke: #ff3b5c;
}

.action-item.bookmarked svg {
    fill: #f1c40f;
    stroke: #f1c40f;
}

.action-count {
    font-size: 11px;
    font-weight: 600;
    color: #ffffff;
    text-align: center;
    text-shadow: 0 1px 3px rgba(0,0,0,0.8);
}

.mute-btn {
    position: absolute;
    bottom: 85px;
    right: 16px;
    z-index: 12;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #ffffff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    backdrop-filter: blur(8px);
    transition: background 0.2s ease;
}

.mute-btn svg {
    width: 18px;
    height: 18px;
    fill: #fff;
}

.product-overlay-box {
    position: absolute;
    bottom: 75px;
    left: 50%;
    transform: translateX(-50%);
    width: 82%;
    max-width: 340px;
    z-index: 10;
    color: #ffffff;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 4px;
    pointer-events: none;
}

.product-title-overlay {
    font-size: 15px;
    font-weight: 700;
    color: #ffffff;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.9);
}

.price-row {
    display: flex;
    align-items: center;
    justify-content: center;
}

.final-price {
    font-size: 15px;
    font-weight: 800;
    color: #2ecc71;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.9);
}

.product-details-overlay {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.92);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.9);
}

/* 🟢 استایل نوار پیشرفت سفیدرنگ با جهت چپ‌به‌راست */
.reel-progress-container {
    position: absolute;
    bottom: 54px;
    left: 0;
    width: 100%;
    height: 3px;
    background: rgba(255, 255, 255, 0.2);
    z-index: 30;
    pointer-events: none;
    direction: ltr; /* تضمین جهت چپ به راست */
    transition: opacity 0.25s ease;
}

.reel-progress-bar {
    height: 100%;
    width: 0%;
    background: #ffffff; /* تغییر رنگ به سفید */
    transition: width 0.1s linear;
}

/* 🟢 مخفی شدن تمام اورلی‌ها و نوار پیشرفت با کلاس ui-hidden */
.reel-card.ui-hidden .video-overlay-gradient,
.reel-card.ui-hidden .reel-top-right-group,
.reel-card.ui-hidden .action-bar-left,
.reel-card.ui-hidden .mute-btn,
.reel-card.ui-hidden .product-overlay-box,
.reel-card.ui-hidden .discount-ribbon,
.reel-card.ui-hidden .reel-progress-container {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.video-overlay-gradient,
.reel-top-right-group,
.action-bar-left,
.mute-btn,
.product-overlay-box,
.discount-ribbon,
.reel-progress-container {
    opacity: 1;
    transition: opacity 0.25s ease;
}

.like-heart-anim {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    z-index: 20;
    pointer-events: none;
    transition: transform 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.27), opacity 0.3s ease;
    opacity: 0;
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.5));
}

.like-heart-anim svg {
    width: 90px;
    height: 90px;
    fill: #ff3b5c;
}

.like-heart-anim.pop {
    transform: translate(-50%, -50%) scale(1.15);
    opacity: 1;
}

.bottom-sticky-bar {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    height: 54px;
    background: rgba(10, 10, 10, 0.92);
    backdrop-filter: blur(12px);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-around;
    z-index: 90;
}

.bottom-nav-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: #888;
    font-size: 10px;
    text-decoration: none;
    cursor: pointer;
    width: 25%; /* 🟢 تنظیم عرض برای ۴ آیتم (هر کدام ۲۵ درصد) */
    height: 100%;
    transition: color 0.2s ease;
}

.bottom-nav-item.active, .bottom-nav-item:hover {
    color: #fff;
}

.bottom-nav-icon {
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.bottom-nav-icon svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.bottom-nav-item.active .bottom-nav-icon svg {
    fill: currentColor;
}

.sticky-avatar-img {
    width: 22px !important;
    height: 22px !important;
    min-width: 22px !important;
    min-height: 22px !important;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    border: 1px solid rgba(255, 255, 255, 0.6);
}

.auth-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(5px);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    visibility: hidden;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
}

.auth-modal.open {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

.auth-card {
    background: #181818;
    width: 100%;
    max-width: 480px;
    border-radius: 20px 20px 0 0;
    padding: 24px;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.5);
    transform: translateY(100%);
    transition: transform 0.3s ease;
    position: relative;
    z-index: 10000;
}

.auth-modal.open .auth-card {
    transform: translateY(0);
}

.auth-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 8px;
    text-align: center;
}

.auth-desc {
    font-size: 13px;
    color: #aaa;
    margin-bottom: 20px;
    text-align: center;
    line-height: 1.8;
}

.copyable-bot-tag {
    display: inline-block;
    direction: ltr;
    font-size: 18px;
    font-weight: 800;
    color: #24A1DE;
    background: rgba(36, 161, 222, 0.12);
    border: 1px dashed #24A1DE;
    padding: 4px 10px;
    border-radius: 8px;
    cursor: pointer;
    margin: 4px 2px;
    transition: all 0.2s ease;
    vertical-align: middle;
}

.copyable-bot-tag:hover {
    background: rgba(36, 161, 222, 0.25);
}

.copyable-bot-tag:active {
    transform: scale(0.96);
}

.auth-input {
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #333;
    background: #222;
    color: #fff;
    font-size: 14px;
    text-align: center;
    margin-bottom: 12px;
    outline: none;
}

.auth-input:focus {
    border-color: #ff3b5c;
}

.code-display-box {
    background: #222;
    border: 2px dashed #ff3b5c;
    border-radius: 10px;
    padding: 12px;
    text-align: center;
    margin-bottom: 16px;
}

.code-number {
    font-size: 28px;
    font-weight: 800;
    color: #f1c40f;
    letter-spacing: 6px;
}

.btn-submit-auth {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 12px;
    background: #24A1DE;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
}

.close-modal-btn {
    position: absolute;
    top: 16px;
    left: 16px;
    background: none;
    border: none;
    color: #888;
    font-size: 18px;
    cursor: pointer;
}

.hidden {
    display: none !important;
}