/**
 * ====================================================================
 * TELEGRAM & TELEGRAM X AUTHENTIC THEME STYLES
 * Pixel-perfect adaptation of Telegram Web A & Telegram X
 * ====================================================================
 */

:root {
  --color-primary: #3390ec;
  --color-primary-rgb: 51, 144, 236;
  --color-primary-hover: #267fd9;
  --color-primary-opacity: rgba(51, 144, 236, 0.12);
  --color-primary-tint: rgba(51, 144, 236, 0.2);
  --color-background: #0f0f0f;
  --color-background-secondary: #18181f;
  --color-background-card: #18181f;
  --color-background-card-hover: #21212a;
  --color-borders: rgba(255, 255, 255, 0.08);
  --color-borders-strong: rgba(255, 255, 255, 0.14);
  --color-text: #ffffff;
  --color-text-secondary: #8a8a90;
  --color-text-meta: #6c6c70;
  --color-text-green: #4fae4e;
  --color-accent-rose: #ff2e6a;
  --color-accent-rose-bg: rgba(255, 46, 106, 0.1);
  --color-reaction-bg: rgba(255, 255, 255, 0.07);
  --color-reaction-hover: rgba(255, 255, 255, 0.13);
  --color-reaction-active: rgba(51, 144, 236, 0.22);
  --border-radius-messages: 16px;
  --border-radius-cards: 20px;
}

/* Telegram Apple Emoji Rendering */
.emoji {
  width: 1.25em;
  height: 1.25em;
  vertical-align: -0.18em;
  display: inline-block;
  object-fit: contain;
  margin: 0 1px;
}

.emoji-small {
  width: 1.15em;
  height: 1.15em;
  vertical-align: -0.18em;
}

.emoji-large {
  width: 1.55em;
  height: 1.55em;
  vertical-align: -0.25em;
}

.emoji-native {
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
}

/* Telegram Verified Badge */
.VerifiedIcon {
  width: 1.15em;
  height: 1.15em;
  display: inline-block;
  vertical-align: -0.18em;
  margin-left: 3px;
  flex-shrink: 0;
}

/* Telegram Icon Font Adjustments */
.icon {
  font-family: 'icons' !important;
  font-style: normal;
  font-weight: normal;
  font-variant: normal;
  text-transform: none;
  line-height: 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
}

/* Custom Scrollbars matching Telegram X */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.16) transparent;
}

::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.16);
  border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(51, 144, 236, 0.6);
}

.no-scrollbar::-webkit-scrollbar {
  display: none;
}
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Post Typography & Links */
.post-text {
  font-size: 15px;
  line-height: 1.54;
  word-break: break-word;
  color: #f5f5f7;
  letter-spacing: -0.01em;
}

.post-text a {
  color: #58a6ff;
  text-decoration: none;
  transition: color 0.15s ease;
}

.post-text a:hover {
  text-decoration: underline;
  color: #79c0ff;
}

.post-text .hashtag,
.post-text .mention {
  color: #58a6ff;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.post-text .hashtag:hover,
.post-text .mention:hover {
  opacity: 0.8;
  text-decoration: underline;
}

/* Authentic Telegram Quotes / Blockquotes */
.tg-quote {
  border-left: 3px solid #3390ec;
  background: rgba(51, 144, 236, 0.08);
  color: #ffffff;
  padding: 8px 14px;
  border-radius: 8px;
  margin: 10px 0;
  font-size: 14.5px;
  line-height: 1.45;
  position: relative;
}

.tg-quote.rose {
  border-left-color: #ff2e6a;
  background: rgba(255, 46, 106, 0.08);
  color: #ff6d9a;
}

.tg-code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 2px 6px;
  border-radius: 6px;
  color: #ff7b72;
}

.tg-pre {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  background: rgba(0, 0, 0, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 12px 14px;
  border-radius: 12px;
  overflow-x: auto;
  color: #e6edf3;
  margin: 10px 0;
}

/* Telegram Reaction Pills */
.tg-reaction-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.09);
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 13px;
  font-weight: 500;
  color: #e4e4e7;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  user-select: none;
}

.tg-reaction-pill:hover {
  background: rgba(255, 255, 255, 0.13);
  transform: scale(1.05);
}

.tg-reaction-pill.active {
  background: rgba(51, 144, 236, 0.22);
  border-color: rgba(51, 144, 236, 0.45);
  color: #79a7f7;
}

/* Telegram Native Header */
.tg-app-header {
  height: 56px;
  background: rgba(18, 18, 23, 0.96);
  backdrop-filter: blur(25px) saturate(190%);
  -webkit-backdrop-filter: blur(25px) saturate(190%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  position: sticky;
  top: 0;
  z-index: 40;
  margin-bottom: 12px;
}

/* Native Telegram Channel Post Card */
.tg-post-card {
  background: rgba(24, 24, 31, 0.85);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.07);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.28);
  border-radius: 18px;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.tg-post-card:hover {
  background: rgba(28, 28, 36, 0.92);
  border-color: rgba(51, 144, 236, 0.25);
}

/* Telegram Interactive Item */
.tg-list-item {
  transition: background 0.15s ease;
}
.tg-list-item:hover {
  background: rgba(255, 255, 255, 0.05);
}
.tg-list-item:active {
  background: rgba(255, 255, 255, 0.08);
}
