/* =========================================
   EXPLORE SEARCH (جستجو)
   ========================================= */
.explore-search-container {
    max-width: 600px;
    margin-block: clamp(15px, 3vw, 25px);
    margin-inline: auto;
    padding-inline: 15px;
}

.explore-search-form {
    display: flex;
    align-items: center;
    background: var(--light-gray);
    border-radius: var(--radius-md);
    padding: clamp(6px, 1vw, 8px) clamp(12px, 2vw, 15px);
    border: 1px solid var(--border);
    transition: var(--transition);
}

.explore-search-form:focus-within {
    background: var(--white);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.explore-search-input {
    flex: 1;
    background: transparent;
    border: none;
    padding: 8px;
    margin-bottom: 0;
    font-size: clamp(13px, 2vw, 14px);
    color: var(--text);
    font-family: inherit;
    outline: none;
}

.explore-search-input::placeholder {
    color: var(--gray);
}

.explore-search-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--gray);
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.explore-search-btn:hover {
    color: var(--primary);
    transform: scale(1.1);
}

/* =========================================
   GRID VIEW (نمای شبکه‌ای گالری)
   ========================================= */
.back-to-grid {
    display: none;
    position: sticky;
    top: 0;
    background: var(--white);
    border-bottom: 1px solid var(--border);
    padding: 15px;
    text-align: start; /* هوشمند برای LTR/RTL */
    z-index: 100;
    cursor: pointer;
    font-weight: bold;
    color: var(--text);
}

/* چرخش آیکون در حالت RTL */
html[dir="rtl"] .back-to-grid svg { transform: rotate(180deg); }

.back-to-grid svg {
    vertical-align: middle;
    margin-inline-start: 8px;
    transition: transform 0.3s;
}

.ig-grid-container {
    padding: 0 clamp(5px, 2vw, 20px);
}

.ig-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: clamp(3px, 1vw, 10px);
}

.ig-grid-item {
    position: relative;
    aspect-ratio: 1 / 1;
    background: var(--light-gray);
    cursor: pointer;
    overflow: hidden;
}

.ig-grid-item img, 
.ig-grid-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: filter 0.2s ease;
}

@media (hover: hover) {
    .ig-grid-item:hover img, 
    .ig-grid-item:hover video {
        filter: brightness(0.8);
    }
}

/* آیکون‌های روی گالری */
.multi-icon, .video-icon {
    position: absolute;
    top: 8px;
    z-index: 2;
    filter: drop-shadow(0px 0px 2px rgba(0,0,0,0.5));
}

.multi-icon {
    inset-inline-end: 8px;
    width: 20px;
    height: 20px;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white"><path d="M19 2H9c-1.1 0-2 .9-2 2v2H5c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h10c1.1 0 2-.9 2-2v-2h2c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-4 16H5V8h10v10zm4-4h-2V6c0-1.1-.9-2-2-2h-6V4h10v10z"/></svg>') no-repeat center;
}

.video-icon {
    inset-inline-start: 8px;
    width: 24px;
    height: 24px;
}

.video-icon svg {
    width: 100%;
    height: 100%;
    fill: var(--white);
}

/* =========================================
   FEED VIEW & POST CARD (فید و کارت پست)
   ========================================= */
.ig-feed-container {
    display: none;
    max-width: 500px;
    margin: 0 auto;
    padding-top: 20px;
}

.post-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin-bottom: 30px;
}

.post-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--light-gray);
}

.header-user-info {
    display: flex;
    align-items: center;
}

.header-user-info img {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    object-fit: cover;
    margin-inline-end: 10px;
    border: 1px solid var(--border);
}

.header-user-info .username {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text);
    text-decoration: none;
}

/* منوی تنظیمات پست */
.post-options { position: relative; }

.btn-three-dots {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
}

.post-dropdown-menu { 
    display: none;
    position: absolute;
    inset-inline-end: 0;
    top: 100%; 
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-md); 
    box-shadow: var(--shadow-md);
    z-index: 50; 
    min-width: 120px;
    overflow: hidden;
}

.post-dropdown-menu.show { display: block; }

.dropdown-item { 
    width: 100%;
    text-align: start; 
    padding: 12px 16px; 
    border: none;
    background: none;
    cursor: pointer; 
    font-family: inherit;
    font-size: 0.9rem;
    color: var(--text);
    transition: background 0.2s;
}

.dropdown-item:hover { background-color: var(--light-gray); }
.dropdown-item.text-danger { color: var(--danger); font-weight: 600; }
.dropdown-item-form { margin: 0; display: block; }

/* =========================================
   CAROUSEL & MEDIA (کاروسل و رسانه)
   ========================================= */
.carousel-outer-wrapper {
    width: 100%;
    aspect-ratio: 1 / 1;
    position: relative;
    background: #000;
    overflow: hidden;
}

.carousel-scroll-area {
    width: 100%;
    height: 100%;
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    -ms-overflow-style: none;
    cursor: grab;
}

.carousel-scroll-area:active { cursor: grabbing; }
.carousel-scroll-area::-webkit-scrollbar { display: none; }

.carousel-slide {
    flex: 0 0 100%;
    width: 100%;
    height: 100%;
    scroll-snap-align: start;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-slide img,
.carousel-slide video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
}

