/* ============================================================
 * TradOpiax — PROFESSIONAL SETTINGS SUITE (Quotex / TradingView Caliber)
 * Desktop: Split-view Master/Detail Pane with User Card & Cluster Status
 * Mobile: Bottom-sheet Dialog with Horizontal Pill Navigation Bar
 * Smooth Micro-Animations, Glassmorphism, Zero-Regression Architecture
 * ============================================================ */

/* ── Universal Box Sizing & Reset for Settings Modal ── */
.settings-overlay,
.settings-overlay * {
  box-sizing: border-box;
}

/* ── Modal Overlay & Backdrop ── */
.settings-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(4, 8, 16, 0.78);
  backdrop-filter: blur(14px) saturate(180%);
  -webkit-backdrop-filter: blur(14px) saturate(180%);
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.settings-overlay.show {
  display: flex;
  opacity: 1;
}

/* ── Settings Modal Container (Desktop Master/Detail Frame) ── */
.settings-modal {
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.95), rgba(10, 16, 31, 0.98));
  width: 920px;
  max-width: 94vw;
  height: 640px;
  max-height: 90vh;
  border-radius: 22px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.75), 0 0 45px rgba(56, 189, 248, 0.08);
  transform: translateY(22px) scale(0.97);
  transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1), background 0.3s ease;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
}

.settings-overlay.show .settings-modal {
  transform: translateY(0) scale(1);
}

/* ── Mobile Drag / Pull Handle (Hidden on Desktop) ── */
.st-mobile-handle {
  display: none;
  width: 100%;
  height: 18px;
  justify-content: center;
  align-items: center;
  flex-shrink: 0;
  cursor: grab;
}

.st-mobile-handle::after {
  content: "";
  width: 38px;
  height: 4px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 2px;
}

/* ── Header Bar ── */
.settings-header {
  height: 64px;
  padding: 0 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(20, 29, 47, 0.55);
  backdrop-filter: blur(16px);
  flex-shrink: 0;
}

.settings-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.settings-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.settings-title-icon-badge {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.18), rgba(14, 165, 233, 0.3));
  border: 1px solid rgba(56, 189, 248, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  box-shadow: 0 4px 12px rgba(56, 189, 248, 0.15);
  flex-shrink: 0;
}

.settings-title {
  font-size: 16px;
  font-weight: 800;
  color: #ffffff;
  display: flex;
  align-items: center;
  letter-spacing: -0.2px;
  line-height: 1.2;
  white-space: nowrap;
}

.settings-subtitle {
  font-size: 11px;
  font-weight: 500;
  color: var(--text3, #94a3b8);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.settings-header-right {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

/* Live Cluster Ping Badge */
.settings-ping-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 20px;
  cursor: default;
  flex-shrink: 0;
}

.ping-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  position: relative;
  display: inline-block;
  flex-shrink: 0;
}

.ping-dot::after {
  content: "";
  position: absolute;
  top: -3px; left: -3px; right: -3px; bottom: -3px;
  border-radius: 50%;
  border: 1.5px solid #10b981;
  animation: stPingRadar 2.2s cubic-bezier(0.24, 0, 0.38, 1) infinite;
}

@keyframes stPingRadar {
  0% { transform: scale(0.6); opacity: 1; }
  100% { transform: scale(2.4); opacity: 0; }
}

.ping-text {
  font-size: 11px;
  font-weight: 700;
  font-family: 'JetBrains Mono', 'Roboto Mono', monospace;
  color: #10b981;
  letter-spacing: 0.2px;
  white-space: nowrap;
}

/* Close Button */
.settings-close-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text3, #94a3b8);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.22s ease;
  line-height: 1;
  flex-shrink: 0;
}

.settings-close-btn:hover {
  background: rgba(239, 68, 68, 0.22);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.4);
  transform: rotate(90deg) scale(1.05);
}

/* ══════════════════════════════════════════════════
 * Settings Container (Split-Pane Architecture)
 * ══════════════════════════════════════════════════ */
.settings-container {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  position: relative;
}

