/* ============================================ */
/* === SETTINGS PANEL — APPLE-STYLE REDESIGN === */
/* ============================================ */

.stg-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px 20px 14px;
  flex-shrink: 0;
}

.stg-title {
  margin: 0;
  font-size: 18px;
  font-weight: 900;
  color: #fff;
  letter-spacing: 0.3px;
}

.stg-close-btn {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
}

.stg-close-btn:hover {
  background: rgba(255,255,255,0.14);
  color: #fff;
}

.stg-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 0 16px 24px;
  -ms-overflow-style: none;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.1) transparent;
}

.stg-scroll::-webkit-scrollbar { width: 4px; }
.stg-scroll::-webkit-scrollbar-track { background: transparent; }
.stg-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }

.stg-section {
  margin-bottom: 24px;
}

.stg-section-last {
  margin-bottom: 0;
  padding-bottom: 12px;
}

.stg-section-label {
  font-size: 12px;
  font-weight: 700;
  color: rgba(255,255,255,0.4);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 0 4px 8px;
}

.stg-card {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 14px;
  overflow: hidden;
}

.stg-divider {
  height: 1px;
  background: rgba(255,255,255,0.06);
  margin: 0 14px;
}

.stg-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 14px;
  min-height: 44px;
  box-sizing: border-box;
}

.stg-row-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.stg-row-icon {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: rgba(168,92,255,0.15);
  color: rgba(168,92,255,0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.stg-row-text {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
}

/* Slider rows */
.stg-slider-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
}

.stg-slider-label {
  font-size: 12px;
  font-weight: 600;
  color: rgba(255,255,255,0.5);
  min-width: 60px;
  flex-shrink: 0;
}

.stg-slider-row input[type="range"] {
  flex: 1;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: rgba(255,255,255,0.12);
  border-radius: 4px;
  outline: none;
  cursor: pointer;
}

.stg-slider-row input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.4);
  cursor: pointer;
  transition: transform 0.1s;
}

.stg-slider-row input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

.stg-slider-row input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.4);
  border: none;
  cursor: pointer;
}

/* Color row */
.stg-color-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
}

.stg-color-input {
  width: 36px;
  height: 28px;
  border: 2px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  padding: 0;
  background: none;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  overflow: hidden;
}

.stg-color-input::-webkit-color-swatch-wrapper { padding: 0; }
.stg-color-input::-webkit-color-swatch { border: none; border-radius: 5px; }

/* Segmented control (theme switcher) */
.stg-seg {
  display: flex;
  background: rgba(255,255,255,0.06);
  border-radius: 8px;
  padding: 2px;
  gap: 2px;
}

.stg-seg .theme-option,
.stg-seg .lang-option {
  flex: 1;
  text-align: center;
  padding: 5px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 700;
  font-size: 12px;
  color: rgba(255,255,255,0.5);
  transition: all 0.2s;
  white-space: nowrap;
}

.stg-seg .theme-option.active,
.stg-seg .lang-option.active {
  background: var(--accent, rgba(168,92,255,0.9));
  color: #fff;
  box-shadow: 0 2px 8px rgba(168,92,255,0.3);
}

/* Upload row */
.stg-upload-row {
  display: flex;
  gap: 8px;
  padding: 12px 14px;
}

.stg-upload-block {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
}

.stg-upload-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 14px 8px;
  border-radius: 12px;
  background: rgba(255,255,255,0.04);
  border: 1.5px dashed rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.55);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.stg-upload-btn:hover {
  background: rgba(168,92,255,0.08);
  border-color: rgba(168,92,255,0.3);
  color: rgba(255,255,255,0.8);
}

.stg-apply-mini {
  width: 100%;
  padding: 6px 0;
  border-radius: 8px;
  border: none;
  background: rgba(168,92,255,0.2);
  color: rgba(255,255,255,0.8);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}

.stg-apply-mini:hover {
  background: rgba(168,92,255,0.35);
  color: #fff;
}

/* Gallery */
.stg-gallery-wrap {
  padding: 12px 14px;
}

.stg-gallery-label {
  font-size: 12px;
  font-weight: 600;
  color: rgba(255,255,255,0.4);
  margin-bottom: 8px;
}

/* Danger button */
.stg-danger-btn {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 12px;
  border-radius: 12px;
  border: none;
  background: rgba(255,59,48,0.1);
  color: rgba(255,59,48,0.9);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
}

.stg-danger-btn:hover {
  background: rgba(255,59,48,0.2);
  color: #ff3b30;
}

/* ============================== */
/* === LIGHT THEME OVERRIDES === */
/* ============================== */

body.light-theme .settings-panel {
  background: rgba(245, 245, 247, 0.88);
}

body.light-theme .stg-title {
  color: #1c1c1e;
}

body.light-theme .stg-close-btn {
  background: rgba(0,0,0,0.06);
  color: rgba(0,0,0,0.5);
}

body.light-theme .stg-close-btn:hover {
  background: rgba(0,0,0,0.12);
  color: #1c1c1e;
}

body.light-theme .stg-section-label {
  color: rgba(0,0,0,0.4);
}

body.light-theme .stg-card {
  background: rgba(255,255,255,0.75);
  border-color: rgba(0,0,0,0.08);
}

body.light-theme .stg-divider {
  background: rgba(0,0,0,0.08);
}

body.light-theme .stg-row-icon {
  background: rgba(139,92,246,0.12);
  color: rgba(139,92,246,1);
}

body.light-theme .stg-row-text {
  color: #1c1c1e;
}

body.light-theme .stg-slider-label {
  color: rgba(0,0,0,0.45);
}

body.light-theme .stg-slider-row input[type="range"] {
  background: rgba(0,0,0,0.1);
}