/* پلیر ویدیو */
.video-play-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 5;
    background: rgba(0,0,0,0.05);
    transition: background 0.2s;
}

.video-play-overlay:hover { background: rgba(0,0,0,0.15); }
.video-play-overlay.hidden { display: none; }

.video-play-overlay svg {
    width: 64px;
    height: 64px;
    fill: rgba(255,255,255,0.85);
    filter: drop-shadow(0 2px 8px rgba(0,0,0,0.3));
    transition: transform 0.15s;
}

.video-play-overlay:hover svg { transform: scale(1.1); }

.video-mute-btn {
    position: absolute;
    bottom: 16px;
    inset-inline-end: 16px;
    z-index: 10;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    background: rgba(0,0,0,0.6);
    border: none;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.video-mute-btn:hover { background: rgba(0,0,0,0.8); }

.video-mute-btn svg {
    fill: #ffffff; /* رنگ آیکون سفید می‌شود */
    filter: drop-shadow(0px 0px 3px rgba(0, 0, 0, 0.8)); /* سایه تیره برای دیده شدن روی ویدیوهای روشن */
}

.video-mute-btn svg { width: 18px; height: 18px; }
.video-mute-btn.visible { display: flex; }

/* نقاط و دکمه‌های کاروسل */
.carousel-dots {
    position: absolute;
    bottom: 12px;
    left: 50%; /* در اینجا left درست است چون با translateX تنظیم می‌شود */
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    z-index: 15;
    pointer-events: none;
}

.carousel-dot {
    width: 6px;
    height: 6px;
    border-radius: var(--radius-full);
    background: rgba(255,255,255,0.5);
    transition: background 0.3s;
}
.carousel-dot.active { background: var(--white); }

.carousel-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 15;
    width: 30px;
    height: 30px;
    border-radius: var(--radius-full);
    background: rgba(255,255,255,0.85);
    border: none;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 5px rgba(0,0,0,0.2);
    transition: background 0.2s, opacity 0.2s;
}

.carousel-nav-btn:hover { background: rgba(255,255,255,1); }
.carousel-nav-btn svg { width: 16px; height: 16px; fill: var(--text); }
.carousel-nav-btn.nav-prev { inset-inline-start: 10px; }
.carousel-nav-btn.nav-next { inset-inline-end: 10px; }
.carousel-nav-btn.visible { display: flex; }

/* =========================================
   POST CONTENT & ACTIONS (محتوای پست)
   ========================================= */
.post-actions {
    display: flex;
    padding: 12px 16px 8px;
    gap: 16px;
}

.action-btn {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    color: var(--text);
    display: flex;
    align-items: center;
}

.action-btn svg { width: 24px; height: 24px; transition: transform 0.1s; }
.action-btn:active svg { transform: scale(1.2); }
.action-btn.liked svg { fill: var(--danger); color: var(--danger); }

.post-likes {
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0 16px;
    margin-bottom: 8px;
    color: var(--text);
}

.post-caption {
    font-size: 0.9rem;
    padding: 0 16px 16px;
    line-height: 1.5;
    color: var(--text);
}

.post-caption .username { font-weight: 600; margin-inline-end: 5px; }

.post-date {
    font-size: 0.75rem;
    color: var(--gray);
    padding: 0 16px 16px;
    text-transform: uppercase;
}

/* =========================================
   COMMENTS SECTION (بخش نظرات - ادغام شده و یکپارچه)
   ========================================= */
.post-comments-section {
    padding: 12px 16px;
    border-top: 1px solid var(--light-gray);
}

.comments-list {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 12px;
}

.comment-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 12px;
    font-size: clamp(13px, 2vw, 14px);
    line-height: 1.5;
    padding: 0 5px;
}

.comment-content {
    flex: 1;
    display: flex;
    flex-wrap: wrap; /* برای قرارگیری صحیح متن در کنار نام کاربری */
    align-items: baseline;
}

.comment-username {
    font-weight: 600;
    margin-inline-end: 8px; 
    color: var(--text);
    text-decoration: none;
    white-space: nowrap;
}

.comment-username:hover { color: var(--primary); }

.comment-text {
    flex: 1;
    word-break: break-word;
    color: var(--text);
}

.comment-delete-btn {
    background: none;
    border: none;
    color: var(--danger);
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 8px;
    margin-inline-start: auto; /* دکمه حذف را به انتهای کادر هل می‌دهد */
    opacity: 0.7;
    transition: opacity 0.2s, transform 0.2s;
    font-family: inherit;
}

.comment-delete-btn:hover { 
    opacity: 1; 
    transform: scale(1.05);
}

.comment-input-wrapper {
    display: flex;
    align-items: center;
    border-top: 1px solid var(--light-gray);
    padding: 10px 0;
    margin-top: 10px;
    gap: 10px;
}

.comment-input {
    flex: 1;
    border: 1px solid var(--border);
    border-radius: 20px; /* طراحی کپسولی (حبابی) برای فیلد نظرات فید */
    padding: 8px 16px;
    font-size: clamp(13px, 2vw, 14px);
    outline: none;
    background: transparent;
    color: var(--text);
    margin-bottom: 0;
    font-family: inherit;
}