/* ── Navigation Sidebar (Desktop) ── */
.settings-nav {
  width: 260px;
  flex-shrink: 0;
  background: rgba(13, 20, 36, 0.7);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  padding: 16px 14px;
  gap: 14px;
  backdrop-filter: blur(12px);
}

/* User Profile Quick Card */
.st-user-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.65), rgba(15, 23, 42, 0.85));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 10px 12px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  flex-shrink: 0;
}

.st-user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0284c7, #0369a1);
  border: 2px solid rgba(56, 189, 248, 0.45);
  color: #ffffff;
  font-weight: 800;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.25);
  text-transform: uppercase;
}

.st-user-details {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.st-user-name {
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.st-user-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10.5px;
  font-weight: 700;
  color: #10b981;
}

.st-badge-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 6px #10b981;
  flex-shrink: 0;
}

/* Nav Item List */
.st-nav-items {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-height: 0;
}

.st-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 12px;
  color: var(--text2, #94a3b8);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  outline: none;
}

.st-nav-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #ffffff;
  transform: translateX(3px);
}

.st-nav-item.active {
  background: linear-gradient(90deg, rgba(56, 189, 248, 0.16), rgba(56, 189, 248, 0.03));
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #38bdf8;
  font-weight: 700;
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.1);
}

.st-nav-item.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 3px;
  background: #38bdf8;
  border-radius: 0 3px 3px 0;
  box-shadow: 0 0 8px #38bdf8;
}

.st-nav-item.danger-tab:hover {
  background: rgba(239, 68, 68, 0.08);
  color: #ef4444;
}

.st-nav-item.danger-tab.active {
  background: linear-gradient(90deg, rgba(239, 68, 68, 0.18), rgba(239, 68, 68, 0.04));
  border-color: rgba(239, 68, 68, 0.4);
  color: #ef4444;
}

.st-nav-item.danger-tab.active::before {
  background: #ef4444;
  box-shadow: 0 0 8px #ef4444;
}

.st-nav-icon {
  font-size: 16px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.st-nav-label {
  flex: 1;
  white-space: nowrap;
}

/* Nav Footer (Sidebar Version & Trust Badge) */
.st-nav-footer {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10px;
  color: var(--text3, #64748b);
  font-weight: 600;
  flex-shrink: 0;
}

/* ── Content Pane (Desktop Right Side) ── */
.settings-content-pane {
  flex: 1;
  min-height: 0;
  min-width: 0;
  overflow-y: auto;
  padding: 22px 26px 30px;
  position: relative;
}

.settings-content-pane::-webkit-scrollbar {
  width: 6px;
}

.settings-content-pane::-webkit-scrollbar-track {
  background: transparent;
}

.settings-content-pane::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 10px;
}

.settings-content-pane::-webkit-scrollbar-thumb:hover {
  background: rgba(56, 189, 248, 0.45);
}

/* ── Tab Panels & Transitions ── */
.settings-tab-panel {
  display: none;
}

.settings-tab-panel.active {
  display: block;
  animation: panelFadeSlide 0.28s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes panelFadeSlide {
  0% {
    opacity: 0;
    transform: translateY(8px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.st-panel-header {
  margin-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding-bottom: 12px;
}

.st-panel-title {
  font-size: 16px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.2px;
}

.st-panel-sub {
  font-size: 11.5px;
  color: var(--text3, #94a3b8);
  margin-top: 3px;
  line-height: 1.4;
}

/* ── Back Navigation Button for Subviews ── */
.st-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 6px 12px;
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.st-back-btn:hover {
  background: rgba(56, 189, 248, 0.16);
  border-color: #38bdf8;
  color: #38bdf8;
  transform: translateX(-2px);
}

/* ── Security Trust Banner ── */
.st-security-banner {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.12), rgba(6, 182, 212, 0.08));
  border: 1px solid rgba(16, 185, 129, 0.28);
  border-radius: 14px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 4px;
}

.st-sec-icon {
  font-size: 24px;
  flex-shrink: 0;
}

.st-sec-info {
  flex: 1;
  min-width: 0;
}

.st-sec-title {
  font-size: 13px;
  font-weight: 700;
  color: #10b981;
}

.st-sec-desc {
  font-size: 11px;
  color: var(--text3, #94a3b8);
  margin-top: 2px;
  line-height: 1.4;
}

/* ══════════════════════════════════════════════════
 * Premium Card Grid Layout
 * ══════════════════════════════════════════════════ */
.st-cards-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.st-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: rgba(30, 41, 59, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 14px;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
  animation: cardStagger 0.32s cubic-bezier(0.16, 1, 0.3, 1) both;
  width: 100%;
}

/* Staggered entrance animation delays */
.st-card:nth-child(1) { animation-delay: 0.02s; }
.st-card:nth-child(2) { animation-delay: 0.05s; }
.st-card:nth-child(3) { animation-delay: 0.08s; }
.st-card:nth-child(4) { animation-delay: 0.11s; }
.st-card:nth-child(5) { animation-delay: 0.14s; }
.st-card:nth-child(6) { animation-delay: 0.17s; }

@keyframes cardStagger {
  0% {
    opacity: 0;
    transform: translateY(10px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.st-card.clickable {
  cursor: pointer;
}

.st-card.clickable:hover {
  background: rgba(30, 41, 59, 0.75);
  border-color: rgba(56, 189, 248, 0.35);
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35), 0 0 15px rgba(56, 189, 248, 0.12);
}

.st-card.clickable:active {
  transform: scale(0.985);
}

.st-card.logout-card:hover {
  border-color: rgba(244, 63, 94, 0.4);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35), 0 0 15px rgba(244, 63, 94, 0.15);
}

.st-card.delete-card:hover {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.4);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35), 0 0 15px rgba(239, 68, 68, 0.18);
}

/* ── Icon Badges ── */
.st-card-icon-badge {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s ease;
}

.st-card:hover .st-card-icon-badge {
  transform: scale(1.08);
}

.st-card-icon-badge.emerald {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.25), rgba(5, 150, 105, 0.4));
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #10b981;
}

.st-card-icon-badge.gold {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.25), rgba(217, 119, 6, 0.4));
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #fbbf24;
}