body.light-theme .stg-slider-row input[type="range"]::-webkit-slider-thumb {
  background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.25);
}

body.light-theme .stg-color-input {
  border-color: rgba(0,0,0,0.12);
}

body.light-theme .stg-seg {
  background: rgba(0,0,0,0.06);
}

body.light-theme .stg-seg .theme-option,
body.light-theme .stg-seg .lang-option {
  color: rgba(0,0,0,0.45);
}

body.light-theme .stg-seg .theme-option.active,
body.light-theme .stg-seg .lang-option.active {
  color: #fff;
}

body.light-theme .stg-upload-btn {
  background: rgba(0,0,0,0.03);
  border-color: rgba(0,0,0,0.12);
  color: rgba(0,0,0,0.45);
}

body.light-theme .stg-upload-btn:hover {
  background: rgba(139,92,246,0.06);
  border-color: rgba(139,92,246,0.3);
  color: rgba(0,0,0,0.7);
}

body.light-theme .stg-apply-mini {
  background: rgba(139,92,246,0.12);
  color: rgba(139,92,246,1);
}

body.light-theme .stg-apply-mini:hover {
  background: rgba(139,92,246,0.22);
}

body.light-theme .stg-gallery-label {
  color: rgba(0,0,0,0.4);
}

body.light-theme .stg-danger-btn {
  background: rgba(255,59,48,0.08);
  color: rgba(255,59,48,0.85);
}

body.light-theme .stg-danger-btn:hover {
  background: rgba(255,59,48,0.15);
}

body.light-theme .stg-scroll::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.12);
}

/* ============================== */
/* === THIN SCROLLBAR — GLOBAL === */
/* ============================== */

.kzn-thin-scroll {
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.12) transparent;
}

.kzn-thin-scroll::-webkit-scrollbar { width: 5px; }
.kzn-thin-scroll::-webkit-scrollbar-track { background: transparent; }
.kzn-thin-scroll::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.12);
  border-radius: 4px;
}
.kzn-thin-scroll::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,0.22);
}

body.light-theme .kzn-thin-scroll {
  scrollbar-color: rgba(0,0,0,0.12) transparent;
}
body.light-theme .kzn-thin-scroll::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.12);
}
body.light-theme .kzn-thin-scroll::-webkit-scrollbar-thumb:hover {
  background: rgba(0,0,0,0.22);
}

/* ============================================= */
/* === THIN SCROLLBAR FOR TG CHAT & FF MENU === */
/* ============================================= */

.chat-list-container,
.chat-window-messages,
.chat-window-container,
.ff-content {
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.12) transparent;
}

.chat-list-container::-webkit-scrollbar,
.chat-window-messages::-webkit-scrollbar,
.chat-window-container::-webkit-scrollbar,
.ff-content::-webkit-scrollbar {
  display: block !important;
  width: 5px;
}

.chat-list-container::-webkit-scrollbar-track,
.chat-window-messages::-webkit-scrollbar-track,
.chat-window-container::-webkit-scrollbar-track,
.ff-content::-webkit-scrollbar-track {
  background: transparent;
}

.chat-list-container::-webkit-scrollbar-thumb,
.chat-window-messages::-webkit-scrollbar-thumb,
.chat-window-container::-webkit-scrollbar-thumb,
.ff-content::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.12);
  border-radius: 4px;
}

.chat-list-container::-webkit-scrollbar-thumb:hover,
.chat-window-messages::-webkit-scrollbar-thumb:hover,
.chat-window-container::-webkit-scrollbar-thumb:hover,
.ff-content::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,0.25);
}

body.light-theme .chat-list-container,
body.light-theme .chat-window-messages,
body.light-theme .chat-window-container,
body.light-theme .ff-content {
  scrollbar-color: rgba(0,0,0,0.12) transparent;
}

body.light-theme .chat-list-container::-webkit-scrollbar-thumb,
body.light-theme .chat-window-messages::-webkit-scrollbar-thumb,
body.light-theme .chat-window-container::-webkit-scrollbar-thumb,
body.light-theme .ff-content::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.12);
}

body.light-theme .chat-list-container::-webkit-scrollbar-thumb:hover,
body.light-theme .chat-window-messages::-webkit-scrollbar-thumb:hover,
body.light-theme .chat-window-container::-webkit-scrollbar-thumb:hover,
body.light-theme .ff-content::-webkit-scrollbar-thumb:hover {
  background: rgba(0,0,0,0.22);
}


/* ========================================================= */
/* === ANIMATED EFFECTS ROW                              === */
/* ========================================================= */

.stg-anim-effects {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 4px 0;
}

.stg-anim-btn {
  flex: 1;
  min-width: 70px;
  height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.7);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.stg-anim-btn:hover {
  background: rgba(168, 92, 255, 0.12);
  border-color: rgba(168, 92, 255, 0.3);
  color: #fff;
}

.stg-anim-btn.active {
  background: rgba(168, 92, 255, 0.25);
  border-color: rgba(168, 92, 255, 0.5);
  color: #fff;
  box-shadow: 0 0 12px rgba(168, 92, 255, 0.2);
}

body.light-theme .stg-anim-btn {
  border-color: rgba(0, 0, 0, 0.1);
  background: rgba(0, 0, 0, 0.03);
  color: rgba(0, 0, 0, 0.6);
}

body.light-theme .stg-anim-btn:hover {
  background: rgba(168, 92, 255, 0.1);
  color: #333;
}

body.light-theme .stg-anim-btn.active {
  background: rgba(168, 92, 255, 0.2);
  border-color: rgba(168, 92, 255, 0.4);
  color: #333;
}