.comment-input::placeholder { color: var(--gray); }

.comment-submit-btn {
    background: none;
    border: none;
    color: var(--primary);
    font-weight: 600;
    font-size: clamp(13px, 2vw, 14px);
    cursor: pointer;
    padding: 0 5px;
    opacity: 0.5;
    transition: var(--transition);
    font-family: inherit;
}

.comment-input:not(:placeholder-shown) + .comment-submit-btn,
.comment-submit-btn:not(:disabled) {
    opacity: 1;
}

.comment-submit-btn:disabled {
    cursor: default;
    opacity: 0.5;
}

.comment-submit-btn:hover:not(:disabled) {
    color: var(--primary-dark, #0056b3);
}

.load-more-comments {
    display: block;
    margin: 0 auto 10px;
    padding: 8px 16px;
    background: var(--light-gray);
    color: var(--gray);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    text-align: center;
    width: 100%;
    transition: var(--transition);
    font-family: inherit;
}

.load-more-comments:hover {
    background: var(--border);
    color: var(--text);
}

.comment-count {
    font-size: 12px;
    margin-inline-end: 4px;
    color: var(--gray);
}

/* =========================================
   مُدال اشتراک‌گذاری (Share Modal)
   ========================================= */

/* لایه پس‌زمینه تاریک مُدال */
.share-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9999;
  align-items: center;
  justify-content: center;
}

/* باکس اصلی مُدال */
.share-modal-content {
  background: #ffffff;
  padding: 20px;
  border-radius: 12px;
  width: 90%;
  max-width: 450px;
  max-height: 80vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* هدر مُدال */
.share-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.share-modal-title {
  margin: 0;
  font-size: 1.2rem;
  color: #333;
}

/* دکمه بستن مُدال */
.share-modal-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #999;
  line-height: 1;
  padding: 0;
}

.share-modal-close:hover {
  color: #555;
}

/* اینپوت جستجو در مُدال */
.share-modal-search {
  width: 100%;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  margin-bottom: 15px;
  box-sizing: border-box; /* برای جلوگیری از بیرون زدن اینپوت */
  font-family: inherit;
}

.share-modal-search:focus {
  outline: none;
  border-color: #4599ff;
}

/* لیست کاربران */
.share-modal-list {
  overflow-y: auto;
  flex: 1;
}

/* =========================================
   پشتیبانی از دارک‌مود (Dark Mode) برای مُدال
   ========================================= */
[data-theme="dark"] .share-modal-content {
  background: #242526;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .share-modal-title {
  color: #e4e6eb;
}

[data-theme="dark"] .share-modal-close {
  color: #b0b3b8;
}

[data-theme="dark"] .share-modal-close:hover {
  color: #e4e6eb;
}

[data-theme="dark"] .share-modal-search {
  background: #18191a;
  border-color: #3e4042;
  color: #e4e6eb;
}

[data-theme="dark"] .share-modal-search::placeholder {
  color: #b0b3b8;
}

[data-theme="dark"] .share-modal-search:focus {
  border-color: #4599ff;
}

/* =========================================
   RESPONSIVE (واکنش‌گرایی موبایل)
   ========================================= */
@media (max-width: 600px) {
    .ig-grid-container { padding: 0; }
    .ig-feed-container { max-width: 100%; border: none; padding-top: 0; }
    .post-card { 
        border-radius: 0; 
        border-left: none; 
        border-right: none; 
        margin-bottom: 15px; 
    }
}



/* =========================================
   دارک‌مود (Dark Mode) برای اکسپلور، گرید و فید پست‌ها
   ========================================= */

/* جستجوی اکسپلور (Explore Search) */
[data-theme="dark"] .explore-search-form {
    background: #242526; /* پس‌زمینه تیره باکس جستجو */
    border-color: #3e4042;
}

[data-theme="dark"] .explore-search-form:focus-within {
    background: #3a3b3c; /* روشن‌تر شدن هنگام تایپ */
    border-color: #4599ff;
    box-shadow: 0 0 0 3px rgba(69, 153, 255, 0.2);
}

[data-theme="dark"] .explore-search-input {
    color: #e4e6eb;
}

[data-theme="dark"] .explore-search-input::placeholder {
    color: #b0b3b8;
}

[data-theme="dark"] .explore-search-btn {
    color: #b0b3b8;
}

[data-theme="dark"] .explore-search-btn:hover {
    color: #4599ff;
}

/* نمای شبکه‌ای (Grid View) */
[data-theme="dark"] .back-to-grid {
    background: #18191a; /* همرنگ با پس‌زمینه اصلی بدنه در دارک‌مود */
    border-bottom-color: #3e4042;
    color: #e4e6eb;
}

[data-theme="dark"] .ig-grid-item {
    background: #242526;
}

/* فید و کارت پست (Post Card) */
[data-theme="dark"] .post-card {
    background-color: #242526 !important; /* رنگ پس زمینه تیره */
    color: #e4e6eb !important; /* رنگ متن روشن */
    border-color: #3e4042 !important; /* رنگ حاشیه تیره (اختیاری) */
}

/* اجبار به تیره شدن پس‌زمینه کل بخش فید در دارک‌مود */
[data-theme="dark"] .ig-feed-container {
    background-color: transparent !important;
}

