/* ارتفاع تقریبی نوار بالا (navbar) */
:root {
  --nx-navbar-height: 48px;
}

/* صفحه‌هایی که سرویس‌های فاندامنتال دارند */
.fundamental-page {
  /* اگر در base.css padding-top ندادی، این خط کمک می‌کند محتوا زیر navbar قایم نشه */
  /* padding-top: calc(var(--nx-navbar-height) + 0.5rem); */
}

/* باکس اسکرول برای جداول بزرگ: ارتفاع داینامیک متناسب با اندازه صفحه */
.fundamental-page .dynamic-table-area {
  max-height: calc(100vh - var(--nx-navbar-height) - 120px);
  overflow-y: auto;
}

/* لپ‌تاپ و تبلت: چون هدر چند خطی‌تر می‌شود، کمی ارتفاع جدول را کم می‌کنیم */
@media (max-width: 992px) {
  .fundamental-page .dynamic-table-area {
    max-height: calc(100vh - var(--nx-navbar-height) - 160px);
  }
}

/* موبایل: هدر و تب‌ها فضای بیشتری می‌گیرند → جدول کم‌ارتفاع‌تر شود */
@media (max-width: 576px) {
  .fundamental-page .dynamic-table-area {
    max-height: calc(100vh - var(--nx-navbar-height) - 200px);
  }
}

/* اسکرول‌بار نرم و ظریف برای جدول‌ها */
.fundamental-page .dynamic-table-area::-webkit-scrollbar {
  width: 6px;
}
.fundamental-page .dynamic-table-area::-webkit-scrollbar-thumb {
  background: #cbd5f5;
  border-radius: 10px;
}
.fundamental-page .dynamic-table-area::-webkit-scrollbar-track {
  background: #f1f5f9;
}
/* ردیف عنوان ستون‌ها همیشه در بالای جدول بماند */
table thead th {
    position: sticky;
    top: 0;
    z-index: 4;           /* بالاتر از سلول‌های معمولی */
}

/* بک‌گراند ردیف عنوان ستون‌ها */
table thead th,
table thead td {
    background: #f8f7fc !important;
}

/* From fundamental/templates/fundamental/financial_reports.html */
.custom-tabs {
  display: flex;
  flex-wrap: wrap; /* در صفحه‌های کوچک، تب‌ها بروند زیر هم */
  gap: 0.5rem;
  justify-content: center;
  padding: 0.5rem;
}
.custom-tab {
  flex: 1 1 110px; /* مقدار پیشنهادی پایه‌ی طول تب است */
  max-width: 140px;
  font-size: .75rem;
  font-weight: 200;
  text-align: center;
  background-color: white;
  color: #00036d;
  padding: .3rem .2rem;  /* ↓ ارتفاع را کم کردیم */
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* برای صفحه‌های کوچکتر از 768px */
@media (max-width: 768px) {
  .custom-tab {
    flex: 1 1 80px;
    max-width: 130px;
    font-size: 10px;
    padding: 0.3rem 0.2rem;  /* ↓ حتی کوتاه‌تر در تبلت */
  }
}

/* برای موبایل کوچکتر از 480px */
@media (max-width: 480px) {
  .custom-tab {
    flex: 0 0 auto;
    min-width: 100px;
    padding: 0.3rem 0.2rem;  /* ↓ کوتاه در موبایل */
  }
}

  .custom-tabs::-webkit-scrollbar {
    display: none; /* Chrome, Safari */
  }


.custom-tab:hover {
  background-color: #e9f3ff;
}

.custom-tab.active {
  background-color: #0d6efd;
  color: white;
  font-weight: bold;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}


.tab-pane  {
display: none;
}

.tab-pane.active {
display: block;
}


.highcharts-legend-item text {
    direction: rtl !important;
    text-anchor: end !important;
    white-space: normal !important;
}
#search-form .form-control {
        min-width: 0;
        flex: 1 1 auto;
        height: 2.5rem;
        direction: rtl; /* تاکید: نمایش RTL */
    }
#search-form .input-group {
    position: relative;
    }
#search-form .input-group > .btn {
  border-top-left-radius: .5rem !important;
  border-bottom-left-radius: .5rem !important;
  border-top-right-radius: 0 !important;
  border-bottom-right-radius: 0 !important;
  height: 2.5rem;               /* همقد اینپوت */
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* خود اینپوت: گوشه‌های راست گرد، چپ صاف (کنار دکمه) */
#search-form .input-group > .form-control {
  border-top-right-radius: .5rem !important;
  border-bottom-right-radius: .5rem !important;
  border-top-left-radius: 0 !important;
  border-bottom-left-radius: 0 !important;
  height: 2.5rem;
}

