/* ============================================
   Exchange — Currency & Crypto Converter
   Premium Dark Theme with Glassmorphism
   ============================================ */

/* === CSS Custom Properties === */
:root {
  --bg-primary: #0a0e14;
  --bg-secondary: #111820;
  --bg-card: rgba(20, 29, 40, 0.85);
  --bg-card-hover: rgba(25, 35, 50, 0.9);
  --bg-card-to: rgba(15, 25, 35, 0.95);
  --border-card: rgba(0, 212, 170, 0.12);
  --border-card-hover: rgba(0, 212, 170, 0.25);

  --accent: #00d4aa;
  --accent-glow: rgba(0, 212, 170, 0.2);
  --accent-light: #00f5c4;
  --accent-dim: #009e7e;

  --text-primary: #f0f4f8;
  --text-secondary: #8899aa;
  --text-muted: #5a6a7a;
  --text-accent: #00d4aa;

  --positive: #00d4aa;
  --negative: #ff5252;
  --positive-bg: rgba(0, 212, 170, 0.1);
  --negative-bg: rgba(255, 82, 82, 0.1);

  --numpad-bg: rgba(17, 24, 32, 0.98);
  --numpad-key-bg: rgba(30, 42, 56, 0.6);
  --numpad-key-hover: rgba(40, 55, 75, 0.8);
  --numpad-key-active: rgba(0, 212, 170, 0.15);

  --modal-bg: rgba(8, 12, 18, 0.95);
  --modal-card-bg: rgba(17, 24, 34, 0.98);

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;

  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(0, 212, 170, 0.06);
  --shadow-glow: 0 0 20px rgba(0, 212, 170, 0.15);

  --transition-fast: 150ms ease;
  --transition-normal: 250ms ease;
  --transition-smooth: 350ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* === Reset & Base === */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  overflow-x: hidden;
}

/* Subtle animated background gradient */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    radial-gradient(ellipse at 20% 0%, rgba(0, 212, 170, 0.06) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 100%, rgba(0, 120, 200, 0.04) 0%, transparent 60%),
    linear-gradient(180deg, #0a0e14 0%, #0d1218 50%, #0a0e14 100%);
  pointer-events: none;
  z-index: 0;
}

/* === App Container === */
.app {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 430px;
  min-height: 100vh;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
}

/* === Header === */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0 16px;
}

.header__menu,
.header__settings {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: var(--transition-fast);
}

.header__menu:hover,
.header__settings:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
}

.header__title {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* === Tabs === */
.tabs {
  display: flex;
  gap: 4px;
  background: rgba(20, 30, 42, 0.6);
  border-radius: var(--radius-xl);
  padding: 4px;
  margin-bottom: 20px;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.tab {
  flex: 1;
  padding: 12px 0;
  border: none;
  border-radius: var(--radius-xl);
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-normal);
  position: relative;
}

.tab--active {
  background: var(--accent);
  color: #0a0e14;
  box-shadow: 0 2px 12px rgba(0, 212, 170, 0.3);
}

.tab:not(.tab--active):hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
}

/* === Converter === */
.converter {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 20px;
}

.converter-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 20px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: var(--transition-normal);
}

.converter-card:hover {
  border-color: var(--border-card-hover);
}

.converter-card--from {
  border-radius: var(--radius-lg) var(--radius-lg) 8px 8px;
  margin-bottom: 0;
}

.converter-card--to {
  background: var(--bg-card-to);
  border-radius: 8px 8px var(--radius-lg) var(--radius-lg);
  border-top-color: rgba(0, 212, 170, 0.06);
  margin-top: 0;
}

.converter-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.converter-card__label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.converter-card__amount {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  line-height: 1.1;
  word-break: break-all;
}

.converter-card__amount--result {
  color: var(--accent);
  font-size: 1.8rem;
}

.converter-card__result {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 10px;
}

.converter-card__sublabel {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 6px;
}

.converter-card__footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
}

.converter-card__meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.sparkline-canvas {
  width: 80px;
  height: 36px;
  flex-shrink: 0;
}

.to-amount--loading {
  opacity: 0.4;
  animation: pulse 0.8s ease-in-out infinite;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 0.4;
  }

  50% {
    opacity: 0.7;
  }
}