/* اگر کلاس دیگری هم به عنوان نگهدارنده اصلی پست‌ها دارید (مثل ig-feed)، آن را هم شفاف کنید */
[data-theme="dark"] .ig-feed {
    background-color: transparent !important;
}

[data-theme="dark"] .post-header {
    border-bottom-color: #3e4042;
}

[data-theme="dark"] .header-user-info img {
    border-color: #3e4042;
}

[data-theme="dark"] .header-user-info .username {
    color: #e4e6eb;
}

[data-theme="dark"] .btn-three-dots {
    color: #e4e6eb;
}

/* منوی تنظیمات پست (Dropdown) */
[data-theme="dark"] .post-dropdown-menu {
    background: #242526;
    border-color: #3e4042;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5); /* سایه غلیظ‌تر برای منو */
}

[data-theme="dark"] .dropdown-item {
    color: #e4e6eb;
}

[data-theme="dark"] .dropdown-item:hover {
    background-color: #3a3b3c;
}

/* دکمه‌های ناوبری کاروسل روی عکس/ویدیو */
[data-theme="dark"] .carousel-nav-btn {
    background: rgba(36, 37, 38, 0.85); /* پس‌زمینه دکمه‌های اسلایدر در دارک‌مود */
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .carousel-nav-btn:hover {
    background: rgba(58, 59, 60, 0.95);
}

[data-theme="dark"] .carousel-nav-btn svg {
    fill: #e4e6eb;
}

/* محتوای پست (لایک‌ها، کپشن و تاریخ) */
[data-theme="dark"] .action-btn {
    color: #e4e6eb;
}

[data-theme="dark"] .post-likes,
[data-theme="dark"] .post-caption,
[data-theme="dark"] .comment-text {
    color: #e4e6eb;
}

[data-theme="dark"] .post-date {
    color: #b0b3b8;
}

/* بخش نظرات (Comments Section) */
[data-theme="dark"] .post-comments-section {
    border-top-color: #3e4042;
}

[data-theme="dark"] .comment-username {
    color: #f1f5f9; /* نام کاربری نظرات کمی روشن‌تر برای تمایز بهتر */
}

[data-theme="dark"] .comment-input-wrapper {
    border-top-color: #3e4042;
}

[data-theme="dark"] .comment-input {
    border-color: #3e4042;
    color: #e4e6eb;
    background: #18191a; /* داخل فیلد نظر کمی تیره‌تر */
}

[data-theme="dark"] .comment-input::placeholder {
    color: #b0b3b8;
}

[data-theme="dark"] .load-more-comments {
    background: #3a3b3c;
    color: #b0b3b8;
}

[data-theme="dark"] .load-more-comments:hover {
    background: #4e4f50;
    color: #e4e6eb;
}
/* =========================================
   اصلاح رنگ آیکون‌های اکشن (لایک، کامنت، شیر) در دارک‌مود
   ========================================= */

/* حذف هرگونه فیلتر سفیدکننده ناخواسته از روی تمام آیکون‌های این بخش */
[data-theme="dark"] .action-btn svg {
    filter: none !important;
}

/* بازگرداندن رنگ قرمز به قلب در حالت لایک شده (دارک‌مود) */
[data-theme="dark"] .action-btn.liked {
    color: #ed4956 !important; /* رنگ قرمز */
}

[data-theme="dark"] .action-btn.liked svg {
    fill: #ed4956 !important;
    stroke: #ed4956 !important;
    color: #ed4956 !important;
}
/* =========================================
   اصلاح مُدال اشتراک‌گذاری در دارک‌مود (با !important)
   ========================================= */

/* پس‌زمینه اصلی مُدال */
[data-theme="dark"] .share-modal-content {
  background-color: #242526 !important;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5) !important;
  border: 1px solid #3e4042 !important;
}

/* عنوان مُدال */
[data-theme="dark"] .share-modal-title {
  color: #e4e6eb !important;
}

/* دکمه بستن (ضربدر) */
[data-theme="dark"] .share-modal-close {
  color: #b0b3b8 !important;
}
[data-theme="dark"] .share-modal-close:hover {
  color: #e4e6eb !important;
}

/* باکس جستجو در مُدال */
[data-theme="dark"] .share-modal-search {
  background-color: #18191a !important;
  border-color: #3e4042 !important;
  color: #e4e6eb !important;
}
[data-theme="dark"] .share-modal-search::placeholder {
  color: #b0b3b8 !important;
}
[data-theme="dark"] .share-modal-search:focus {
  border-color: #4599ff !important;
}

/* متن‌های نام و نام کاربری در لیست کاربران (برای رفع مشکل ناخوانا بودن) */
[data-theme="dark"] .share-modal-list {
  background-color: transparent !important;
}
[data-theme="dark"] .share-modal-list p,
[data-theme="dark"] .share-modal-list span,
[data-theme="dark"] .share-modal-list h6,
[data-theme="dark"] .share-modal-list div {
  color: #e4e6eb !important;
}
/*///////////////////////////////////////////////////////////////
/* =====================================================
   Profile Page - Full Stylesheet
   - RTL/LTR Logical Properties
   - CSS Variables (var(--...))
   - Responsive & Accessible
   ===================================================== */

/* ===== Profile Header ===== */
.profile-header {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: var(--white);
    /* [CHANGED] از clamp به جای مقادیر ثابت برای padding */
    padding: clamp(30px, 6vw, 60px) clamp(20px, 4vw, 40px);
    border-radius: var(--radius-lg);
    margin-bottom: 30px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

/* [CHANGED] حذف left/right ثابت، استفاده از inset-inline */
.profile-header::before {
    content: '';
    position: absolute;
    inset: 0; /* [CHANGED] جایگزین top/right/bottom/left: 0 */
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" opacity="0.1"><rect x="10" y="10" width="80" height="80" fill="none" stroke="white" stroke-width="2"/><circle cx="50" cy="50" r="20" fill="none" stroke="white" stroke-width="2"/></svg>') repeat;
    /* [CHANGED] نام انیمیشن اختصاصی برای جلوگیری از تداخل */
    animation: profileRotate 40s linear infinite;
    pointer-events: none; /* [NEW] جلوگیری از بلوک کردن کلیک */
}

/* [CHANGED] نام اختصاصی برای انیمیشن rotate */
@keyframes profileRotate {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

.profile-content {
    display: flex;
    align-items: center;
    gap: 30px;
    flex-wrap: wrap;
    position: relative;
    z-index: 2;
}

.avatar-wrapper {
    position: relative;
    width: 140px;
    height: 140px;
    flex-shrink: 0;
}

.avatar-wrapper img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 4px solid rgba(255, 255, 255, 0.3);
    object-fit: cover;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    animation: profileFadeInDown 0.8s ease both;
    /* [NEW] font-family به ارث رسیده */
    font-family: inherit;
}

/* [CHANGED] از inset-inline-end/bottom به جای right/bottom */
.verified-badge {
    position: absolute;
    bottom: 5px;
    /* [CHANGED] inset-inline-end برای RTL/LTR هوشمند */
    inset-inline-end: 5px;
    width: 34px;
    height: 34px;
    /* [CHANGED] از var(--primary) به جای هاردکد #3b82f6 */
    background: var(--primary);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    /* [CHANGED] از var(--white) به جای white */
    border: 3px solid var(--white);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    z-index: 10;
    /* [NEW] انتقال نرم برای hover احتمالی */
    transition: transform 0.2s ease;
}

.verified-badge:hover {
    transform: scale(1.1); /* [NEW] */
}

.verified-badge svg {
    width: 18px;
    height: 18px;
}

.profile-info {
    flex: 1;
    animation: profileFadeInUp 0.8s ease 0.2s both;
    /* [NEW] حداقل عرض برای جلوگیری از له شدن */
    min-width: 200px;
}

.profile-info h1 {
    font-size: clamp(1.6rem, 3vw, 2.2rem); /* [CHANGED] clamp */
    font-weight: 700;
    margin-bottom: 5px;
    font-family: inherit; /* [NEW] */
    line-height: 1.3;
}

.profile-username {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-bottom: 15px;
    /* [NEW] dir-independent برای نمایش یوزرنیم */
    direction: ltr;
    text-align: start; /* [CHANGED] */
}

/* ===== Stats ===== */
.stats {
    display: flex;
    gap: 30px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.stat-item {
    text-align: center;
    background: rgba(255, 255, 255, 0.15);
    padding: 12px 20px;
    border-radius: var(--radius-md);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px); /* [NEW] Safari */
    min-width: 100px;
    transition: transform 0.3s ease, background 0.3s ease; /* [CHANGED] */
}

.stat-item:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.25); /* [CHANGED] کمی بیشتر */
}