.st-card-icon-badge.cyan {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.25), rgba(8, 145, 178, 0.4));
  border: 1px solid rgba(6, 182, 212, 0.35);
  color: #22d3ee;
}

.st-card-icon-badge.blue {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.25), rgba(37, 99, 235, 0.4));
  border: 1px solid rgba(59, 130, 246, 0.35);
  color: #3b82f6;
}

.st-card-icon-badge.violet {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.25), rgba(124, 58, 237, 0.4));
  border: 1px solid rgba(139, 92, 246, 0.35);
  color: #a78bfa;
}

.st-card-icon-badge.amber {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.25), rgba(180, 83, 9, 0.4));
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #f59e0b;
}

.st-card-icon-badge.sky {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.25), rgba(2, 136, 209, 0.4));
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #38bdf8;
}

.st-card-icon-badge.rose {
  background: linear-gradient(135deg, rgba(244, 63, 94, 0.25), rgba(225, 29, 72, 0.4));
  border: 1px solid rgba(244, 63, 94, 0.35);
  color: #fb7185;
}

.st-card-icon-badge.red-glow {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.25), rgba(185, 28, 28, 0.4));
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #ef4444;
}

/* ── Card Content ── */
.st-card-info {
  flex: 1;
  min-width: 0; /* ESSENTIAL to allow text wrap in flexbox */
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.st-card-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.1px;
  line-height: 1.3;
}

.st-card-title.danger {
  color: #ff5252;
}

.st-card-sub {
  font-size: 11px;
  color: var(--text3, #94a3b8);
  line-height: 1.35;
  word-break: break-word;
}

.st-card-action {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.st-card-arrow {
  color: var(--text3, #94a3b8);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, color 0.2s ease;
}

.st-card.clickable:hover .st-card-arrow {
  color: #38bdf8;
  transform: translateX(3px);
}

.st-card-arrow.danger {
  color: rgba(239, 68, 68, 0.6);
}

.st-card.clickable:hover .st-card-arrow.danger {
  color: #ef4444;
}

/* ── Modern Dropdown Select ── */
.st-select-modern {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #ffffff;
  padding: 7px 12px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  outline: none;
  cursor: pointer;
  transition: all 0.2s ease;
  max-width: 100%;
}

.st-select-modern:hover,
.st-select-modern:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.25);
}

/* ── Time Zone Settings Select & Real-time Live Badge ── */
.tz-action-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  max-width: 180px;
}

