/* ============================================================
   MikTok — Telegram-Style Theme (Settings / Profile)
   ============================================================ */
:root {
  --tg-blue: #2AABEE;
  --tg-blue-dark: #1a8cc6;
  --tg-green: #4CAF50;
  --tg-red: #E53935;
  --tg-orange: #FF9800;
  --tg-purple: #9C27B0;
  --tg-yellow: #FFD600;

  --tg-bg: #f0f2f5;
  --tg-surface: #ffffff;
  --tg-surface2: #f7f8fa;
  --tg-text: #000000;
  --tg-text-muted: #8e8e93;
  --tg-border: #e0e0e6;
  --tg-sep: #c8c8d0;
  --tg-active: #2AABEE;
  --tg-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

/* ---- TG Page Layout ---- */
.tg-page { background: var(--tg-bg); min-height: 100vh; }
.tg-page * { box-sizing: border-box; }

/* ---- TG Profile Header ---- */
.tg-profile-header {
  background: var(--tg-surface);
  padding: 32px 20px 20px;
  text-align: center;
  border-bottom: 1px solid var(--tg-border);
  margin-bottom: 12px;
}
.tg-avatar-wrap {
  position: relative;
  width: 96px;
  height: 96px;
  margin: 0 auto 14px;
}
.tg-avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--tg-surface);
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
}
.tg-avatar-edit {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 28px;
  height: 28px;
  background: var(--tg-blue);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  border: 2px solid #fff;
}
.tg-avatar-edit i { font-size: 12px; color: #fff; }
.tg-profile-name { font-size: 22px; font-weight: 700; color: var(--tg-text); margin-bottom: 4px; }
.tg-profile-meta { font-size: 14px; color: var(--tg-text-muted); display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; }
.tg-profile-meta span { display: flex; align-items: center; gap: 4px; }

/* ---- TG Section ---- */
.tg-section {
  background: var(--tg-surface);
  border-radius: 12px;
  margin: 0 12px 12px;
  overflow: hidden;
  box-shadow: var(--tg-shadow);
}
.tg-section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--tg-blue);
  padding: 10px 16px 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ---- TG Row ---- */
.tg-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 16px;
  cursor: pointer;
  transition: background 0.15s;
  text-decoration: none;
  color: inherit;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
}
.tg-row:hover, .tg-row:active { background: var(--tg-surface2); }
.tg-row + .tg-row { border-top: 1px solid var(--tg-border); }
.tg-row-icon {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: #fff;
  flex-shrink: 0;
}
.tg-row-text { flex: 1; min-width: 0; }
.tg-row-label { font-size: 16px; font-weight: 400; color: var(--tg-text); line-height: 1.3; }
.tg-row-sub { font-size: 13px; color: var(--tg-text-muted); margin-top: 1px; }
.tg-row-right { display: flex; align-items: center; gap: 6px; color: var(--tg-text-muted); font-size: 14px; }
.tg-row-badge {
  background: var(--tg-red);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
  min-width: 22px;
  text-align: center;
}
.tg-row-badge.blue { background: var(--tg-blue); }
.tg-row-badge.green { background: var(--tg-green); }
.tg-chevron { font-size: 14px; color: var(--tg-sep); }