.stat-item strong {
    font-size: clamp(1.4rem, 2.5vw, 1.8rem); /* [CHANGED] clamp */
    font-weight: 800;
    display: block;
    line-height: 1.2;
}

.stat-item span {
    font-size: 0.9rem;
    opacity: 0.9;
}

.stat-link {
    color: var(--white); /* [CHANGED] */
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease; /* [CHANGED] */
}

.stat-link:hover {
    text-decoration: underline;
    opacity: 1;
}

/* ===== Action Buttons ===== */
.action-buttons {
    display: flex;
    gap: 15px;
    margin-top: 25px;
    flex-wrap: wrap;
    animation: profileFadeInUp 0.8s ease 0.3s both;
}

/* [NOTE] کلاس .btn اصلی سایت حفظ شده،
   کلاس‌های اختصاصی برای جلوگیری از override */
.profile-btn {
    padding: 12px 30px;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 1rem;
    font-family: inherit; /* [NEW] */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border: none;
    text-decoration: none;
    display: inline-flex; /* [CHANGED] inline-flex برای آیکون */
    align-items: center;
    gap: 8px; /* [NEW] فاصله آیکون و متن */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    white-space: nowrap; /* [NEW] */
}

.profile-btn-follow {
    background: var(--white);
    color: var(--primary);
}

.profile-btn-follow:hover {
    background: var(--primary-light);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(255, 255, 255, 0.3);
    color: var(--primary);
}