/* === Currency Button === */
.currency-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-xl);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
}

.currency-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(0, 212, 170, 0.2);
}

.flag-icon {
  font-size: 1.3rem;
  line-height: 1;
}

.crypto-icon-btn {
  width: 22px;
  height: 22px;
  display: inline-flex;
}

.crypto-icon-btn svg {
  width: 100%;
  height: 100%;
}

.chevron {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-left: 2px;
}

/* === Swap Button === */
.swap-btn {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 3px solid var(--bg-primary);
  background: linear-gradient(135deg, var(--accent), var(--accent-dim));
  color: #0a0e14;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-normal);
  box-shadow: 0 4px 16px rgba(0, 212, 170, 0.3);
}

.swap-btn:hover {
  transform: translate(-50%, -50%) scale(1.08);
  box-shadow: 0 6px 24px rgba(0, 212, 170, 0.4);
}

.swap-btn:active {
  transform: translate(-50%, -50%) scale(0.95);
}

.swap-btn--spin svg {
  animation: spin 0.4s ease-in-out;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(180deg);
  }
}

/* === Rate Info & Change Badge === */
.rate-info {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.change-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
}

.change-badge--positive {
  background: var(--positive-bg);
  color: var(--positive);
}

.change-badge--negative {
  background: var(--negative-bg);
  color: var(--negative);
}

.text-positive {
  color: var(--positive) !important;
}

.text-negative {
  color: var(--negative) !important;
}

/* === View Sections === */
.view-section {
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease;
  flex: 1;
  width: 100%;
}

.view-section--active {
  display: flex;
  flex-direction: column;
  opacity: 1;
  animation: fadeIn 0.3s ease forwards;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(5px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* === Quick Rates === */
.quick-rates {
  margin-bottom: 16px;
}

.quick-rates__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.quick-rates__title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

.quick-rates__link {
  font-size: 0.8rem;
  color: var(--accent);
  cursor: pointer;
  font-weight: 500;
}

.quick-rates__link:hover {
  text-decoration: underline;
}

.quick-rates__list {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 6px;
  scroll-snap-type: x mandatory;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.quick-rates__list::-webkit-scrollbar {
  display: none;
}

.quick-rate-card {
  flex: 0 0 140px;
  scroll-snap-align: start;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 14px;
  backdrop-filter: blur(10px);
  transition: var(--transition-fast);
  cursor: pointer;
}

.quick-rate-card:hover {
  border-color: var(--border-card-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

.quick-rate-card__header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.quick-rate-card__icon {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

.quick-rate-card__icon svg {
  width: 100%;
  height: 100%;
}

.quick-rate-card__info {
  display: flex;
  flex-direction: column;
}

.quick-rate-card__code {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
}

.quick-rate-card__change {
  font-size: 0.68rem;
  font-weight: 600;
}

.quick-rate-card__chart {
  width: 100%;
  height: 32px;
  margin-bottom: 8px;
}

.quick-rate-card__price {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
}

/* === Numpad === */
.numpad-wrapper {
  background: var(--numpad-bg);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 10px 16px 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  margin: 0 -20px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.numpad-handle {
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.12);
  margin: 0 auto 12px;
}

.numpad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  flex-grow: 1;
}

.numpad-key {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 58px;
  border: none;
  border-radius: var(--radius-md);
  background: var(--numpad-key-bg);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 1.35rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.numpad-key:hover {
  background: var(--numpad-key-hover);
}

.numpad-key--active {
  background: var(--numpad-key-active) !important;
  transform: scale(0.95);
}

.numpad-key--del {
  color: var(--accent);
}

.numpad-key--del svg {
  width: 24px;
  height: 24px;
}

/* === Refresh Button === */
.refresh-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 16px;
  margin: 12px 0 4px;
  border: none;
  border-radius: var(--radius-xl);
  background: linear-gradient(135deg, var(--accent), var(--accent-dim));
  color: #0a0e14;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition-normal);
  box-shadow: 0 4px 20px rgba(0, 212, 170, 0.25);
}

.refresh-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 28px rgba(0, 212, 170, 0.35);
}

.refresh-btn:active {
  transform: translateY(0);
}

.refresh-btn__icon {
  transition: transform var(--transition-smooth);
}

.refresh-btn--loading .refresh-btn__icon {
  animation: spin-infinite 0.8s linear infinite;
}

@keyframes spin-infinite {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

.update-timestamp {
  text-align: center;
  font-size: 0.72rem;
  color: var(--text-muted);
  padding: 6px 0 20px;
}

/* === Modal === */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: var(--modal-bg);
  opacity: 0;
  visibility: hidden;
  transition: var(--transition-normal);
}

.modal--open {
  opacity: 1;
  visibility: visible;
}

.modal__content {
  width: 100%;
  max-width: 430px;
  max-height: 85vh;
  background: var(--modal-card-bg);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: 24px;
  transform: translateY(100%);
  transition: transform var(--transition-smooth);
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--border-card);
}

.modal--open .modal__content {
  transform: translateY(0);
}

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.modal__title {
  font-size: 1.1rem;
  font-weight: 700;
}

.modal__close {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition-fast);
}

.modal__close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

.modal__search {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
  margin-bottom: 16px;
  transition: var(--transition-fast);
}

.modal__search::placeholder {
  color: var(--text-muted);
}

.modal__search:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 212, 170, 0.1);
}