/* باکس ساجست: کامل زیر گروه بیفته و گوشه‌های پایین گرد باشه */
#search-form .suggest-box {
  border-top-left-radius: 0;
  border-top-right-radius: 0;
  border-bottom-left-radius: .5rem;
  border-bottom-right-radius: .5rem;
  margin-top: 2px;       /* کمی فاصله از کادر بالا */
}

/* وقتی لیست بازه، مرز پایین گروه یکپارچه بشه (اختیاری) */
#search-form .input-group.show-suggest > .form-control,
#search-form .input-group.show-suggest > .btn {
  border-bottom-left-radius: 0 !important;
  border-bottom-right-radius: 0 !important;
}
.responsive-title {
    background-color: #d6e5fe;
    text-align: right;
    font-weight: bold;
    font-size: 11px; /* پیش‌فرض برای موبایل */
    padding: 0.5rem 1rem;
    border-top-left-radius: 0.5rem;
    border-top-right-radius: 0.5rem;
}

.responsive-title span {
    color: #00036d;
    font-weight: bold;
    font-size: 12px;
}

@media (min-width: 768px) {
    .responsive-title {
        font-size: 12px;
    }

.responsive-title span {
        font-size: 14px;
    }
}

/* تنظیمات کلی */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    direction: rtl;
}

/* جدول کلی */
.period-header {
    white-space: normal !important;
    word-break: break-word;
    font-size: 12px;
    vertical-align: middle;
    text-align: center;
    line-height: 1.7;
    min-width: 120px;
}

table {
    border-collapse: separate; /* برای جلوگیری از مشکل با sticky */
    border-spacing: 0;
    font-size: 12px;
}
/* هاور روی سطر */
table tbody tr:hover > td,
table tbody tr:hover > th {
    background-color: #eff2f5 !important;
}
/* جدول */
table th,
table td {
    white-space: nowrap;
    vertical-align: middle;
    background: #fff;            /* بک گراند پیش فرض */
    transition: background 0.2s;
    min-width: 175px;
}

/* ستون اول (شرح) فیکس شود */
table th.sticky-col,
table td.sticky-col {
    position: sticky;
    right: 0; /* چون راست به چپ هست، باید از right استفاده شود */
    z-index: 2;
    text-align: right;
    direction: rtl;
}
/* تنظیم متن چندخطی برای ستون شرح */
table td.sticky-col {
    min-width: 290px;
    max-width: 300px;
    font-size: 12px;
    white-space: normal;
    overflow-wrap: break-word;
    word-break: break-word;
}

/* بالاتر بردن header */
table thead th.sticky-col {
    z-index: 5;
}
/* ستون اول (شرح) فیکس شود */
table th.sticky-col-currency,
table td.sticky-col-currency {
    position: sticky;
    right: 0; /* چون راست به چپ هست، باید از right استفاده شود */
    z-index: 2;
    text-align: right;
    direction: rtl;
}
/* تنظیم متن چندخطی برای ستون شرح */
table td.sticky-col-currency {
    max-width: 130px;
    font-size: 12px;
    white-space: normal;
    overflow-wrap: break-word;
    word-break: break-word;
}

/* بالاتر بردن header */
table thead th.sticky-col-currency {
    z-index: 5;
}
/* فونت و ارتفاع  ستون‌های تایتل */
table thead th{
font-size: 12px;
line-height: 1.7;
}
/* بک‌گراند  ستون‌های تایتل */
table thead th,
table thead td {
    background: #f8f7fc !important;
}
/* تنظیم ارتفاع رکوردهای جدول و نازکتر کردن بوردها */
table tbody td {
    border-bottom: 1px solid rgba(229, 231, 235, 0.7);  /* نازک و کمرنگ */
    height: 2.6rem;
}
.table-border {
    border: 1px solid #f1f1f1;   /* خطوط معمولی */
}

/* برای مواردی از رکوردها ک باید هایلایت شود */
.highlight-codal{
    background-color: #edf3ff !important;
}
/* فونت و سایز ریسپانسیو برای موبایل */
@media (max-width: 576px) {
    table td.sticky-col {
        min-width: 120px ;
        font-size: 12px;
    }
}
@media (max-width: 576px) {
    table td{
        font-size: 11px;
    }
}
.bg-white.shadow-sm.rounded {
    border: 1px solid #e5e7eb;
    background-color: #f9fafb;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
  background: #fff;
  border-radius: 12px;
  padding: 6px 12px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  direction: rtl; /* متن سمت راست */
}

.search-box input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 14px;
  background: transparent;
  padding-left: 60px; /* جا برای آیکن‌ها سمت چپ */
}

/* آیکن جستجو (دکمه submit) */
.search-icon {
  position: absolute;
  left: 12px;
  background: none;
  border: none;
  color: #555;
  font-size: 15px;
  cursor: pointer;
}

