/* ==========================================================================
   صفحه کاربری سلطنتی سماکانکت | SamaConnect Royal Persian Portal Stylesheet
   Version: 2.5.0
   ========================================================================== */

:root {
  --sama-primary: #1E1B4B;       /* لاجوردی سلطنتی عمیق */
  --sama-secondary: #D4AF37;     /* طلایی متالیک اسلیمی */
  --sama-gold-light: #FBF0B9;
  --sama-gold-dark: #997819;
  --sama-ivory-bg: #FAF9F6;      /* پس‌زمینه مرواریدی سلطنتی */
  --sama-ivory-card: #F5F3ED;
  --sama-glass-bg: rgba(255, 255, 255, 0.82);
  --sama-glass-border: rgba(212, 175, 55, 0.28);
  --sama-text-dark: #1E1B4B;
  --sama-text-muted: #64748B;
  --sama-radius: 16px;
}

/* ظرف اصلی پنل */
.sama-portal-wrapper {
  direction: rtl;
  text-align: right;
  font-family: 'Vazirmatn', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--sama-ivory-bg);
  min-height: 100vh;
  position: relative;
  overflow: hidden;
  color: var(--sama-text-dark);
}

/* حذف اجباری هرگونه خط زیر لینک‌ها تحمیل‌شده توسط قالب وردپرس */
.sama-portal-wrapper a,
.sama-portal-wrapper a:hover,
.sama-portal-wrapper a:focus,
.sama-portal-wrapper a:visited,
.sama-nav-item,
.sama-nav-item span,
.sama-btn-gold,
.sama-btn-gold span {
  text-decoration: none !important;
  text-decoration-line: none !important;
  outline: none;
}

/* بوم پس‌زمینه ستاره دنباله‌دار */
#sama-shooting-stars-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 1;
  opacity: 0.6;
}

.sama-portal-container {
  position: relative;
  z-index: 2;
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px 16px;
}

/* شبکه چیدمان گرید سایدبار و محتوا */
.sama-layout-grid {
  display: grid !important;
  grid-template-columns: 280px minmax(0, 1fr) !important;
  gap: 24px !important;
  align-items: start !important;
}

/* ۴ کارت تحلیلی بالای صفحه */
.sama-analytics-grid {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 16px !important;
  margin-bottom: 24px !important;
}

/* نوار تب افقی اسکرول‌شونده موبایل */
.sama-mobile-tabs-bar {
  display: none !important;
}

/* نوار اپ چسبان پایین موبایل */
.sama-mobile-bottom-nav {
  display: none !important;
}

/* کارت‌های شیشه‌ای گلس مورفیسم */
.sama-glass-card {
  background: var(--sama-glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--sama-glass-border);
  border-radius: var(--sama-radius);
  box-shadow: 0 10px 30px -10px rgba(30, 27, 75, 0.08), 0 0 15px rgba(212, 175, 55, 0.12);
  position: relative;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease;
}

.sama-glass-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 36px -8px rgba(30, 27, 75, 0.12), 0 0 22px rgba(212, 175, 55, 0.22);
}

/* نوار کناری سلطنتی دسکتاپ */
.sama-sidebar {
  background: linear-gradient(180deg, #1E1B4B 0%, #17153B 100%);
  border: 1px solid rgba(212, 175, 55, 0.4);
  border-radius: 20px;
  color: #FFFFFF;
  padding: 24px 18px;
  box-shadow: 0 20px 40px rgba(30, 27, 75, 0.25);
  height: fit-content;
}

.sama-avatar-frame {
  position: relative;
  width: 96px;
  height: 96px;
  margin: 0 auto 14px;
  border-radius: 50%;
  padding: 4px;
  background: linear-gradient(135deg, #FFE082, #D4AF37, #9E7412);
  box-shadow: 0 0 20px rgba(212, 175, 55, 0.45);
}

.sama-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid #1E1B4B;
}

/* دکمه‌های آیتم منو */
.sama-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 12px;
  color: #E2E8F0;
  text-decoration: none !important;
  font-weight: 500;
  transition: all 0.25s ease;
  margin-bottom: 6px;
  position: relative;
}