.tz-action-wrap select.st-select-modern {
  width: 100%;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
  font-size: 11px;
  padding: 5px 8px;
}

.tz-preview-badge {
  font-size: 10px;
  font-weight: 700;
  font-family: 'JetBrains Mono', 'Roboto Mono', monospace;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 6px;
  padding: 2px 7px;
  white-space: nowrap;
  letter-spacing: 0.2px;
}

/* ── Neon Custom Toggle Switch ── */
.st-neon-toggle {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
  cursor: pointer;
  flex-shrink: 0;
}

.st-neon-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.st-toggle-track {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 26px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.st-toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: #ffffff;
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.st-neon-toggle input:checked + .st-toggle-track {
  background: linear-gradient(135deg, #0284c7, #38bdf8);
  border-color: #38bdf8;
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.45);
}

.st-neon-toggle input:checked + .st-toggle-track .st-toggle-thumb {
  transform: translateX(22px);
}

/* ── Status Pill ── */
.st-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 12px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.st-status-pill.online {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #10b981;
}

/* ══════════════════════════════════════════════════
 * Sub-Views (Change Password, Sessions, Customizer)
 * ══════════════════════════════════════════════════ */
.pwd-group {
  position: relative;
}

.pwd-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.pwd-input {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 10px 40px 10px 12px;
  background: rgba(15, 23, 42, 0.6);
  color: #ffffff;
  font-family: inherit;
  font-size: 13px;
  outline: none;
  transition: all 0.2s ease;
}

.pwd-input:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.25);
}

.pwd-toggle {
  position: absolute;
  right: 12px;
  cursor: pointer;
  color: var(--text3, #94a3b8);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
}

.pwd-toggle:hover {
  color: #ffffff;
}

.pwd-strength-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}

.pwd-strength-bar {
  flex: 1;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
}

.pwd-strength-fill {
  height: 100%;
  width: 0%;
  background: #ff5252;
  border-radius: 2px;
  transition: width 0.3s ease, background-color 0.3s ease;
}

.pwd-strength-text {
  font-size: 11px;
  font-weight: 600;
  color: var(--text3, #94a3b8);
  min-width: 40px;
  text-align: right;
}

.cp-btn {
  flex: 1;
  padding: 12px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.cp-btn:active {
  transform: scale(0.98);
}

.cp-cancel {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.cp-cancel:hover {
  background: rgba(255, 255, 255, 0.1);
}

.cp-save {
  background: linear-gradient(135deg, #0284c7, #0369a1);
  color: #fff;
  border: none;
  box-shadow: 0 4px 15px rgba(2, 132, 199, 0.35);
}

.cp-save:hover {
  box-shadow: 0 6px 20px rgba(56, 189, 248, 0.5);
  transform: translateY(-1px);
}

.cp-save:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.cp-loader {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: cpSpin 0.8s linear infinite;
}

@keyframes cpSpin {
  to { transform: rotate(360deg); }
}

/* Toast */
.cp-toast {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  padding: 10px 18px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  background: #1e293b;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  gap: 8px;
}

.cp-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.cp-toast.success {
  background: rgba(16, 185, 129, 0.95);
  border: 1px solid rgba(16, 185, 129, 1);
}

.cp-toast.error {
  background: rgba(239, 68, 68, 0.95);
  border: 1px solid rgba(239, 68, 68, 1);
}

/* ── Chart Customization Cards ── */
.cc-section-card {
  background: rgba(30, 41, 59, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 14px 16px;
  backdrop-filter: blur(10px);
}

.cc-section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.cc-section-icon {
  font-size: 16px;
}

.cc-section-title {
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
}

.cc-color-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

.cc-color-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cc-color-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text3, #94a3b8);
}

.cc-picker-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 4px 8px;
}

.cc-picker-wrap input[type="color"] {
  -webkit-appearance: none;
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  cursor: pointer;
  background: transparent;
  padding: 0;
}

.cc-picker-wrap input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}

.cc-picker-wrap input[type="color"]::-webkit-color-swatch {
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
}

.cc-color-hex {
  font-size: 11px;
  font-weight: 700;
  font-family: monospace;
  color: #ffffff;
}

.cc-presets-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text3, #94a3b8);
  margin-bottom: 8px;
}

.cc-presets-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.cc-preset-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 8px 10px;
  color: #ffffff;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.cc-preset-btn:hover {
  border-color: #38bdf8;
  background: rgba(56, 189, 248, 0.1);
}