/* دکمه پاک کردن */
.clear-btn {
  position: absolute;
  left: 40px;   /* دقیقا کنار آیکن جستجو */
  background: none;
  border: none;
  color: #aaa;
  font-size: 15px;
  cursor: pointer;
  display: none;
}

.clear-btn:hover {
  color: #dc3545; /* قرمز روی hover */
}

.suggest-box {
  position: absolute;
  top: 100%;
  right: 0;
  left: 0;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  max-height: 240px;
  overflow-y: auto;
  z-index: 1000;
}
/* اسکرول‌بار سفارشی */
.suggest-box::-webkit-scrollbar {
    width: 5px;
}

.suggest-box::-webkit-scrollbar-thumb {
    background: #c7c7c7;
    border-radius: 10px;
}

.suggest-box::-webkit-scrollbar-track {
    background: #f1f1f1;
}

/* حذف کامل فلش‌های بالا/پایین */
.suggest-box::-webkit-scrollbar-button {
    display: none;
    height: 0;
}
.suggest-item {
  padding: 8px 12px;
  cursor: pointer;
  font-size: 0.9rem;
  color: #111827;
  display: flex;
  justify-content: space-between;
}
.suggest-item:hover {
  background: #f0f9ff;
}
.suggest-symbol {
  font-weight: 700;
  color: #0f172a;
}
.suggest-name {
  font-size: 0.85rem;
  color: #64748b;
}
#symbol-input::placeholder, #commoditySearch::placeholder {
    font-size: 12px;
    color: #999; /* دلخواه */
}
#symbol-input, #commoditySearch {
    font-size: 13px;
}

/* استاتوس */
.status-open,
.status-closed {
    font-size: 12px;
    vertical-align: middle;
}
.status-unknown {
    color: #00036d;
}

/* نام نماد (responsive) */
#market-symbol {
    font-size: 1rem;     /* پیش‌فرض: موبایل */
    font-weight: 700;
    color: #00036d;
    padding-right:6px;
}

@media (min-width: 576px) {   /* sm به بالا */
    #market-symbol {
        font-size: 1.25rem;
        padding-right:6px;
    }
}

@media (min-width: 768px) {   /* md به بالا */
    #market-symbol {
        font-size: 1.4rem;
    }
}

@media (min-width: 1200px) {  /* xl به بالا */
    #market-symbol {
        font-size: 1.5rem;
    }
}

/* نام شرکت */
#market-name {
    color: #00036d;
    font-size: clamp(0.80rem, 1vw + 0.8rem, 1.1rem);
}

/* قیمت پایانی */
.stock-close {
    font-size: 0.85rem;
    line-height: 1.3;
}

/* درصد تغییر */
.stock-change {
    display: inline-block;
    font-size: 0.8rem;
    margin-left: 0.25rem;
}

/* فلش بالا/پایین */
.stock-arrow {
    font-size: 0.85rem;
    margin-left: 0.2rem;
}


/* باکس اطلاعات بازار همیشه همین‌قدر فضا نگه دارد */
#market-data-container{
  min-height: 64px;            /* بسته به طراحی‌ات: 56-72px خوبه */
}

/* وقتی نمی‌خواهیم نمایش بدهیم، فقط نامرئی شود اما فضا حفظ شود */
.market-hidden{
  visibility: hidden;           /* فضا حفظ می‌شود */
  pointer-events: none;         /* کلیک نخورد */
  opacity: 0;                   /* محو */
}


/* ستون اول (شرح) فیکس شود */
table th.sticky-col-shareholder,
table td.sticky-col-shareholder {
    position: sticky;
    right: 0; /* چون راست به چپ هست، باید از right استفاده شود */
    z-index: 2;
    text-align: right;
    direction: rtl;
}
/* تنظیم متن چندخطی برای ستون شرح */
table td.sticky-col-shareholder {
    max-width: 90px;
    font-size: 12px;
    white-space: normal;
    overflow-wrap: break-word;
    word-break: break-word;
}

/* بالاتر بردن header */
table thead th.sticky-col-shareholder {
    z-index: 5
}
/* فونت و سایز ریسپانسیو برای موبایل */
@media (max-width: 576px) {
    table td.sticky-col-shareholder {
        min-width: 80px ;
        font-size: 12px;
    }
}
.shareholder-info {
font-size: clamp(10px, 12px, 14px);
line-height: 2;
}
@media (max-width: 576px) {
.shareholder-info {
font-size: clamp(9px, 12px, 14px);
text-align: center;
}
}
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
/* سلول قیمت به‌طور کلی */
.price-cell {
transition: background-color 0.8s ease-out;
}

/* وقتی قیمت عوض شده باشد */
.price-cell.price-changed {
animation: priceHighlight 1.5s ease-out;
}

