/* === ATMA Base Components (atma-*, ui-*, tab-*) === */
/* Extracted from components.css -- Step 2 */
/* РІвЂўС’РІвЂўС’РІвЂўС’РІвЂўС’РІвЂўС’РІвЂўС’РІвЂўС’РІвЂўС’РІвЂўС’РІвЂўС’РІвЂўС’РІвЂўС’РІвЂўС’РІвЂўС’РІвЂўС’РІвЂўС’РІвЂўС’РІвЂўС’РІвЂўС’РІвЂўС’РІвЂўС’РІвЂўС’РІвЂўС’РІвЂўС’РІвЂўС’РІвЂўС’РІвЂўС’РІвЂўС’РІвЂўС’РІвЂўС’РІвЂўС’РІвЂўС’РІвЂўС’РІвЂўС’РІвЂўС’РІвЂўС’РІвЂўС’РІвЂўС’РІвЂўС’
   CORE РІР‚вЂќ Components
   .atma-card Р’В· .atma-input Р’В· .atma-button Р’В· Tabs Р’В· Cards
   РІвЂўС’РІвЂўС’РІвЂўС’РІвЂўС’РІвЂўС’РІвЂўС’РІвЂўС’РІвЂўС’РІвЂўС’РІвЂўС’РІвЂўС’РІвЂўС’РІвЂўС’РІвЂўС’РІвЂўС’РІвЂўС’РІвЂўС’РІвЂўС’РІвЂўС’РІвЂўС’РІвЂўС’РІвЂўС’РІвЂўС’РІвЂўС’РІвЂўС’РІвЂўС’РІвЂўС’РІвЂўС’РІвЂўС’РІвЂўС’РІвЂўС’РІвЂўС’РІвЂўС’РІвЂўС’РІвЂўС’РІвЂўС’РІвЂўС’РІвЂўС’РІвЂўС’ */

/* РІвЂќР‚РІвЂќР‚ ATMA Components РІвЂќР‚РІвЂќР‚ */
/* --- Р Р€Р Р…Р С‘Р Р†Р ВµРЎР‚РЎРѓР В°Р В»РЎРЉР Р…РЎвЂ№Р Вµ Р С”Р В»Р В°РЎРѓРЎРѓРЎвЂ№ --- */