.sama-nav-item:hover, .sama-nav-item.active {
  background: linear-gradient(90deg, rgba(212, 175, 55, 0.25) 0%, rgba(212, 175, 55, 0.05) 100%);
  color: #FDE047 !important;
  border-right: 4px solid #D4AF37;
  box-shadow: inset 0 0 12px rgba(212, 175, 55, 0.15);
}

/* گرادیان متن طلایی */
.sama-gold-text {
  background: linear-gradient(135deg, #FFE082 0%, #D4AF37 50%, #B3861B 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 800;
}

/* دکمه‌های طلایی سلطنتی */
.sama-btn-gold {
  background: linear-gradient(135deg, #DFBA54 0%, #C59B27 50%, #9E7412 100%);
  color: #FFFFFF !important;
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 10px 22px;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(197, 155, 39, 0.35);
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none !important;
}

.sama-btn-gold:hover {
  background: linear-gradient(135deg, #F3CD67 0%, #D8AB31 50%, #B28416 100%);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(197, 155, 39, 0.5);
}

/* =========================================================
   ✨ بخش ویژه و شگفت‌انگیز محصولات (Special Offers & UI/UX)
   ========================================================= */
.sama-deals-header-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 20px;
  padding: 16px 20px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(254, 243, 199, 0.75));
  border: 1px solid rgba(212, 175, 55, 0.4);
  border-radius: 16px;
}

.sama-countdown-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #1E1B4B;
  color: #FDE047;
  padding: 6px 14px;
  border-radius: 24px;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(30, 27, 75, 0.2);
  border: 1px solid rgba(212, 175, 55, 0.4);
}

.sama-product-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)) !important;
  gap: 20px !important;
  margin-bottom: 30px !important;
}

.sama-product-card {
  border-radius: 18px !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  background: rgba(255, 255, 255, 0.95) !important;
  border: 1px solid rgba(212, 175, 55, 0.35) !important;
  box-shadow: 0 10px 24px -6px rgba(30, 27, 75, 0.08) !important;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1) !important;
  position: relative !important;
}

.sama-product-card:hover {
  transform: translateY(-5px) !important;
  border-color: #D4AF37 !important;
  box-shadow: 0 20px 35px -8px rgba(30, 27, 75, 0.15), 0 0 20px rgba(212, 175, 55, 0.3) !important;
}

.sama-product-img-box {
  position: relative;
  width: 100%;
  height: 180px;
  overflow: hidden;
  background: #F1F5F9;
}

.sama-product-img-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.sama-product-card:hover .sama-product-img-box img {
  transform: scale(1.06);
}

/* بج رنگی درصد تخفیف روی گوشه تصویر */
.sama-discount-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: linear-gradient(135deg, #EF4444 0%, #DC2626 100%);
  color: #FFFFFF;
  font-size: 11px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 20px;
  box-shadow: 0 4px 10px rgba(220, 38, 38, 0.4);
  z-index: 2;
}