.profile-btn-unfollow {
    /* [CHANGED] از متغیر CSS به جای هاردکد */
    background: var(--gray-light, #9ca3af);
    color: var(--white);
}

.profile-btn-unfollow:hover {
    background: var(--gray, #6b7280);
    transform: translateY(-3px);
    color: var(--white);
}

.profile-btn-message {
    background: var(--white);
    color: var(--primary);
}

.profile-btn-message:hover {
    background: var(--primary-light);
    transform: translateY(-3px);
    color: var(--primary);
}

/* [CHANGED] از var(--secondary) به جای هاردکد */
.profile-btn-contact {
    background: var(--secondary);
    color: var(--white);
}

.profile-btn-contact:hover {
    /* [CHANGED] از var(--secondary-dark) اگر موجود باشد */
    background: var(--secondary-dark, #0e9f6e);
    transform: translateY(-3px);
    color: var(--white);
}

.profile-btn-edit {
    background: var(--white);
    color: var(--primary);
}

.profile-btn-edit:hover {
    background: var(--primary-light);
    transform: translateY(-3px);
    color: var(--primary);
}

/* ===== Bio Section ===== */
.bio-section {
    background: var(--white); /* [CHANGED] */
    border-radius: var(--radius-lg);
    padding: clamp(20px, 3vw, 30px); /* [CHANGED] clamp */
    margin: 30px 0;
    box-shadow: var(--shadow-sm);
}

.bio-section h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--dark);
    border-bottom: 3px solid var(--primary-light);
    padding-bottom: 10px;
    position: relative;
    font-family: inherit; /* [NEW] */
}

/* [CHANGED] از inset-inline-end به جای right (RTL/LTR هوشمند) */
.bio-section h2::after {
    content: '';
    position: absolute;
    bottom: -3px;
    inset-inline-end: 0; /* [CHANGED] */
    width: 80px;
    height: 3px;
    background: var(--primary);
    border-radius: 3px;
}

.bio-content {
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--gray);
    font-family: inherit; /* [NEW] */
}

.category-badge {
    display: inline-block;
    background: var(--primary-light);
    color: var(--primary);
    padding: 6px 16px;
    border-radius: var(--radius-full);
    font-size: 0.9rem;
    font-weight: 600;
    margin-top: 15px;
    font-family: inherit; /* [NEW] */
}

/* =====================================================
   استایل‌های سیستم تبلیغات (بنر و کارت‌ها)
   ===================================================== */