/* --- Universal button & form reset (kill iOS/Safari defaults) --- */
button {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background: transparent;
  border: none;
  font: inherit;
  color: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.atma-card {
  border-radius: var(--radius-lg);
  background: var(--tile-bg);
  border: 1px solid var(--border);
  padding: 18px;
  box-sizing: border-box;
  overflow: hidden;
  max-width: 100%;
}

.atma-input {
  width: 100%;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: var(--tile-bg);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-size: 16px;
  font-family: inherit;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.2s ease;
}

.atma-input:focus {
  border-color: var(--text-primary);
}

.atma-input::placeholder {
  color: var(--label);
}

textarea.atma-input {
  resize: vertical;
}

select.atma-input {
  cursor: pointer;
}

.atma-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 14px;
  border: 1px solid var(--button-border);
  border-radius: var(--radius-md);
  background: var(--button-bg);
  color: var(--text-primary);
  font-size: 16px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.2s ease, opacity 0.2s ease;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.atma-button:active {
  transform: scale(0.98);
  color: var(--button-text-pressed);
}

.atma-button:disabled {
  opacity: 0.45;
  pointer-events: none;
}

/* Secondary (outline) variant */
.atma-button--secondary {
  background: var(--button-bg);
  border: 1.5px solid var(--button-border);
  color: var(--text-primary);
}

/* Ghost (text-only) variant */
.atma-button--ghost {
  background: transparent;
  border: none;
  color: var(--label);
}

/* Danger variant */
.atma-button--danger {
  background: transparent;
  border: none;
  color: var(--danger);
}




/* РІвЂќР‚РІвЂќР‚ UI Components (legacy compat) РІвЂќР‚РІвЂќР‚ */
/* РІвЂќР‚РІвЂќР‚ Button РІвЂќР‚РІвЂќР‚РІвЂќР‚РІвЂќР‚РІвЂќР‚РІвЂќР‚РІвЂќР‚РІвЂќР‚РІвЂќР‚РІвЂќР‚РІвЂќР‚РІвЂќР‚РІвЂќР‚РІвЂќР‚РІвЂќР‚РІвЂќР‚РІвЂќР‚РІвЂќР‚РІвЂќР‚РІвЂќР‚РІвЂќР‚РІвЂќР‚РІвЂќР‚РІвЂќР‚РІвЂќР‚РІвЂќР‚РІвЂќР‚РІвЂќР‚РІвЂќР‚РІвЂќР‚РІвЂќР‚РІвЂќР‚РІвЂќР‚РІвЂќР‚РІвЂќР‚РІвЂќР‚РІвЂќР‚РІвЂќР‚РІвЂќР‚РІвЂќР‚РІвЂќР‚РІвЂќР‚РІвЂќР‚РІвЂќР‚ */
/* .ui-btn visual props coexist with .atma-button for migration */
.ui-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  font-family: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.ui-btn:active { transform: scale(0.97); }
.ui-btn:disabled,
.ui-btn[aria-disabled="true"] {
  opacity: 0.45;
  pointer-events: none;
}

/* Primary (filled) */
.ui-btn--primary {
  background: var(--button-bg);
  color: var(--text-primary);
}
.ui-btn--primary:hover {
  opacity: 0.9;
}

/* Secondary (outline) */
.ui-btn--secondary {
  background: transparent;
  border: 1.5px solid var(--text-primary);
  color: var(--text-primary);
}
.ui-btn--secondary:active {
  background: var(--tile-bg);
}

/* Ghost (text-only) */
.ui-btn--ghost {
  background: transparent;
  color: var(--text-primary);
  padding: 8px 12px;
}
.ui-btn--ghost:active {
  background: var(--tile-bg);
  border-radius: var(--radius-sm);
}

/* Danger */
.ui-btn--danger {
  background: var(--danger);
  color: var(--text-primary); /* intentional: always white on red */
}

/* Surface (subtle bg) */
.ui-btn--surface {
  background: var(--tile-bg);
  color: var(--text-primary);
  border: 1px solid var(--border);
}
.ui-btn--surface:active {
  background: var(--tile-bg);
}

/* Size modifiers */
.ui-btn--full { width: 100%; }
.ui-btn--sm {
  padding: 6px 12px;
  font-size: var(--fs-sm, 13px);
  border-radius: var(--radius-sm, 8px);
}
.ui-btn--lg {
  padding: 14px 28px;
  font-size: var(--fs-lg, 17px);
  border-radius: var(--radius, 14px);
}


/* РІвЂќР‚РІвЂќР‚ Card РІвЂќР‚РІвЂќР‚РІвЂќР‚РІвЂќР‚РІвЂќР‚РІвЂќР‚РІвЂќР‚РІвЂќР‚РІвЂќР‚РІвЂќР‚РІвЂќР‚РІвЂќР‚РІвЂќР‚РІвЂќР‚РІвЂќР‚РІвЂќР‚РІвЂќР‚РІвЂќР‚РІвЂќР‚РІвЂќР‚РІвЂќР‚РІвЂќР‚РІвЂќР‚РІвЂќР‚РІвЂќР‚РІвЂќР‚РІвЂќР‚РІвЂќР‚РІвЂќР‚РІвЂќР‚РІвЂќР‚РІвЂќР‚РІвЂќР‚РІвЂќР‚РІвЂќР‚РІвЂќР‚РІвЂќР‚РІвЂќР‚РІвЂќР‚РІвЂќР‚РІвЂќР‚РІвЂќР‚РІвЂќР‚РІвЂќР‚РІвЂќР‚РІвЂќР‚ */
.ui-card {
}
.ui-card--flat {
  border: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.ui-card--interactive {
  cursor: pointer;
  transition: transform var(--duration) var(--ease),
              border-color var(--duration) var(--ease);
}
.ui-card--interactive:active {
  transform: scale(0.97);
}
.ui-card--interactive:hover {
  border-color: var(--text-primary);
}

.ui-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.ui-card__title {
  font-size: var(--fs-lg);
  font-weight: 600;
  color: var(--text-primary);
}
.ui-card__subtitle {
  font-size: var(--fs-sm);
  color: var(--label);
}
.ui-card__body {
  color: var(--text-primary);
  font-size: var(--fs-base);
  line-height: 1.5;
}
.ui-card__footer {
  display: flex;
  align-items: center;
  gap: var(--gap-sm);
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.ui-card__intro {
  color: var(--label);
  font-size: var(--fs-sm);
  line-height: 1.5;
  margin-bottom: var(--gap);
}



/* РІвЂќР‚РІвЂќР‚ Tabs РІвЂќР‚РІвЂќР‚РІвЂќР‚РІвЂќР‚РІвЂќР‚РІвЂќР‚РІвЂќР‚РІвЂќР‚РІвЂќР‚РІвЂќР‚РІвЂќР‚РІвЂќР‚РІвЂќР‚РІвЂќР‚РІвЂќР‚РІвЂќР‚РІвЂќР‚РІвЂќР‚РІвЂќР‚РІвЂќР‚РІвЂќР‚РІвЂќР‚РІвЂќР‚РІвЂќР‚РІвЂќР‚РІвЂќР‚РІвЂќР‚РІвЂќР‚РІвЂќР‚РІвЂќР‚РІвЂќР‚РІвЂќР‚РІвЂќР‚РІвЂќР‚РІвЂќР‚РІвЂќР‚РІвЂќР‚РІвЂќР‚РІвЂќР‚РІвЂќР‚РІвЂќР‚РІвЂќР‚РІвЂќР‚РІвЂќР‚РІвЂќР‚РІвЂќР‚ */
.ui-tabs {
  display: flex;
  gap: var(--gap-sm);
  margin-bottom: var(--gap);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.ui-tabs::-webkit-scrollbar { display: none; }

.ui-tab {
  flex: none;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: var(--fs-sm);
  font-weight: 600;
  font-family: inherit;
  background: var(--tile-bg);
  color: var(--label);
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--duration) var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.ui-tab:active { transform: scale(0.95); }
.ui-tab.active,
.ui-tab[aria-selected="true"] {
  background: var(--text-primary);
  color: var(--bg-main);
  border-color: var(--text-primary);
}

/* Underline variant */
.ui-tabs--underline {
  gap: 0;
  border-bottom: 1px solid var(--border);
}
.ui-tabs--underline .ui-tab {
  border-radius: 0;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 10px 16px;
  color: var(--label);
}
.ui-tabs--underline .ui-tab.active {
  background: transparent;
  color: var(--text-primary);
  border-bottom-color: var(--text-primary);
}



/* РІвЂќР‚РІвЂќР‚ ATMA Tabs & Pills РІвЂќР‚РІвЂќР‚ */
.atma-tab {
  flex: 1;
  padding: 10px 0;
  border: none;
  border-radius: 10px;
  background: var(--tile-bg);
  color: var(--label);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background .2s, color .2s;
}
.atma-tab.active {
  background: var(--text-primary);
  color: var(--bg-main);
}
.atma-pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  background: var(--tile-bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--label);
  cursor: pointer;
  transition: all .2s;
}
.atma-pill.active {
  background: var(--text-primary);
  color: var(--bg-main);
  border-color: var(--text-primary);
}



/* РІвЂќР‚РІвЂќР‚ Tab Bar (visual) РІвЂќР‚РІвЂќР‚ */
.tab-bar {
  background: var(--menu-bg);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--label);
  cursor: pointer;
  transition: color .2s ease, transform .15s ease;
  padding: 10px 0;
  position: relative;
  -webkit-tap-highlight-color: transparent;
  height: 100%;
}
.tab:active { transform: scale(0.9); }
.tab.active { color: var(--text-primary); }
.tab.active::after { display: none; }
.tab-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.tab-icon svg {
  width: 24px;
  height: 24px;
  display: block;
  margin-top: 6px;
}
.tab-label { display: none; }

/* РІвЂќР‚РІвЂќР‚ Center Tab (ATMA logo) РІвЂќР‚РІвЂќР‚ */
.tab.tab-center {
  flex: 1;
  margin: 0;
  background: none;
  color: var(--text-primary);
  transition: transform .2s ease;
  padding: 0;
  position: relative;
}
.tab.tab-center:active {
  transform: scale(0.9);
}
.tab.tab-center .tab-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  overflow: hidden;
  background: transparent;
}
.tab.tab-center .tab-logo img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
}
.tab.tab-center.active .tab-icon {
  box-shadow: none;
}