.modal__list {
  flex: 1;
  overflow-y: auto;
  -ms-overflow-style: none;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

.selector-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition-fast);
}

.selector-item:hover {
  background: rgba(0, 212, 170, 0.06);
}

.selector-item__icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.selector-item__icon .flag-icon {
  font-size: 1.8rem;
}

.crypto-icon-small {
  width: 32px;
  height: 32px;
}

.crypto-icon-small svg {
  width: 100%;
  height: 100%;
}

.selector-item__info {
  display: flex;
  flex-direction: column;
}

.selector-item__code {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
}

.selector-item__name {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* === Animations === */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.converter-card {
  animation: fadeIn 0.4s ease-out;
}

.converter-card--to {
  animation-delay: 0.1s;
  animation-fill-mode: both;
}

/* === View Sections === */
.view-section {
  display: none;
  flex-direction: column;
  flex: 1;
}

.view-section--active {
  display: flex;
  animation: fadeIn 0.3s ease-out;
}

/* === Watchlist === */
.watchlist-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.watchlist-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.watchlist-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  font-size: 0.9rem;
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--radius-lg);
  border: 1px dashed rgba(255, 255, 255, 0.1);
}

.watchlist-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.watchlist-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 16px;
  backdrop-filter: blur(10px);
  transition: var(--transition-fast);
}