@keyframes priceHighlight {
0%   { background-color: #fff3a3; }  /* زرد پررنگ */
60%  { background-color: #fff9c4; }  /* زرد ملایم‌تر */
100% { background-color: transparent; } /* برگرد به حالت عادی */
}

/* ========== Skeleton Loading برای صفحات سیگنال هوشمند ========== */

.fm-skeleton-line {
  display: inline-block;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, #e5e7eb, #f9fafb, #e5e7eb);
  background-size: 200% 100%;
  animation: fm-skeleton-loading 1.1s ease-in-out infinite;
}

@keyframes fm-skeleton-loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.fm-skeleton-wrapper {
  padding: 1.25rem 0.75rem;
}

.fm-skeleton-table table {
  margin-bottom: 0;
}

.fm-skeleton-table .fm-skeleton-line {
  height: 9px;
}

.fm-marketdata-skeleton .card-skeleton {
  background: #ffffff;
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
  border: 1px solid rgba(148, 163, 184, 0.35);
}

.fm-blur {
  filter: blur(2px);
  opacity: 0.6;
  pointer-events: none;
  transition: filter 0.2s ease, opacity 0.2s ease;
}

/* ==========================
   Fundamental Header layout (market data + quickbar)
   ========================== */
.fm-header-info{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

/* مارکت دیتا همیشه فضای اصلی را بگیرد */
.fm-market-wrap{
  flex: 1 1 auto;
  min-width: 0;
}

/* ستون quickbar عرضش اتومات باشد */
.sd-quickbar-col{
  flex: 0 0 auto;
  margin-left:1%;
  text-align: left;   /* در دسکتاپ سمت چپ */
}

/* موبایل: زیر هم بیفتند */
@media (max-width: 767.98px){
  .fm-header-info{
    flex-direction: column;
    align-items: stretch;
  }
  .sd-quickbar-col{
    margin-top:-22px;
    text-align: right; /* در موبایل طبیعی‌تر برای RTL */
  }
}


/* ==========================
   Quickbar (همان طراحی صفحه جزئیات نماد)
   ========================== */
.sd-quickbar{
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;

  background: none;
  border: none;
  border-radius: 14px;

  padding: 6px 10px;
  min-height: 24px;
  max-width: 100%;
}

.sd-quickbar-text{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  line-height: 1;
  font-size: 0.88rem;
  font-weight: 800;
  color: #111827;
}

.sd-quickbar-ticker{ font-weight: 900; }
.sd-quickbar-muted{ color: #6b7280; font-weight: 700; }

.sd-quickbar-icons{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  direction: ltr;
}

.sd-quickicon{
  width: 34px;
  height: 34px;
  border-radius: 10px;

  background: #ffffff;
  border: 1px solid rgba(203,213,225,.95);
  display: grid;
  place-items: center;
  text-decoration: none;

  color: #1d4ed8;
  box-shadow: 0 4px 12px rgba(15,23,42,.06);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease, background-color .15s ease;
}

.sd-quickicon i{
  font-size: 1.05rem;
  line-height: 1;
}

.sd-quickicon:hover{
  background: #eef2ff;
  transform: translateY(-1px);
  border-color: rgba(37,99,235,.35);
  box-shadow: 0 8px 16px rgba(15,23,42,.10);
}

.sd-quickicon:focus-visible{
  outline: 3px solid rgba(37,99,235,.28);
  outline-offset: 2px;
}

.sd-quickicon.disabled{
  opacity: .45;
  pointer-events: none;
  box-shadow: none;
}

/* Active state برای همین صفحه */
.sd-quickicon.is-active{
  background: #eef2ff;
  border-color: rgba(37,99,235,.35);
  color: #1d4ed8;
  box-shadow: none;
}

@media (max-width: 360px){
  .sd-quickbar-muted{ display:none; }
  .sd-quickicon{ width:32px; height:32px; }
}


/* ==========================
   Professional Tooltip Style
   ========================== */
.sd-tooltip .tooltip-inner{
  background: #0b1220;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 10px;
  box-shadow: 0 12px 28px rgba(15,23,42,.22);
  direction: rtl;
  text-align: center;
  letter-spacing: .1px;
}

.sd-tooltip.bs-tooltip-top .tooltip-arrow::before    { border-top-color: #0b1220; }
.sd-tooltip.bs-tooltip-bottom .tooltip-arrow::before { border-bottom-color: #0b1220; }
.sd-tooltip.bs-tooltip-start .tooltip-arrow::before  { border-left-color: #0b1220; }
.sd-tooltip.bs-tooltip-end .tooltip-arrow::before    { border-right-color: #0b1220; }

.sd-tooltip.show .tooltip-inner{
  animation: sdTooltipPop .14s ease-out;
}
@keyframes sdTooltipPop{
  from { transform: translateY(2px) scale(.98); opacity: .0; }
  to   { transform: translateY(0) scale(1); opacity: 1; }
}
