/* Telegram Android / One UI Light Theme — OKCRM */
@import url('assets/telegram/styles/telegram-icons.css');

:root {
  --tg-bg: #f0f2f5;
  --tg-card-bg: #ffffff;
  --tg-card-pressed: #f5f7fa;
  --tg-divider: #eef0f3;
  --tg-blue: #2481cc;
  --tg-blue-light: #e1f3fb;
  --tg-blue-hover: #1e70b3;
  --tg-text: #000000;
  --tg-text-secondary: #707579;
  --tg-text-muted: #8e8e93;
  --tg-online: #2481cc;
  --tg-input-bg: #ffffff;
  --tg-input-border: #e0e4e8;
  --tg-green: #43a047;
  --tg-green-light: #e8f5e9;
  --tg-orange: #fb8c00;
  --tg-red: #e53935;
  --tg-purple: #8e24aa;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: #e5e8ec;
  color: var(--tg-text);
  font-family: -apple-system, BlinkMacSystemFont, "Roboto", "Segoe UI", "SF Pro Text", Helvetica, Arial, sans-serif;
  margin: 0;
  padding: 0;
}

/* Telegram Font-Icon Base */
[class^="icon-"], [class*=" icon-"] {
  font-family: "icons" !important;
  font-style: normal;
  font-weight: normal;
  font-variant: normal;
  text-transform: none;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Telegram Mobile Shell with Official Doodle Wallpaper */
.telegram-shell {
  background-color: var(--tg-bg);
  width: 100%;
  height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

/* Official Telegram Doodle Pattern */
.telegram-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url('assets/telegram/patterns/telegram-pattern.svg');
  background-repeat: repeat;
  background-size: 380px;
  opacity: 0.038;
  pointer-events: none;
  z-index: 1;
}

#mainHeader, #mainViewport, .tg-floating-dock-container {
  position: relative;
  z-index: 5;
}

@media (min-width: 640px) {
  .telegram-shell {
    max-width: 430px;
    height: 92vh;
    max-height: 900px;
    margin: 4vh auto;
    border-radius: 36px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15), 0 0 0 10px #ffffff, 0 0 0 12px #d1d5db;
    overflow: hidden;
  }
}

/* Telegram Floating Bottom Navigation Dock */
.tg-floating-dock-container {
  position: absolute;
  bottom: 14px;
  left: 14px;
  right: 14px;
  z-index: 45;
  pointer-events: none;
}

.tg-floating-dock {
  background-color: #ffffff;
  height: 64px;
  border-radius: 32px;
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 5px 8px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12), 0 1px 3px rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(0, 0, 0, 0.04);
  pointer-events: auto;
}

.tg-dock-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  height: 100%;
  color: var(--tg-text-secondary);
  border-radius: 24px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  padding: 4px 0;
  user-select: none;
}

.tg-dock-tab.active {
  background-color: var(--tg-blue-light);
  color: var(--tg-blue);
}

.tg-dock-tab .dock-icon {
  font-size: 20px;
}

.tg-dock-tab .tab-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: -0.2px;
}

/* Telegram White Rounded Cards */
.tg-card {
  background-color: var(--tg-card-bg);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
  border: 1px solid rgba(0, 0, 0, 0.03);
}

/* Telegram Action Row inside Card */
.tg-action-row {
  display: flex;
  align-items: center;
  padding: 13px 16px;
  gap: 14px;
  cursor: pointer;
  transition: background-color 0.15s ease;
  user-select: none;
}

.tg-action-row:active {
  background-color: var(--tg-card-pressed);
}

/* Telegram Settings Menu Colorful Icons (Exact Screenshot Match) */
.tg-settings-icon {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff !important;
  font-size: 19px;
  flex-shrink: 0;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
}
.tg-settings-icon.circle {
  border-radius: 50%;
}
.tg-settings-icon.bg-blue { background-color: #2481cc; }
.tg-settings-icon.bg-orange { background-color: #ff9800; }
.tg-settings-icon.bg-green { background-color: #4caf50; }
.tg-settings-icon.bg-red { background-color: #f44336; }
.tg-settings-icon.bg-royal { background-color: #1e88e5; }
.tg-settings-icon.bg-sky { background-color: #03a9f4; }
.tg-settings-icon.bg-teal { background-color: #009688; }
.tg-settings-icon.bg-amber { background-color: #ffb300; }
.tg-settings-icon.bg-purple { background-color: #9c27b0; }
.tg-settings-icon.bg-deep-purple { background-color: #8e24aa; }
.tg-settings-icon.bg-rose { background-color: #e91e63; }

/* Hairline Divider */
.tg-divider {
  height: 1px;
  background-color: var(--tg-divider);
  margin-left: 68px;
}

/* Telegram Floating Action Button (FAB) */
.tg-fab {
  position: absolute;
  right: 20px;
  bottom: 88px;
  width: 56px;
  height: 56px;
  border-radius: 28px;
  background-color: var(--tg-blue);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 20px rgba(36, 129, 204, 0.4);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 40;
  border: none;
  cursor: pointer;
}

.tg-fab .icon-fab {
  font-size: 24px;
}

.tg-fab:active {
  transform: scale(0.93);
  background-color: var(--tg-blue-hover);
}

/* Search Bar Telegram Style */
.tg-search-bar {
  background-color: #ffffff;
  border: 1.5px solid var(--tg-input-border);
  border-radius: 16px;
  display: flex;
  align-items: center;
  padding: 0 14px;
  height: 44px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.tg-search-bar:focus-within {
  border-color: var(--tg-blue);
  box-shadow: 0 0 0 3px rgba(36, 129, 204, 0.12);
}

.tg-search-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-size: 14px;
  color: var(--tg-text);
  padding-left: 10px;
}

.tg-search-input::placeholder {
  color: var(--tg-text-muted);
}

/* Segmented Filter Pills */
.tg-segmented-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 0;
}

.tg-segment-pill {
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 18px;
  background-color: #ffffff;
  color: var(--tg-text-secondary);
  border: 1px solid var(--tg-input-border);
  transition: all 0.15s ease;
  white-space: nowrap;
  cursor: pointer;
}

.tg-segment-pill.active {
  background-color: var(--tg-blue);
  color: #ffffff;
  border-color: var(--tg-blue);
}

/* Bottom Sheet Modal & Hidden State */
.hidden,
.tg-bottom-sheet.hidden,
.tab-content.hidden {
  display: none !important;
  pointer-events: none !important;
  visibility: hidden !important;
}

.tg-bottom-sheet {
  position: fixed;
  inset: 0;
  z-index: 60;
  background-color: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  transition: opacity 0.2s ease;
}

.tg-sheet-panel {
  background-color: #ffffff;
  border-top-left-radius: 26px;
  border-top-right-radius: 26px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.15);
  animation: tgSlideUp 0.26s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes tgSlideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

/* Leaflet Map */
#mapView {
  width: 100%;
  height: 100%;
  background: #eef0f3;
}