.watchlist-card:hover {
  border-color: var(--border-card-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

.watchlist-card__left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.watchlist-card__icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.watchlist-card__icon svg {
  width: 100%;
  height: 100%;
}

.watchlist-card__icon .flag-icon {
  font-size: 1.8rem;
}

.watchlist-card__info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.watchlist-card__pair {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.watchlist-card__name {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.watchlist-card__right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.watchlist-card__price {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.watchlist-card__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.watchlist-card__remove {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
}

.watchlist-card__remove:hover {
  color: var(--negative);
  background: rgba(255, 82, 82, 0.1);
}

/* === Star Button === */
.star-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
}

.star-btn:hover {
  color: #ffca28;
  background: rgba(255, 202, 40, 0.1);
}

.star-btn--active {
  color: #ffca28;
}

.star-btn--active svg {
  fill: #ffca28;
}

/* === History === */
.history-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  backdrop-filter: blur(10px);
  transition: var(--transition-fast);
}

.history-card:hover {
  border-color: var(--border-card-hover);
}

.history-card__content {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.history-card__conversion {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.history-card__arrow {
  color: var(--text-muted);
}

.history-card__rate {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.history-card__time {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-align: right;
  white-space: nowrap;
}

/* === Responsive === */
@media (min-width: 431px) {
  body {
    align-items: center;
    padding: 20px;
  }

  .app {
    min-height: auto;
    border-radius: var(--radius-xl);
    background: rgba(10, 14, 20, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.04);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    padding-bottom: 20px;
    max-height: 95vh;
    overflow-y: auto;
  }

  .numpad-wrapper {
    border-radius: var(--radius-lg);
    margin: 0;
  }
}

@media (max-width: 360px) {
  .converter-card__amount {
    font-size: 1.8rem;
  }

  .converter-card__amount--result {
    font-size: 1.5rem;
  }

  .numpad-key {
    height: 50px;
    font-size: 1.2rem;
  }
}

/* === Scrollbar styling === */
::-webkit-scrollbar {
  width: 4px;
}

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

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

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* === Header Buttons Reset === */
.header__menu,
.header__settings {
  border: none;
  background: transparent;
  font-family: inherit;
}

/* === Sidebar Overlay === */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: var(--transition-normal);
}

.sidebar-overlay--open {
  opacity: 1;
  visibility: visible;
}

/* === Sidebar === */
.sidebar {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 300px;
  max-width: 85vw;
  background: var(--modal-card-bg);
  border-right: 1px solid var(--border-card);
  display: flex;
  flex-direction: column;
  transition: transform var(--transition-smooth);
  overflow-y: auto;
}

.sidebar--left {
  left: 0;
  transform: translateX(-100%);
}

.sidebar--right {
  right: 0;
  left: auto;
  border-right: none;
  border-left: 1px solid var(--border-card);
  transform: translateX(100%);
}

.sidebar-overlay--open .sidebar--left {
  transform: translateX(0);
}

.sidebar-overlay--open .sidebar--right {
  transform: translateX(0);
}

/* === Sidebar Header === */
.sidebar__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar__brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar__logo {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(0, 212, 170, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar__title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.sidebar__subtitle {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.sidebar__close {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition-fast);
}

.sidebar__close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

/* === Sidebar Navigation === */
.sidebar__nav {
  padding: 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-fast);
  position: relative;
}

.nav-item:hover {
  background: rgba(0, 212, 170, 0.06);
  color: var(--text-primary);
}

.nav-item--active {
  background: rgba(0, 212, 170, 0.1);
  color: var(--accent);
}

.nav-item--active .nav-item__icon {
  color: var(--accent);
}

.nav-item__icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--text-muted);
  transition: var(--transition-fast);
}

.nav-item:hover .nav-item__icon {
  color: var(--text-secondary);
}

.nav-item__badge {
  margin-left: auto;
  padding: 2px 8px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* === Sidebar Divider & Footer === */
.sidebar__divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.06);
  margin: 8px 20px;
}

.sidebar__footer {
  padding: 8px 12px 20px;
  margin-top: auto;
}

.sidebar__version {
  padding: 12px 14px 0;
  font-size: 0.68rem;
  color: var(--text-muted);
}

/* === Settings Panel === */
.settings-group {
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.settings-group:last-child {
  border-bottom: none;
}

.settings-group__title {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
}

.setting-row+.setting-row {
  border-top: 1px solid rgba(255, 255, 255, 0.03);
}

.setting-row__info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.setting-row__label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
}

.setting-row__desc {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* === Theme Toggle === */
.theme-toggle {
  display: flex;
  gap: 2px;
  padding: 3px;
  border-radius: var(--radius-xl);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.theme-toggle__btn {
  width: 36px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: var(--radius-xl);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition-fast);
}

.theme-toggle__btn--active {
  background: var(--accent);
  color: #0a0e14;
  box-shadow: 0 2px 8px rgba(0, 212, 170, 0.25);
}

.theme-toggle__btn:not(.theme-toggle__btn--active):hover {
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.04);
}

/* === Setting Select === */
.setting-select {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 500;
  outline: none;
  cursor: pointer;
  transition: var(--transition-fast);
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%238899aa' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
}

.setting-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(0, 212, 170, 0.1);
}

.setting-select option {
  background: #1a2332;
  color: var(--text-primary);
}

/* === Setting Action Button === */
.setting-action-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid rgba(255, 82, 82, 0.15);
  border-radius: var(--radius-sm);
  background: rgba(255, 82, 82, 0.05);
  color: var(--negative);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-fast);
}

