/* ============================================================
   SMART INDICATORS FLOATING TAB (سمارت تاب المؤشرات الذكية)
   ============================================================ */

/* --- Floating Drawer Container --- */
.smart-indicators-drawer {
  position: absolute;
  top: 16px;
  left: 16px;
  width: 360px;
  max-width: calc(100% - 32px);
  max-height: calc(100% - 32px);
  background: rgba(9, 30, 18, 0.92);
  border: 1px solid rgba(52, 211, 153, 0.4);
  border-radius: 18px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 25px rgba(52, 211, 153, 0.15);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  color: #ffffff;
  font-family: 'Tajawal', 'Cairo', sans-serif;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-10px) scale(0.96);
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  direction: rtl;
}

.smart-indicators-drawer.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

/* --- Header Section --- */
.si-header {
  padding: 14px 16px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(6, 182, 212, 0.1));
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.si-header-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
  min-width: 0;
}

.si-header-title {
  font-size: 14px;
  font-weight: 800;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.si-header-title i {
  color: #34d399;
  font-size: 15px;
}

.si-scope-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  color: #a7f3d0;
  background: rgba(52, 211, 153, 0.12);
  border: 1px solid rgba(52, 211, 153, 0.25);
  padding: 3px 8px;
  border-radius: 8px;
  width: fit-content;
}

.si-close-btn {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #e2e8f0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.si-close-btn:hover {
  background: #ef4444;
  color: #ffffff;
  transform: rotate(90deg);
}

/* --- Category Filter Dropdown --- */
.si-nav-tabs {
  position: relative;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.si-group-select {
  position: relative;
  width: 100%;
}

.si-group-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid rgba(52, 211, 153, 0.35);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.18), rgba(5, 150, 105, 0.1));
  color: #ffffff;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s ease;
}

.si-group-trigger:hover {
  border-color: rgba(52, 211, 153, 0.6);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.26), rgba(5, 150, 105, 0.16));
}

.si-group-trigger.open {
  border-color: #34d399;
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.18);
}

.si-group-trigger-label {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.si-group-trigger-label i {
  color: #34d399;
  font-size: 13px;
  flex-shrink: 0;
}

.si-group-trigger-icon {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.75);
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.si-group-trigger.open .si-group-trigger-icon {
  transform: rotate(180deg);
}

.si-group-list {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  left: 0;
  z-index: 20;
  background: rgba(10, 34, 21, 0.98);
  border: 1px solid rgba(52, 211, 153, 0.4);
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  max-height: 260px;
  overflow-y: auto;
}

.si-group-list.open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: all;
}

.si-group-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.75);
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  text-align: right;
  cursor: pointer;
  transition: all 0.15s ease;
}

.si-group-option:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.si-group-option.active {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff;
}

.si-group-option i {
  font-size: 12px;
  flex-shrink: 0;
  color: inherit;
  opacity: 0.9;
}

/* --- Body & Indicators Grid --- */
.si-body {
  padding: 14px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 420px;
}

.si-metric-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.si-metric-card:hover {
  background: rgba(52, 211, 153, 0.1);
  border-color: rgba(52, 211, 153, 0.35);
  transform: translateX(-4px);
}

.si-metric-card.active-map-metric {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.18), rgba(217, 119, 6, 0.12));
  border-color: #f59e0b;
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.25);
}

.si-metric-label {
  font-size: 12px;
  font-weight: 700;
  color: #e2e8f0;
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.si-metric-card.active-map-metric .si-metric-label {
  color: #fef08a;
}

.si-metric-val-wrap {
  display: flex;
  align-items: baseline;
  gap: 4px;
  flex-shrink: 0;
}

.si-metric-value {
  font-size: 14px;
  font-weight: 900;
  color: #34d399;
}

.si-metric-card.active-map-metric .si-metric-value {
  color: #f59e0b;
}

.si-metric-unit {
  font-size: 10px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.6);
}

/* --- Bio-Analysis Drawer --- */
.bio-analysis-drawer {
  position: absolute;
  top: 16px;
  left: 16px;
  width: 360px;
  max-width: calc(100% - 32px);
  max-height: calc(100% - 32px);
  background: rgba(9, 30, 18, 0.92);
  border: 1px solid rgba(52, 211, 153, 0.4);
  border-radius: 18px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 25px rgba(52, 211, 153, 0.15);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  color: #ffffff;
  font-family: 'Tajawal', 'Cairo', sans-serif;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-10px) scale(0.96);
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  direction: rtl;
}

.bio-analysis-drawer.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

/* --- Map Trigger Buttons --- */
.smart-tab-trigger-btn {
  background: linear-gradient(135deg, #10b981, #059669) !important;
  border: 1px solid rgba(52, 211, 153, 0.4) !important;
  color: #ffffff !important;
  font-weight: 800 !important;
  font-family: 'Tajawal', 'Cairo', sans-serif;
  font-size: 12px !important;
  padding: 0 12px !important;
  height: 32px !important;
  border-radius: 8px !important;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.25);
  transition: all 0.2s ease;
  white-space: nowrap;
}

.smart-tab-trigger-btn i {
  font-size: 13px;
}

.smart-tab-trigger-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(16, 185, 129, 0.4);
  background: linear-gradient(135deg, #34d399, #10b981) !important;
}

.smart-tab-trigger-btn.active {
  background: linear-gradient(135deg, #f59e0b, #d97706) !important;
  border-color: #f59e0b !important;
  box-shadow: 0 3px 10px rgba(245, 158, 11, 0.45);
}

.bio-tab-trigger-btn {
  background: linear-gradient(135deg, #0284c7, #06b6d4) !important;
  border: 1px solid rgba(6, 182, 212, 0.4) !important;
  color: #ffffff !important;
  font-weight: 800 !important;
  font-family: 'Tajawal', 'Cairo', sans-serif;
  font-size: 12px !important;
  padding: 0 12px !important;
  height: 32px !important;
  border-radius: 8px !important;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  box-shadow: 0 2px 6px rgba(6, 182, 212, 0.25);
  transition: all 0.2s ease;
  white-space: nowrap;
}

.bio-tab-trigger-btn i {
  font-size: 13px;
}

.bio-tab-trigger-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(6, 182, 212, 0.4);
  background: linear-gradient(135deg, #38bdf8, #0ea5e9) !important;
}

.bio-tab-trigger-btn.active {
  background: linear-gradient(135deg, #f59e0b, #d97706) !important;
  border-color: #f59e0b !important;
  box-shadow: 0 3px 10px rgba(245, 158, 11, 0.45);
}

@media (max-width: 640px) {
  .smart-tab-trigger-btn, .bio-tab-trigger-btn {
    font-size: 11px !important;
    padding: 0 8px !important;
  }
}