.ad-banner {
    /* [CHANGED] از var(--warning-light) یا fallback */
    background: linear-gradient(135deg,
        var(--warning-light, #fffbeb) 0%,
        var(--warning-lighter, #fef3c7) 100%
    );
    /* [CHANGED] از var(--warning-border) یا fallback */
    border: 1px solid var(--warning-border, #fde68a);
    border-radius: var(--radius-lg);
    padding: 20px 25px;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
    flex-wrap: wrap;
}

/* [CHANGED] از inset-inline-end به جای right */
.ad-badge {
    position: absolute;
    top: 0;
    inset-inline-end: 25px; /* [CHANGED] RTL/LTR هوشمند */
    background: var(--warning);
    color: var(--white);
    padding: 4px 12px;
    font-size: 0.8rem;
    font-weight: 700; /* [CHANGED] bold → 700 */
    border-radius: 0 0 8px 8px;
    font-family: inherit; /* [NEW] */
}

.ad-content {
    display: flex;
    align-items: center;
    gap: 15px;
    z-index: 1;
}

.ad-icon {
    font-size: 2.5rem;
    line-height: 1; /* [NEW] */
}

.ad-text h4 {
    /* [CHANGED] از var(--warning-dark) یا fallback */
    color: var(--warning-dark, #92400e);
    margin-bottom: 5px;
    font-size: 1.2rem;
    font-weight: 700;
    font-family: inherit; /* [NEW] */
}

.ad-text p {
    /* [CHANGED] از var یا fallback */
    color: var(--warning-text, #b45309);
    font-size: 0.95rem;
    margin: 0;
}

.ad-button {
    background: var(--warning);
    color: var(--white);
    padding: 10px 24px;
    border-radius: var(--radius-full);
    text-decoration: none;
    font-weight: 600;
    font-family: inherit; /* [NEW] */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); /* [CHANGED] */
    z-index: 1;
    white-space: nowrap;
    display: inline-flex; /* [NEW] */
    align-items: center;
}

.ad-button:hover {
    background: var(--warning-dark, #d97706);
    transform: translateY(-2px);
    color: var(--white);
    box-shadow: 0 4px 10px rgba(217, 119, 6, 0.3);
}

/* ریبون کارت تبلیغاتی */
/* [CHANGED] از inset-inline-end به جای right */
.ad-ribbon {
    position: absolute;
    top: 15px;
    /* [CHANGED] RTL: inset-inline-end، برای چرخش صحیح */
    inset-inline-end: -35px; /* [CHANGED] */
    color: var(--white);
    padding: 5px 40px;
    font-size: 0.8rem;
    font-weight: 700;
    /* [CHANGED] rotate بر اساس جهت متن */
    transform: rotate(45deg);
    z-index: 15;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    text-align: center;
    font-family: inherit;
}

/* [NOTE] در RTL زاویه ریبون باید معکوس شود */
[dir="rtl"] .ad-ribbon {
    transform: rotate(-45deg); /* [NEW] */
    inset-inline-end: -35px;
    inset-inline-start: auto;
}

/* استایل پلن‌های مختلف */
/* [CHANGED] از var(--primary) به جای هاردکد #3b82f6 */
.ad-ladder {
    border: 2px solid var(--primary) !important;
    box-shadow: 0 0 15px rgba(var(--primary-rgb, 59, 130, 246), 0.15) !important;
}
.ad-ladder .ad-ribbon { background: var(--primary); }

/* [CHANGED] از var(--secondary) به جای هاردکد */
.ad-clicks {
    border: 2px solid var(--secondary) !important;
    box-shadow: 0 0 15px rgba(var(--secondary-rgb, 16, 185, 129), 0.15) !important;
}
.ad-clicks .ad-ribbon { background: var(--secondary); }

/* [CHANGED] از var(--warning) به جای هاردکد */
.ad-vip {
    border: 2px solid var(--warning) !important;
    box-shadow: 0 0 20px rgba(var(--warning-rgb, 245, 158, 11), 0.25) !important;
    position: relative;
}

.ad-vip::before {
    content: '';
    position: absolute;
    inset: 0; /* [CHANGED] */
    box-shadow: inset 0 0 20px rgba(var(--warning-rgb, 245, 158, 11), 0.1);
    pointer-events: none;
    z-index: 1;
}

.ad-vip .ad-ribbon { background: var(--warning); }

/* ===== Products Grid ===== */
.products-section {
    background: var(--white); /* [CHANGED] */
    border-radius: var(--radius-lg);
    padding: clamp(20px, 3vw, 30px); /* [CHANGED] clamp */
    margin: 30px 0;
    box-shadow: var(--shadow-sm);
}

.products-section h2 {
    font-size: clamp(1.4rem, 2.5vw, 1.8rem); /* [CHANGED] clamp */
    font-weight: 700;
    margin-bottom: 30px;
    color: var(--dark);
    border-bottom: 3px solid var(--primary-light);
    padding-bottom: 10px;
    position: relative;
    font-family: inherit; /* [NEW] */
}

/* [CHANGED] از inset-inline-end به جای right */
.products-section h2::after {
    content: '';
    position: absolute;
    bottom: -3px;
    inset-inline-end: 0; /* [CHANGED] RTL/LTR هوشمند */
    width: 80px;
    height: 3px;
    background: var(--primary);
    border-radius: 3px;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
}

.product-card {
    background: var(--white); /* [CHANGED] */
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border: 1px solid var(--border);
    position: relative;
    /* [NEW] برای انیمیشن ورود */
    animation: productFadeIn 0.4s ease both;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.product-image-wrapper {
    position: relative;
    height: 220px;
    overflow: hidden;
    background: var(--light, #f8fafc); /* [NEW] background fallback */
}

.product-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
    font-family: inherit; /* [NEW] */
}

.product-card:hover .product-image-wrapper img {
    transform: scale(1.1);
}

/* [NOTE] .product-badge از مکالمه قبلی حفظ شده */
.product-badge {
    position: absolute;
    top: 10px;
    padding: 5px 12px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    font-family: inherit; /* [NEW] */
}

/* [CHANGED] از inset-inline-start به جای left */
.badge-banned {
    inset-inline-start: 10px; /* [CHANGED] RTL/LTR هوشمند */
    background: var(--danger);
    color: var(--white);
}

/* [CHANGED] از inset-inline-end به جای right */
.badge-sale {
    inset-inline-end: 10px; /* [CHANGED] RTL/LTR هوشمند */
    background: var(--danger);
    color: var(--white);
    /* [CHANGED] نام انیمیشن اختصاصی */
    animation: pulseBadge 2s infinite;
}

/* [CHANGED] نام اختصاصی برای pulse */
@keyframes pulseBadge {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* [NEW] انیمیشن ورود کارت محصول */
@keyframes productFadeIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.product-info {
    padding: 15px;
}

.product-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--dark);
    line-height: 1.4;
    height: 2.8em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    font-family: inherit; /* [NEW] */
}

.product-stats {
    display: flex;
    justify-content: space-between;
    padding: 10px 15px;
    /* [CHANGED] از var(--light) یا fallback */
    background: var(--light, #f8fafc);
    border-top: 1px solid var(--border);
    font-size: 0.9rem;
    color: var(--gray);
}

.stat-icon {
    display: flex;
    align-items: center;
    gap: 5px;
}

.stat-icon img {
    width: 18px;
    height: 18px;
    opacity: 0.6;
}

/* ===== Empty State ===== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--gray);
}

.empty-state img {
    width: 120px;
    opacity: 0.5;
    margin-bottom: 20px;
    font-family: inherit; /* [NEW] */
}

/* ===== Warning Message ===== */
/* [CHANGED] استفاده از متغیرهای CSS برای رنگ‌ها */
.warning-message {
    background: var(--warning-light, #fff3cd);
    color: var(--warning-dark, #856404);
    padding: 15px 20px;
    margin: 20px auto;
    max-width: 1200px;
    border-radius: var(--radius-md);
    border: 1px solid var(--warning-border, #ffeeba);
    text-align: center;
    font-weight: 500;
    font-family: inherit; /* [NEW] */
}

/* [CHANGED] از var(--primary) یا fallback */
.warning-message a {
    color: var(--primary, #004085);
    font-weight: 700;
    text-decoration: underline;
}

/* ===== Animations ===== */
/* [CHANGED] نام‌های اختصاصی برای جلوگیری از تداخل */
@keyframes profileFadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes profileFadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .profile-header {
        padding: 30px 15px; /* [CHANGED] */
    }

    .profile-content {
        flex-direction: column;
        text-align: center;
        align-items: center; /* [NEW] */
    }

    /* [NEW] در موبایل، یوزرنیم وسط */
    .profile-username {
        text-align: center;
    }

    .profile-info h1 {
        font-size: 1.6rem; /* [CHANGED] */
    }

    .stats {
        justify-content: center;
        gap: 15px;
    }

    .stat-item {
        padding: 8px 15px;
        min-width: 80px;
    }

    .stat-item strong {
        font-size: 1.4rem;
    }

    .action-buttons {
        justify-content: center;
    }

    .products-grid {
        /* [CHANGED] در موبایل دو ستون به جای یک ستون */
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 15px; /* [CHANGED] */
    }

    .product-image-wrapper {
        height: 160px; /* [CHANGED] کوچکتر در موبایل */
    }

    .bio-section,
    .products-section {
        padding: 20px;
    }

    .ad-banner {
        flex-direction: column;
        text-align: center;
        padding: 20px 15px; /* [CHANGED] */
    }

    .ad-content {
        flex-direction: column;
        gap: 10px;
    }

    /* [NEW] در موبایل ریبون مخفی */
    .ad-ribbon {
        display: none;
    }
}

@media (max-width: 768px) {
    .container {
        padding-inline: 8px;
    }

    .products-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }

    .product-card {
        width: 100%;
    }

    .product-image-wrapper {
        height: 120px;
    }

    /* عنوان محصول */
    .product-title {
        font-size: 0.75rem;
        height: 2.6em;
        padding: 0 5px;
        margin-bottom: 5px;
    }

   
    .product-info {
        padding: 8px;
    }

    .product-stats {
        padding: 6px 8px;
        font-size: 0.7rem;
    }
}

@media (max-width: 480px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
}

.product-price {
    font-weight: 700;
    color: var(--danger);
    font-size: 1.1rem;
    margin-top: 8px;
}

.price-old {
    color: var(--gray);
    font-weight: normal;
    font-size: 0.9rem;
    margin-right: 8px;
}

@media (max-width: 768px) {
    .product-price {
        font-size: 0.75rem;
        margin-top: 4px;
    }

    .price-old {
        font-size: 0.7rem;
    }
}

/* =====================================================
   Dark Mode Styles for Profile Page
   ===================================================== */

/* تغییر رنگ پس‌زمینه سکشن‌های اصلی (بیوگرافی و محصولات) */
[data-theme="dark"] .bio-section,
[data-theme="dark"] .products-section,
[data-theme="dark"] .product-card {
    background: #1e1e1e;
    border-color: #333333;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

/* تغییر رنگ تیترها و متن‌ها */
[data-theme="dark"] .bio-section h2,
[data-theme="dark"] .products-section h2,
[data-theme="dark"] .product-title {
    color: #f1f5f9;
}

[data-theme="dark"] .bio-content {
    color: #cbd5e1;
}

/* دکمه‌های پروفایل که پس‌زمینه سفید داشتند */
[data-theme="dark"] .profile-btn-follow,
[data-theme="dark"] .profile-btn-message,
[data-theme="dark"] .profile-btn-edit {
    background: #2d3748;
    color: #e2e8f0;
}

[data-theme="dark"] .profile-btn-follow:hover,
[data-theme="dark"] .profile-btn-message:hover,
[data-theme="dark"] .profile-btn-edit:hover {
    background: var(--primary);
    color: #ffffff;
}

/* بج دسته‌بندی */
[data-theme="dark"] .category-badge {
    background: rgba(var(--primary-rgb, 59, 130, 246), 0.2);
    color: #93c5fd;
}

/* استایل‌های کارت محصول در دارک مود */
[data-theme="dark"] .product-stats {
    background: #2d3748;
    border-top-color: #4a5568;
    color: #e2e8f0;
}

[data-theme="dark"] .product-image-wrapper {
    background: #2d3748;
}

/* بنرهای تبلیغاتی در حالت تاریک */
[data-theme="dark"] .ad-banner {
    background: linear-gradient(135deg, #422a04 0%, #2b1c03 100%); 
    border-color: #78350f;
}

[data-theme="dark"] .ad-text h4 {
    color: #fde68a;
}

[data-theme="dark"] .ad-text p {
    color: #d1d5db;
}

/* پیام هشدار (Warning Message) */
[data-theme="dark"] .warning-message {
    background: #422a04;
    color: #fde68a;
    border-color: #78350f;
}

[data-theme="dark"] .warning-message a {
    color: #fcd34d;
}

/* کم رنگ کردن آیکن‌های داخل کارت‌ها برای حالت تاریک (در صورت نیاز) */
[data-theme="dark"] .stat-icon img {
    filter: brightness(0) invert(1) opacity(0.8);
}
.dark-mode .video-mute-btn svg {
    fill: #ffffff;
}