.setting-action-btn:hover {
  background: rgba(255, 82, 82, 0.1);
  border-color: rgba(255, 82, 82, 0.25);
}

/* === About Modal === */
.modal__content--small {
  max-height: 70vh;
  padding: 28px;
}

.about-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 8px 0;
}

.about-logo {
  width: 72px;
  height: 72px;
  border-radius: 20px;
  background: rgba(0, 212, 170, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.about-name {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.about-version {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.about-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 20px;
  max-width: 300px;
}

.about-features {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: 100%;
}

.about-feature {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 0.78rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.about-feature__icon {
  font-size: 1.1rem;
}

/* === Price Alerts Form & Cards === */
.alert-form {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}

.alert-form::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at top right, rgba(0, 255, 170, 0.05) 0%, transparent 60%);
  pointer-events: none;
}

.alert-form__row {
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  z-index: 1;
}

.alert-form__group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-basis: 0;
  flex-grow: 1;
}

.alert-form__label {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}

.alert-form__swap {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition-fast);
  margin-top: 22px;
}

.alert-form__swap:hover {
  background: var(--surface-hover);
  color: var(--accent);
}

.amount-input--small {
  height: 44px;
  font-size: 1.25rem;
  border-radius: var(--radius-md);
  margin: 0;
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 0 16px;
}

.amount-input--small:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 255, 170, 0.1);
}

/* Alert Card */
.alert-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px;
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  margin-bottom: 12px;
}

.alert-card:hover {
  border-color: rgba(0, 255, 170, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.alert-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--border);
  transition: var(--transition);
}

.alert-card--triggered::before {
  background: var(--accent);
}

.alert-card__left {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-left: 12px;
}

.alert-card__pair {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.alert-card__condition {
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.alert-card__condition span {
  font-weight: 600;
  color: var(--text-primary);
}

.alert-card__badge {
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.alert-card__badge--active {
  background: rgba(255, 202, 40, 0.1);
  color: #ffca28;
}

.alert-card__badge--triggered {
  background: rgba(0, 255, 170, 0.1);
  color: var(--accent);
}

.alert-card__right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.alert-card__target {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
}

.alert-card__current {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* === Light Theme === */
[data-theme="light"] {
  --bg-primary: #f0f4f8;
  --bg-secondary: #e8edf2;
  --bg-card: rgba(255, 255, 255, 0.9);
  --bg-card-hover: rgba(255, 255, 255, 0.95);
  --bg-card-to: rgba(240, 248, 245, 0.95);
  --border-card: rgba(0, 180, 140, 0.12);
  --border-card-hover: rgba(0, 180, 140, 0.25);

  --accent: #00b48a;
  --accent-glow: rgba(0, 180, 140, 0.15);
  --accent-light: #00d4a4;
  --accent-dim: #009070;

  --text-primary: #1a2332;
  --text-secondary: #5a6a7a;
  --text-muted: #8899aa;
  --text-accent: #00b48a;

  --numpad-bg: rgba(245, 248, 252, 0.98);
  --numpad-key-bg: rgba(0, 0, 0, 0.04);
  --numpad-key-hover: rgba(0, 0, 0, 0.07);
  --numpad-key-active: rgba(0, 180, 140, 0.12);

  --modal-bg: rgba(240, 244, 248, 0.95);
  --modal-card-bg: rgba(255, 255, 255, 0.98);
}

[data-theme="light"] body::before {
  background:
    radial-gradient(ellipse at 20% 0%, rgba(0, 180, 140, 0.06) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 100%, rgba(0, 120, 200, 0.04) 0%, transparent 60%),
    linear-gradient(180deg, #f0f4f8 0%, #e8edf2 50%, #f0f4f8 100%);
}

[data-theme="light"] .setting-select option {
  background: #ffffff;
  color: #1a2332;
}

[data-theme="light"] .sidebar__close,
[data-theme="light"] .modal__close {
  background: rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .sidebar__close:hover,
[data-theme="light"] .modal__close:hover {
  background: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .nav-item__badge {
  background: rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .swap-btn {
  border-color: var(--bg-primary);
}

[data-theme="light"] .theme-toggle {
  background: rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] ::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] ::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.2);
}