.cc-preset-btn.active {
  border-color: #38bdf8;
  background: rgba(56, 189, 248, 0.18);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.25);
}

.cc-preset-swatch {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: inset 0 0 2px rgba(0, 0, 0, 0.3);
}

.cc-upload-area {
  background: rgba(15, 23, 42, 0.5);
  border: 1.5px dashed rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  transition: border-color 0.2s ease;
}

.cc-upload-area:hover {
  border-color: #38bdf8;
}

.cc-upload-ph {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.cc-upload-icon {
  font-size: 24px;
  margin-bottom: 4px;
}

.cc-upload-btn {
  margin-top: 8px;
  background: linear-gradient(135deg, #0284c7, #0369a1);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 6px 14px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.2s ease;
}

.cc-upload-btn:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.cc-preview-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.cc-preview-wrap img {
  max-height: 100px;
  max-width: 100%;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  object-fit: cover;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.cc-remove-img-btn {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.cc-remove-img-btn:hover {
  background: #ef4444;
  color: #fff;
}

.cc-slider-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cc-slider-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--text3, #94a3b8);
}

.cc-opacity-val {
  color: #38bdf8;
  font-weight: 700;
  font-family: monospace;
}

.cc-range-slider {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.12);
  outline: none;
  margin: 6px 0 2px 0;
}

.cc-range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #38bdf8;
  cursor: pointer;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.6);
  transition: transform 0.15s ease;
}

.cc-range-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

.cc-slider-ticks {
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  color: var(--text3, #94a3b8);
}

/* ── Enhanced Chart Customization Controls ── */
.cc-presets-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.cc-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 10px 12px;
  margin-top: 10px;
}

.cc-toggle-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cc-toggle-title {
  font-size: 11.5px;
  font-weight: 700;
  color: #ffffff;
}

.cc-toggle-desc {
  font-size: 10px;
  color: var(--text3, #94a3b8);
}

.cc-width-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-top: 8px;
}

.cc-width-btn {
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 6px 4px;
  color: var(--text2, #94a3b8);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s ease;
}

.cc-width-btn:hover {
  border-color: #38bdf8;
  color: #fff;
}

.cc-width-btn.active {
  border-color: #38bdf8;
  background: rgba(56, 189, 248, 0.18);
  color: #38bdf8;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.25);
}

.cc-switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
}

.cc-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.cc-slider-round {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.15);
  transition: .3s;
  border-radius: 22px;
}

.cc-slider-round:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}

.cc-switch input:checked + .cc-slider-round {
  background-color: #38bdf8;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.4);
}

.cc-switch input:checked + .cc-slider-round:before {
  transform: translateX(18px);
}

/* ══════════════════════════════════════════════════
 * Light Theme Support
 * ══════════════════════════════════════════════════ */
body.light-mode .settings-modal {
  background: rgba(255, 255, 255, 0.96);
  border-color: rgba(0, 0, 0, 0.1);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
}

body.light-mode .settings-header {
  background: rgba(245, 247, 250, 0.9);
  border-bottom-color: rgba(0, 0, 0, 0.08);
}

body.light-mode .settings-nav {
  background: rgba(241, 245, 249, 0.85);
  border-right-color: rgba(0, 0, 0, 0.08);
}

body.light-mode .settings-title {
  color: #0f172a;
}

body.light-mode .st-panel-title {
  color: #0f172a;
}

body.light-mode .st-user-card {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.08);
}