.tab.tab-center.active .tab-logo img {
  filter: none;
}


/* РІвЂќР‚РІвЂќР‚ Tab Badges & Scale РІвЂќР‚РІвЂќР‚ */
/* РІвЂќР‚РІвЂќР‚ Tab badge: icon-wrap anchor (Telegram-style) РІвЂќР‚РІвЂќР‚ */
.tab-icon-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* РІвЂќР‚РІвЂќР‚ Tab badge base РІвЂќР‚РІвЂќР‚ */
.tab-badge {
  position: absolute;
  top: -4px;
  right: -6px;
  transform: none;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: none;
  pointer-events: none;
  z-index: 2;
}
.tab-badge:empty { display: none; }
.tab-badge.visible { display: flex; }

/* РІвЂќР‚РІвЂќР‚ Filled badge (default РІР‚вЂќ ALWAYS white text) РІвЂќР‚РІвЂќР‚ */
.tab-badge.is-filled {
  background: var(--danger);
  color: var(--text-primary);
  border: none;
}

/* РІвЂќР‚РІвЂќР‚ Outline badge РІвЂќР‚РІвЂќР‚ */
.tab-badge.is-outline {
  background: transparent;
  border: 2px solid var(--danger);
  color: var(--danger);
}

/* РІвЂќР‚РІвЂќР‚ Tabbar icon scale РІвЂќР‚РІвЂќР‚ */
.tab-bar svg,
.tab-bar i {
  transform: scale(1.12);
  transform-origin: center;
}