.sama-category-badge {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(30, 27, 75, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #FDE047;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 8px;
  border: 1px solid rgba(212, 175, 55, 0.3);
  z-index: 2;
}

.sama-product-content {
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  text-align: right !important;
  direction: rtl !important;
}

.sama-product-title {
  font-size: 15px !important;
  font-weight: 800 !important;
  color: #1E1B4B !important;
  margin: 0 0 10px 0 !important;
  line-height: 1.6 !important;
  text-align: right !important;
  direction: rtl !important;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 48px;
}

.sama-product-rating {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: #D4AF37;
  margin-bottom: 12px;
  text-align: right !important;
  direction: rtl !important;
}

.sama-price-box {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px dashed rgba(212, 175, 55, 0.25);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: right !important;
  direction: rtl !important;
}

.sama-price-old {
  font-size: 12px;
  color: #94A3B8;
  text-decoration: line-through;
  margin-bottom: 2px;
  font-weight: 500;
}

.sama-price-current {
  font-size: 17px;
  font-weight: 900;
  color: #0F766E;
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.sama-price-currency {
  font-size: 12px;
  font-weight: 600;
  color: #D4AF37;
}

.sama-product-btn-wrapper {
  padding: 0 16px 16px 16px;
}

.sama-btn-buy-full {
  width: 100% !important;
  padding: 10px 14px !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  border-radius: 12px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  box-sizing: border-box !important;
  text-decoration: none !important;
}

.sama-input {
  width: 100%;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid rgba(212, 175, 55, 0.3);
  background: rgba(255, 255, 255, 0.9);
  color: #1E1B4B;
  font-family: inherit;
  font-size: 13px;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.2s;
}

.sama-input:focus {
  border-color: #D4AF37;
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.15);
}

/* =========================================================
   ✨ حالت مانیتور و ویندوز دسکتاپ (>= 992px)
   ========================================================= */
@media (min-width: 992px) {
  .sama-layout-grid {
    display: grid !important;
    grid-template-columns: 280px minmax(0, 1fr) !important;
    gap: 24px !important;
    align-items: start !important;
  }
  .sama-analytics-grid {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 16px !important;
    margin-bottom: 24px !important;
  }
  .sama-mobile-tabs-bar {
    display: none !important;
  }
  .sama-mobile-bottom-nav {
    display: none !important;
  }

  /* اندازه جمع‌وجور، مهندسی‌شده و استاندارد کارت‌ها و تصاویر در ویندوز */
  .sama-product-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(220px, 260px)) !important;
    gap: 18px !important;
    margin-bottom: 24px !important;
    justify-content: start !important;
  }
  .sama-product-card {
    max-width: 260px !important;
    width: 100% !important;
  }
  .sama-product-img-box {
    height: 130px !important; /* ابعاد کوچک و متناسب در دسکتاپ */
  }
  .sama-product-title {
    font-size: 13px !important;
    min-height: 40px !important;
    margin-bottom: 8px !important;
  }
  .sama-product-content {
    padding: 12px 14px !important;
  }
}

/* =========================================================
   ✨ حالت موبایل و صفحات کوچک (< 992px)
   ========================================================= */
@media (max-width: 991px) {
  .sama-portal-container {
    padding: 12px 10px 90px 10px;
  }

  .sama-layout-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 16px !important;
  }

  .sama-product-grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }

  .sama-product-card {
    max-width: 100% !important;
  }

  .sama-product-img-box {
    height: 180px !important;
  }

  .sama-sidebar {
    padding: 16px 14px;
    border-radius: 16px;
    margin-bottom: 12px;
  }

  .sama-avatar-frame {
    width: 72px;
    height: 72px;
    margin-bottom: 8px;
  }

  .sama-mobile-tabs-bar {
    display: flex !important;
    gap: 8px;
    overflow-x: auto;
    padding: 6px 2px 12px 2px;
    margin-bottom: 16px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .sama-mobile-tabs-bar::-webkit-scrollbar {
    display: none;
  }

  .sama-mobile-tab-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: #FFFFFF;
    border: 1px solid rgba(212, 175, 55, 0.35);
    border-radius: 24px;
    color: #1E1B4B;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    text-decoration: none !important;
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
    transition: all 0.2s ease;
    flex-shrink: 0;
  }

  .sama-mobile-tab-pill.active {
    background: linear-gradient(135deg, #1E1B4B, #2A256B);
    color: #FDE047 !important;
    border-color: #D4AF37;
    box-shadow: 0 4px 12px rgba(30, 27, 75, 0.25);
  }

  .sama-analytics-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
    margin-bottom: 16px !important;
  }

  .sama-analytics-grid .sama-glass-card {
    padding: 14px 12px !important;
  }

  .sama-mobile-bottom-nav {
    display: flex !important;
    align-items: center;
    justify-content: space-around;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: rgba(30, 27, 75, 0.96);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid rgba(212, 175, 55, 0.4);
    z-index: 99999;
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.2);
    padding: 0 8px;
  }

  .sama-bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #94A3B8;
    text-decoration: none !important;
    font-size: 10px;
    font-weight: 600;
    gap: 3px;
    flex: 1;
    height: 100%;
    transition: all 0.2s;
  }

  .sama-bottom-nav-item.active {
    color: #FDE047 !important;
  }

  .sama-bottom-nav-item span.icon {
    font-size: 18px;
  }

  .sama-glass-card {
    border-radius: 14px;
  }
}