body.light-mode .st-user-name {
  color: #0f172a;
}

body.light-mode .st-nav-item:hover {
  background: rgba(0, 0, 0, 0.04);
  color: #0f172a;
}

body.light-mode .st-card {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.08);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
}

body.light-mode .st-card-title {
  color: #0f172a;
}

body.light-mode .st-select-modern {
  background: #f8fafc;
  border-color: rgba(0, 0, 0, 0.12);
  color: #0f172a;
}

body.light-mode .cc-section-card {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.08);
}

body.light-mode .cc-section-title {
  color: #0f172a;
}

body.light-mode .pwd-input {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.12);
  color: #0f172a;
}

/* ── Chart Customization Panel Always Visible When Active ── */
.settings-tab-panel#stPanelChart .settings-body,
#stPanelChart #chartCustomizationView {
  display: block !important;
}

/* ══════════════════════════════════════════════════
 * RESPONSIVE MOBILE EXPERIENCE (Smartphones & Tablets < 768px)
 * Bottom-Sheet Modal + Horizontal Scrollable Pill Navigation
 * ══════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .settings-overlay {
    align-items: flex-end; /* Pin to bottom sheet */
    padding: 0;
  }

  .settings-modal {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100%;
    height: 92vh;
    max-height: 92vh;
    border-radius: 28px 28px 0 0;
    border-left: none;
    border-right: none;
    border-bottom: none;
    border-top: 1px solid rgba(56, 189, 248, 0.25);
    transform: translateY(100%);
    box-shadow: 0 -15px 50px rgba(0, 0, 0, 0.85), 0 0 30px rgba(56, 189, 248, 0.1);
    background: linear-gradient(180deg, #0e172a 0%, #080d1a 100%);
  }

  .settings-overlay.show .settings-modal {
    transform: translateY(0);
  }

  /* Show mobile pull handle */
  .st-mobile-handle {
    display: flex;
    padding: 10px 0 4px;
  }

  .st-mobile-handle::after {
    width: 44px;
    height: 5px;
    background: rgba(255, 255, 255, 0.28);
    border-radius: 3px;
  }

  /* Header adjustments */
  .settings-header {
    height: 56px;
    padding: 0 16px;
    width: 100%;
    background: rgba(15, 23, 42, 0.7);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  .settings-header-left {
    min-width: 0;
    flex: 1;
  }

  .settings-title-wrap {
    gap: 10px;
    min-width: 0;
  }

  .settings-title-icon-badge {
    width: 32px;
    height: 32px;
    font-size: 16px;
    border-radius: 9px;
    flex-shrink: 0;
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.2), rgba(14, 165, 233, 0.35));
    border: 1px solid rgba(56, 189, 248, 0.35);
  }

  .settings-title {
    font-size: 16px;
    font-weight: 800;
  }

  .settings-subtitle {
    display: none;
  }

  .settings-header-right {
    gap: 8px;
    flex-shrink: 0;
  }

  .settings-ping-badge {
    padding: 3px 8px;
    border-radius: 14px;
  }

  .ping-dot {
    width: 6px;
    height: 6px;
  }

  .ping-text {
    font-size: 10px;
  }

  .settings-close-btn {
    width: 32px;
    height: 32px;
    font-size: 18px;
    background: rgba(255, 255, 255, 0.08);
  }

  /* Split Container turns into Column */
  .settings-container {
    flex-direction: column;
    overflow: hidden;
    width: 100%;
    min-width: 0;
  }

  /* Navigation: User Profile Card & Horizontal Carousel */
  .settings-nav {
    width: 100%;
    flex-shrink: 0;
    flex-direction: column;
    padding: 10px 14px 12px;
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(11, 18, 33, 0.92);
    gap: 10px;
    min-width: 0;
  }

  /* User Profile Bar on Mobile */
  .st-user-card {
    padding: 8px 12px;
    border-radius: 12px;
    gap: 10px;
    width: 100%;
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.8), rgba(15, 23, 42, 0.95));
    border: 1px solid rgba(255, 255, 255, 0.1);
  }

  .st-user-avatar {
    width: 34px;
    height: 34px;
    font-size: 12px;
  }

  .st-user-name {
    font-size: 13px;
  }

  .st-user-badge {
    font-size: 10px;
  }

  /* Horizontal Scrolling Category Carousel */
  .st-nav-items {
    flex-direction: row;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 8px;
    padding: 2px 0 4px;
    width: 100%;
    min-width: 0;
  }

  .st-nav-items::-webkit-scrollbar {
    display: none;
  }

  .st-nav-item {
    flex-shrink: 0;
    white-space: nowrap;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 12px;
    min-height: 36px;
    gap: 7px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text2, #94a3b8);
  }

  .st-nav-item:hover {
    transform: none;
  }

  .st-nav-item.active {
    background: linear-gradient(135deg, #0284c7, #0095ff);
    border-color: rgba(56, 189, 248, 0.5);
    color: #ffffff;
    font-weight: 700;
    box-shadow: 0 3px 14px rgba(0, 149, 255, 0.4);
  }

  .st-nav-item.active::before {
    display: none;
  }

  .st-nav-item.danger-tab.active {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    border-color: rgba(239, 68, 68, 0.5);
    color: #ffffff;
    box-shadow: 0 3px 14px rgba(239, 68, 68, 0.4);
  }

  .st-nav-item.danger-tab.active::before {
    display: none;
  }

  /* Hide Desktop Version Footer on Mobile */
  .st-nav-footer {
    display: none;
  }

  /* Content Pane on Mobile */
  .settings-content-pane {
    padding: 14px 14px 44px;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    overflow-x: hidden;
  }

  .st-panel-header {
    margin-bottom: 14px;
    padding-bottom: 10px;
  }

  .st-panel-title {
    font-size: 15px;
    font-weight: 800;
  }

  .st-panel-sub {
    font-size: 11px;
    color: var(--text3, #94a3b8);
  }

  /* Mobile Cards - Clean, Spacious & Touch Optimized */
  .st-cards-grid {
    gap: 10px;
    width: 100%;
  }

  .st-card {
    padding: 12px 14px;
    border-radius: 14px;
    min-height: 54px;
    width: 100%;
    gap: 12px;
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.55), rgba(15, 23, 42, 0.8));
    border: 1px solid rgba(255, 255, 255, 0.08);
  }

  .st-card-icon-badge {
    width: 38px;
    height: 38px;
    font-size: 18px;
    border-radius: 11px;
  }

  .st-card-info {
    min-width: 0;
  }

  .st-card-title {
    font-size: 13.5px;
    font-weight: 700;
  }

  .st-card-sub {
    font-size: 11px;
    color: var(--text3, #94a3b8);
    line-height: 1.35;
  }

  .tz-action-wrap {
    max-width: 130px;
    flex-shrink: 0;
  }

  .tz-action-wrap select.st-select-modern {
    font-size: 11px;
    padding: 5px 6px;
  }

  .tz-preview-badge {
    font-size: 9.5px;
    padding: 2px 6px;
  }

  .st-select-modern {
    padding: 6px 10px;
    font-size: 11.5px;
  }

  .st-neon-toggle {
    width: 46px;
    height: 25px;
  }

  .st-toggle-thumb {
    width: 17px;
    height: 17px;
  }

  .st-neon-toggle input:checked + .st-toggle-track .st-toggle-thumb {
    transform: translateX(21px);
  }

  /* Mobile Chart Customization Cards */
  .cc-section-card {
    padding: 12px 14px;
    border-radius: 14px;
  }

  .cc-color-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .cc-presets-grid {
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }

  .cc-presets-grid-3 {
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
  }

  .cc-preset-btn {
    padding: 6px 8px;
    font-size: 10.5px;
  }

  .cc-width-grid {
    gap: 4px;
  }

  .cc-width-btn {
    padding: 6px 2px;
    font-size: 10.5px;
  }

  .cc-upload-area {
    padding: 12px;
  }

  /* Sub-views on Mobile */
  .pwd-input {
    font-size: 13px;
    padding: 10px 36px 10px 10px;
  }

  .cp-btn {
    padding: 10px;
    font-size: 12.5px;
  }
}