/* ---- TG Icon Colors ---- */
.ic-blue    { background: #2AABEE; }
.ic-green   { background: #4CAF50; }
.ic-red     { background: #E53935; }
.ic-orange  { background: #FF9800; }
.ic-purple  { background: #9C27B0; }
.ic-yellow  { background: #FFB300; }
.ic-teal    { background: #00BCD4; }
.ic-pink    { background: #E91E63; }
.ic-indigo  { background: #3F51B5; }
.ic-brown   { background: #795548; }
.ic-gray    { background: #607D8B; }
.ic-dark    { background: #37474F; }
.ic-ride    { background: #F59E0B; }
.ic-gradient { background: linear-gradient(135deg, #fe2c55, #7928ca); }

/* ---- TG Bottom Nav ---- */
.tg-bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 72px;
  background: var(--tg-surface);
  border-top: 1px solid var(--tg-border);
  display: flex;
  align-items: center;
  z-index: 900;
  padding: 0 8px;
  padding-bottom: env(safe-area-inset-bottom);
}
.tg-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 4px;
  cursor: pointer;
  text-decoration: none;
  color: var(--tg-text-muted);
  transition: color 0.15s;
  position: relative;
  border: none;
  background: none;
}
.tg-nav-item.active { color: var(--tg-blue); }
.tg-nav-item i { font-size: 22px; }
.tg-nav-item span { font-size: 11px; font-weight: 500; }
.tg-nav-badge {
  position: absolute;
  top: 4px;
  right: 50%;
  transform: translateX(10px);
  background: var(--tg-red);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
  line-height: 16px;
}

/* ---- TG Toggle ---- */
.tg-toggle {
  position: relative;
  width: 50px;
  height: 28px;
  flex-shrink: 0;
}
.tg-toggle input { opacity: 0; width: 0; height: 0; }
.tg-toggle-track {
  position: absolute;
  inset: 0;
  background: #d0d0d8;
  border-radius: 14px;
  cursor: pointer;
  transition: background 0.2s;
}
.tg-toggle input:checked + .tg-toggle-track { background: var(--tg-blue); }
.tg-toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
  pointer-events: none;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.tg-toggle input:checked ~ .tg-toggle-thumb { transform: translateX(22px); }

/* ---- TG Call Row ---- */
.call-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--tg-border);
  transition: background 0.15s;
}
.call-row:hover { background: var(--tg-surface2); }
.call-avatar { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.call-info { flex: 1; min-width: 0; }
.call-name { font-size: 16px; font-weight: 500; color: var(--tg-text); }
.call-meta { font-size: 13px; color: var(--tg-text-muted); display: flex; align-items: center; gap: 6px; margin-top: 2px; }
.call-meta i { font-size: 12px; }
.call-incoming { color: var(--tg-green); }
.call-outgoing { color: var(--tg-blue); }
.call-missed   { color: var(--tg-red); }
.call-type-btn { width: 44px; height: 44px; border-radius: 50%; background: rgba(42,171,238,.12); color: var(--tg-blue); border: none; cursor: pointer; font-size: 18px; display: flex; align-items: center; justify-content: center; }
.call-type-btn:hover { background: rgba(42,171,238,.2); }

/* ---- TG Search Bar ---- */
.tg-search {
  padding: 8px 12px;
  background: var(--tg-surface);
  border-bottom: 1px solid var(--tg-border);
  margin-bottom: 12px;
}
.tg-search-inner {
  background: var(--tg-surface2);
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
}
.tg-search-inner i { color: var(--tg-text-muted); font-size: 15px; }
.tg-search-inner input { background: none; border: none; outline: none; font-size: 15px; color: var(--tg-text); flex: 1; }

/* ---- TG Saved Messages ---- */
.saved-msg-row {
  padding: 14px 16px;
  border-bottom: 1px solid var(--tg-border);
}
.saved-msg-row:last-child { border-bottom: none; }
.saved-msg-top { display: flex; justify-content: space-between; margin-bottom: 6px; }
.saved-msg-type { font-size: 12px; font-weight: 700; color: var(--tg-blue); text-transform: uppercase; letter-spacing: .5px; }
.saved-msg-time { font-size: 12px; color: var(--tg-text-muted); }
.saved-msg-content { font-size: 15px; color: var(--tg-text); line-height: 1.5; }
.saved-msg-media { max-width: 200px; border-radius: 10px; margin-top: 8px; }

/* ---- TG Contacts ---- */
.tg-contact-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--tg-border);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  transition: background .15s;
}
.tg-contact-row:hover { background: var(--tg-surface2); }
.contact-initial {
  width: 46px; height: 46px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}
.contact-info { flex: 1; min-width: 0; }
.contact-name { font-size: 16px; font-weight: 500; color: var(--tg-text); }
.contact-detail { font-size: 13px; color: var(--tg-text-muted); }
.contact-actions { display: flex; gap: 8px; }
.contact-action-btn { width: 38px; height: 38px; border-radius: 50%; border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 16px; transition: .15s; }

/* ---- TG Device Row ---- */
.device-row {
  padding: 14px 16px;
  border-bottom: 1px solid var(--tg-border);
}
.device-row:last-child { border-bottom: none; }
.device-row-top { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 4px; }
.device-name { font-size: 15px; font-weight: 600; color: var(--tg-text); }
.device-current { font-size: 11px; background: var(--tg-green); color: #fff; padding: 2px 8px; border-radius: 10px; font-weight: 600; }
.device-platform { font-size: 13px; color: var(--tg-text-muted); }
.device-time { font-size: 12px; color: var(--tg-text-muted); margin-top: 2px; }
.device-revoke { color: var(--tg-red); font-size: 13px; font-weight: 600; background: none; border: none; cursor: pointer; padding: 0; margin-top: 4px; }

/* ---- Privacy Options ---- */
.tg-radio-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--tg-border);
  cursor: pointer;
}
.tg-radio-row:last-child { border-bottom: none; }
.tg-radio-row input[type=radio] { width: 18px; height: 18px; accent-color: var(--tg-blue); flex-shrink: 0; }
.tg-radio-label { font-size: 15px; color: var(--tg-text); flex: 1; }

/* ---- Utility ---- */
.tg-page-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--tg-text);
  padding: 16px 16px 8px;
}
.tg-danger { color: var(--tg-red) !important; }
.tg-success { color: var(--tg-green) !important; }
.tg-primary { color: var(--tg-blue) !important; }
