@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,200;0,300;0,400;0,500;0,600;0,700;0,800;1,800&display=swap');

:root {
  --primary: #3b82f6;
  --bg-dark: #050505;
  --panel-bg: #0f172a;
  --chart-up: #10b981;
  --chart-down: #e11d48;
  --font-main: 'Plus Jakarta Sans', sans-serif;
  --app-viewport-height: 100vh;
  --mobile-trade-controls-height: 185px;
  --mobile-chart-height: calc(var(--app-viewport-height) - 64px - var(--mobile-trade-controls-height));
}

* {
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-dark);
  color: #f1f5f9;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}

body.app-loading {
  overflow: hidden;
}

body.app-loading #app {
  opacity: 0;
  visibility: hidden;
}

body.app-ready #app {
  opacity: 1;
  visibility: visible;
}

#boot-screen {
  opacity: 1;
  transition: opacity 180ms ease;
}

body.app-ready #boot-screen {
  opacity: 0;
  pointer-events: none;
}

.boot-loader-image {
  filter: drop-shadow(0 16px 42px rgba(0, 0, 0, 0.38));
}

/* Custom Scrollbar */
.scroll-custom::-webkit-scrollbar {
  width: 5px;
}
.scroll-custom::-webkit-scrollbar-track {
  background: rgba(255,255,255,0.02);
}
.scroll-custom::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.1);
  border-radius: 10px;
}

/* Animations */
@keyframes modalSlideUp {
  from { transform: translateY(30px) scale(0.95); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

.modal-content {
  animation: modalSlideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Lightweight Charts Customization */
.tv-lightweight-charts {
  width: 100% !important;
  height: 100% !important;
}

/* Mobile responsive layout */
@media (max-width: 768px) {
  #trading-view {
    height: var(--app-viewport-height) !important;
  }
  .chart-stage {
    padding-bottom: var(--mobile-trade-controls-height);
  }
  #trade-controls {
    position: fixed;
    bottom: 0;
    left: 0;
    z-index: 40;
    background: linear-gradient(180deg, rgba(5, 5, 5, 0.88), rgba(5, 5, 5, 0.97));
    padding-bottom: calc(0.55rem + env(safe-area-inset-bottom));
    width: 100% !important;
    border-top: 1px solid rgba(255,255,255,0.08);
  }
  #chart-container {
    height: max(var(--mobile-chart-height), 320px) !important;
    min-height: max(var(--mobile-chart-height), 320px) !important;
  }
  #center-timer {
    font-size: 1rem !important;
  }
  #trade-controls label {
    font-size: 9px !important;
  }
}

/* Chart Control Active State */
.chart-type-btn.active {
  background: rgba(99, 102, 241, 0.2);
  color: #818cf8;
}

/* 3D Glassmorphism effects */
.glass {
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input:focus {
  border-color: var(--primary) !important;
  box-shadow: 0 0 20px -5px rgba(99, 102, 241, 0.3);
}

/* Timer Pulsating Animation */
#center-timer {
  text-shadow: 0 0 20px rgba(255,255,255,0.1);
}


.chart-stage {
  background:
    linear-gradient(180deg, rgba(5, 5, 5, 0.78), rgba(5, 5, 5, 0.92)),
    url('./uae6dq12h96cprd0.png') center center / cover no-repeat;
}

.chart-surface::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at top, rgba(59, 130, 246, 0.08), transparent 42%),
    rgba(3, 7, 18, 0.28);
  pointer-events: none;
  z-index: 0;
}

.chart-surface > * {
  position: relative;
  z-index: 1;
}


.chart-stage {
  background-color: #050505 !important;
}

#chart-container.chart-surface {
  background:
    linear-gradient(180deg, rgba(5, 5, 5, 0.52), rgba(5, 5, 5, 0.74)),
    url('./uae6dq12h96cprd0.png') center center / cover no-repeat !important;
  overflow: hidden;
}

@media (max-width: 768px) {
  #chart-container.chart-surface {
    background-position: center top !important;
    background-size: auto 100% !important;
    background-repeat: no-repeat !important;
  }

  #chart-container.chart-surface::before {
    background:
      linear-gradient(180deg, rgba(5, 5, 5, 0.18), rgba(5, 5, 5, 0.42)),
      rgba(3, 7, 18, 0.16);
  }
}

body[data-trade-theme='aurora'] #trading-view {
  background:
    radial-gradient(circle at top left, rgba(12, 148, 136, 0.18), transparent 28%),
    radial-gradient(circle at top right, rgba(255, 160, 122, 0.18), transparent 24%),
    linear-gradient(180deg, #041018 0%, #09131d 48%, #060b12 100%);
}

body[data-trade-theme='aurora'] #trading-view header {
  background: rgba(5, 18, 27, 0.72) !important;
  border-bottom-color: rgba(125, 211, 252, 0.12) !important;
  box-shadow: 0 18px 40px -28px rgba(52, 211, 153, 0.45);
}

body[data-trade-theme='aurora'] #trade-controls {
  background: linear-gradient(180deg, rgba(7, 17, 25, 0.94), rgba(6, 12, 18, 0.98)) !important;
  border-color: rgba(125, 211, 252, 0.12) !important;
}

body[data-trade-theme='aurora'] #active-trade-details,
body[data-trade-theme='aurora'] #sidebar > div,
body[data-trade-theme='aurora'] #asset-picker > div,
body[data-trade-theme='aurora'] #modal-deposit,
body[data-trade-theme='aurora'] #modal-withdraw,
body[data-trade-theme='aurora'] #modal-onboarding,
body[data-trade-theme='aurora'] #modal-info {
  border-color: rgba(125, 211, 252, 0.14) !important;
  box-shadow: 0 22px 60px -34px rgba(34, 211, 238, 0.34);
}

body[data-trade-theme='aurora'] .chart-stage {
  background:
    radial-gradient(circle at 20% 15%, rgba(34, 211, 238, 0.12), transparent 30%),
    radial-gradient(circle at 80% 10%, rgba(251, 146, 60, 0.1), transparent 24%),
    #050b12 !important;
}

body[data-trade-theme='aurora'] #chart-container.chart-surface {
  background:
    linear-gradient(180deg, rgba(4, 15, 24, 0.5), rgba(3, 10, 18, 0.72)),
    url('./uae6dq12h96cprd0.png') center center / cover no-repeat !important;
}

body[data-trade-theme='aurora'] #chart-container.chart-surface::before {
  background:
    radial-gradient(circle at top, rgba(110, 231, 216, 0.12), transparent 38%),
    linear-gradient(180deg, rgba(2, 6, 23, 0.08), rgba(2, 6, 23, 0.24));
}

body[data-trade-theme='aurora'] .chart-type-btn {
  color: #9fd7e3;
}

body[data-trade-theme='aurora'] .chart-type-btn.active {
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.22), rgba(103, 232, 249, 0.12));
  color: #d9fbff;
  box-shadow: inset 0 0 0 1px rgba(125, 211, 252, 0.14);
}

body[data-trade-theme='aurora'] #mobile-price-tag {
  background: linear-gradient(135deg, #22d3ee, #0ea5e9) !important;
  border-color: rgba(186, 230, 253, 0.34) !important;
  color: #02131a;
}

body[data-trade-theme='aurora'] #center-timer {
  color: #ecfeff !important;
  text-shadow: 0 0 24px rgba(125, 211, 252, 0.35);
}

body[data-trade-theme='aurora'] .trade-action-btn {
  border: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

body[data-trade-theme='aurora'] .trade-action-btn::before {
  content: '';
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255,255,255,0.14), rgba(255,255,255,0.02));
  opacity: 0.85;
}

body[data-trade-theme='aurora'] .trade-action-btn::after {
  content: '';
  position: absolute;
  inset: auto -15% -55% -15%;
  height: 80%;
  filter: blur(28px);
  opacity: 0.52;
}

body[data-trade-theme='aurora'] .trade-action-buy {
  background: linear-gradient(135deg, #0f766e, #14b8a6 55%, #99f6e4) !important;
  box-shadow: 0 20px 34px -24px rgba(45, 212, 191, 0.72) !important;
}

body[data-trade-theme='aurora'] .trade-action-buy::after {
  background: rgba(45, 212, 191, 0.8);
}

body[data-trade-theme='aurora'] .trade-action-sell {
  background: linear-gradient(135deg, #9a3412, #f97316 58%, #fdba74) !important;
  box-shadow: 0 20px 34px -24px rgba(249, 115, 22, 0.68) !important;
}

body[data-trade-theme='aurora'] .trade-action-sell::after {
  background: rgba(251, 146, 60, 0.8);
}

body[data-trade-theme='aurora'] .trade-action-btn > div {
  position: relative;
  z-index: 1;
}

body[data-trade-theme='aurora'] #trade-duration,
body[data-trade-theme='aurora'] #invest-amount {
  background: rgba(3, 10, 18, 0.82) !important;
  border-color: rgba(125, 211, 252, 0.14) !important;
  color: #f0fdff;
}

body[data-trade-theme='aurora'] #sidebar-balance,
body[data-trade-theme='aurora'] #user-balance {
  color: #8ffcf2 !important;
}

body[data-trade-theme='aurora'] #btn-admin-panel,
body[data-trade-theme='aurora'] header button,
body[data-trade-theme='aurora'] #sidebar button,
body[data-trade-theme='aurora'] #sidebar a {
  transition: all 180ms ease;
}

body[data-trade-theme='aurora'] #trade-controls,
body[data-trade-theme='professional'] #trade-controls,
body[data-trade-theme='retro'] #trade-controls,
body[data-trade-theme='gamer'] #trade-controls {
  transition: background 220ms ease, border-color 220ms ease, box-shadow 220ms ease;
}

body[data-trade-theme='aurora'] #trading-view {
  background:
    radial-gradient(circle at 14% 8%, rgba(45, 212, 191, 0.24), transparent 26%),
    radial-gradient(circle at 86% 10%, rgba(251, 146, 60, 0.22), transparent 22%),
    linear-gradient(180deg, #03111a 0%, #071722 46%, #040b12 100%);
}

body[data-trade-theme='aurora'] #trading-view header {
  background: linear-gradient(180deg, rgba(5, 18, 27, 0.84), rgba(4, 14, 22, 0.72)) !important;
  border-bottom-color: rgba(110, 231, 216, 0.18) !important;
  box-shadow: 0 24px 60px -44px rgba(34, 211, 238, 0.52);
}

body[data-trade-theme='aurora'] .chart-stage {
  background:
    radial-gradient(circle at 20% 15%, rgba(34, 211, 238, 0.18), transparent 34%),
    radial-gradient(circle at 78% 6%, rgba(249, 115, 22, 0.18), transparent 24%),
    linear-gradient(180deg, #04121a 0%, #071a26 60%, #07111a 100%) !important;
}

body[data-trade-theme='aurora'] #chart-container.chart-surface {
  background:
    linear-gradient(180deg, rgba(5, 19, 30, 0.42), rgba(4, 11, 18, 0.62)),
    url('./uae6dq12h96cprd0.png') center center / cover no-repeat !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}

body[data-trade-theme='aurora'] #chart-container.chart-surface::before {
  background:
    radial-gradient(circle at top, rgba(110, 231, 216, 0.16), transparent 38%),
    linear-gradient(180deg, rgba(14, 165, 233, 0.04), rgba(2, 6, 23, 0.24));
}

body[data-trade-theme='aurora'] #trade-controls {
  background: linear-gradient(180deg, rgba(4, 16, 24, 0.94), rgba(3, 10, 16, 0.985)) !important;
  border-color: rgba(110, 231, 216, 0.14) !important;
  box-shadow: -24px 0 70px -50px rgba(34, 211, 238, 0.24);
}

body[data-trade-theme='aurora'] #center-timer {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 168px;
  min-height: 62px;
  padding: 0 18px;
  border-radius: 22px;
  border: 1px solid rgba(125, 211, 252, 0.16);
  background: linear-gradient(180deg, rgba(7, 27, 36, 0.9), rgba(3, 11, 19, 0.94));
  color: #effffb !important;
  letter-spacing: 0.08em;
  text-shadow: 0 0 22px rgba(103, 232, 249, 0.42);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 18px 40px -28px rgba(34, 211, 238, 0.36);
}

body[data-trade-theme='aurora'] #active-trade-details {
  background: linear-gradient(180deg, rgba(4, 15, 24, 0.84), rgba(2, 8, 14, 0.9));
  border-color: rgba(110, 231, 216, 0.12) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}

body[data-trade-theme='aurora'] .chart-type-btn.active {
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.28), rgba(125, 211, 252, 0.12));
  color: #ecfeff;
  box-shadow: inset 0 0 0 1px rgba(125, 211, 252, 0.14);
}

body[data-trade-theme='aurora'] .trade-action-btn {
  border: 1px solid rgba(255,255,255,0.08);
  backdrop-filter: blur(10px);
}

body[data-trade-theme='aurora'] .trade-action-btn::before {
  content: '';
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255,255,255,0.18), rgba(255,255,255,0.02));
  opacity: 0.85;
}

body[data-trade-theme='aurora'] .trade-action-btn::after {
  content: '';
  position: absolute;
  inset: auto -16% -58% -16%;
  height: 82%;
  filter: blur(28px);
  opacity: 0.52;
}

body[data-trade-theme='aurora'] .trade-action-buy {
  background: linear-gradient(135deg, #0f766e, #14b8a6 56%, #99f6e4) !important;
  box-shadow: 0 22px 38px -26px rgba(45, 212, 191, 0.78) !important;
}

body[data-trade-theme='aurora'] .trade-action-buy::after { background: rgba(45, 212, 191, 0.84); }

body[data-trade-theme='aurora'] .trade-action-sell {
  background: linear-gradient(135deg, #9a3412, #f97316 58%, #fdba74) !important;
  box-shadow: 0 22px 38px -26px rgba(249, 115, 22, 0.78) !important;
}

body[data-trade-theme='aurora'] .trade-action-sell::after { background: rgba(251, 146, 60, 0.84); }

body[data-trade-theme='aurora'] .trade-action-btn > div { position: relative; z-index: 1; }
body[data-trade-theme='aurora'] #trade-duration,
body[data-trade-theme='aurora'] #invest-amount,
body[data-trade-theme='aurora'] #sidebar > div,
body[data-trade-theme='aurora'] #asset-picker > div { border-color: rgba(125, 211, 252, 0.14) !important; }
body[data-trade-theme='aurora'] #mobile-price-tag { background: linear-gradient(135deg, #67e8f9, #06b6d4) !important; color: #06222a; }
body[data-trade-theme='aurora'] #sidebar-balance,
body[data-trade-theme='aurora'] #user-balance { color: #9bf8ee !important; }

body[data-trade-theme='professional'] #trading-view {
  background: linear-gradient(180deg, #0a1019 0%, #111827 45%, #0b1220 100%);
}

body[data-trade-theme='professional'] #trading-view header {
  background: rgba(12, 18, 28, 0.94) !important;
  border-bottom-color: rgba(71, 85, 105, 0.55) !important;
}

body[data-trade-theme='professional'] .chart-stage {
  background: linear-gradient(180deg, #0b1220 0%, #0e1728 54%, #0a1220 100%) !important;
}

body[data-trade-theme='professional'] #chart-container.chart-surface {
  background: linear-gradient(180deg, rgba(11, 18, 32, 0.55), rgba(11, 18, 32, 0.74)) !important;
}

body[data-trade-theme='professional'] #chart-container.chart-surface::before {
  background: linear-gradient(180deg, rgba(255,255,255,0.015), rgba(2,6,23,0.08));
}

body[data-trade-theme='professional'] #trade-controls {
  background: linear-gradient(180deg, rgba(10, 15, 24, 0.98), rgba(9, 14, 22, 0.99)) !important;
  border-color: rgba(71, 85, 105, 0.46) !important;
}

body[data-trade-theme='professional'] #center-timer {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 152px;
  min-height: 54px;
  padding: 0 18px;
  border-radius: 14px;
  background: #0b1422;
  border: 1px solid rgba(71, 85, 105, 0.62);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}

body[data-trade-theme='professional'] .trade-action-buy,
body[data-trade-theme='professional'] .trade-action-sell {
  border-radius: 12px !important;
  letter-spacing: 0.08em;
}

body[data-trade-theme='professional'] .trade-action-buy { background: linear-gradient(180deg, #1fb56e, #149e5f) !important; }
body[data-trade-theme='professional'] .trade-action-sell { background: linear-gradient(180deg, #f05767, #dc4458) !important; }
body[data-trade-theme='professional'] .chart-type-btn.active { background: rgba(59,130,246,0.18); color: #bfdbfe; }
body[data-trade-theme='professional'] #mobile-price-tag { background: #1d4ed8 !important; }

body[data-trade-theme='retro'] #trading-view {
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.08), rgba(0,0,0,0.08)),
    #071107;
  color: #b8ffb3;
}

body[data-trade-theme='retro'] #trading-view header,
body[data-trade-theme='retro'] #trade-controls,
body[data-trade-theme='retro'] #sidebar > div,
body[data-trade-theme='retro'] #active-trade-details {
  background: rgba(7, 20, 7, 0.96) !important;
  border-color: rgba(74, 222, 128, 0.18) !important;
  box-shadow: inset 0 0 0 1px rgba(34, 197, 94, 0.08);
}

body[data-trade-theme='retro'] .chart-stage,
body[data-trade-theme='retro'] #chart-container.chart-surface {
  background: linear-gradient(180deg, rgba(3, 10, 3, 0.84), rgba(4, 14, 4, 0.92)) !important;
}

body[data-trade-theme='retro'] #chart-container.chart-surface::before {
  background:
    repeating-linear-gradient(180deg, rgba(74,222,128,0.06) 0 1px, transparent 1px 4px),
    rgba(0,0,0,0.06);
}

body[data-trade-theme='retro'] #center-timer {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 170px;
  min-height: 56px;
  border-radius: 8px;
  background: #020702;
  border: 1px solid rgba(74, 222, 128, 0.32);
  color: #b8ffb3 !important;
  text-shadow: 0 0 10px rgba(134, 239, 172, 0.5);
  box-shadow: inset 0 0 0 1px rgba(134, 239, 172, 0.06), 0 0 24px rgba(34, 197, 94, 0.08);
}

body[data-trade-theme='retro'] .trade-action-btn {
  border-radius: 10px !important;
  border: 1px solid rgba(74, 222, 128, 0.18);
}

body[data-trade-theme='retro'] .trade-action-buy { background: linear-gradient(180deg, #166534, #15803d) !important; }
body[data-trade-theme='retro'] .trade-action-sell { background: linear-gradient(180deg, #854d0e, #a16207) !important; }
body[data-trade-theme='retro'] .chart-type-btn,
body[data-trade-theme='retro'] #trade-duration,
body[data-trade-theme='retro'] #invest-amount,
body[data-trade-theme='retro'] #mobile-price-tag,
body[data-trade-theme='retro'] #user-balance,
body[data-trade-theme='retro'] #sidebar-balance { color: #b8ffb3 !important; }
body[data-trade-theme='retro'] #mobile-price-tag { background: #14532d !important; }

body[data-trade-theme='gamer'] #trading-view {
  background:
    radial-gradient(circle at 18% 10%, rgba(168, 85, 247, 0.24), transparent 24%),
    radial-gradient(circle at 86% 14%, rgba(34, 211, 238, 0.2), transparent 26%),
    linear-gradient(180deg, #090512 0%, #12061d 52%, #08040f 100%);
}

body[data-trade-theme='gamer'] #trading-view header {
  background: linear-gradient(180deg, rgba(18, 7, 31, 0.92), rgba(13, 6, 24, 0.84)) !important;
  border-bottom-color: rgba(217, 70, 239, 0.18) !important;
}

body[data-trade-theme='gamer'] .chart-stage {
  background:
    radial-gradient(circle at 20% 12%, rgba(192, 132, 252, 0.16), transparent 30%),
    radial-gradient(circle at 82% 8%, rgba(34, 211, 238, 0.14), transparent 28%),
    linear-gradient(180deg, #0a0716 0%, #130922 55%, #090412 100%) !important;
}

body[data-trade-theme='gamer'] #chart-container.chart-surface {
  background:
    linear-gradient(180deg, rgba(11, 6, 22, 0.48), rgba(8, 4, 18, 0.72)),
    url('./uae6dq12h96cprd0.png') center center / cover no-repeat !important;
}

body[data-trade-theme='gamer'] #chart-container.chart-surface::before {
  background:
    radial-gradient(circle at top, rgba(192, 132, 252, 0.16), transparent 40%),
    linear-gradient(180deg, rgba(34, 211, 238, 0.04), rgba(15, 23, 42, 0.18));
}

body[data-trade-theme='gamer'] #trade-controls {
  background: linear-gradient(180deg, rgba(13, 6, 24, 0.96), rgba(8, 4, 18, 0.985)) !important;
  border-color: rgba(217, 70, 239, 0.16) !important;
}

body[data-trade-theme='gamer'] #center-timer {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 170px;
  min-height: 58px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.14), rgba(168, 85, 247, 0.14));
  border: 1px solid rgba(192, 132, 252, 0.24);
  color: #faf5ff !important;
  text-shadow: 0 0 16px rgba(217, 70, 239, 0.38);
  box-shadow: 0 0 0 1px rgba(34, 211, 238, 0.08) inset, 0 0 24px rgba(168, 85, 247, 0.16);
}

body[data-trade-theme='gamer'] .trade-action-btn {
  border-radius: 18px !important;
  border: 1px solid rgba(255,255,255,0.07);
  text-transform: uppercase;
}

body[data-trade-theme='gamer'] .trade-action-btn::before {
  content: '';
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255,255,255,0.12), rgba(255,255,255,0.01));
}

body[data-trade-theme='gamer'] .trade-action-buy { background: linear-gradient(135deg, #0891b2, #06b6d4 50%, #67e8f9) !important; }
body[data-trade-theme='gamer'] .trade-action-sell { background: linear-gradient(135deg, #be185d, #f43f5e 52%, #fb7185) !important; }
body[data-trade-theme='gamer'] .chart-type-btn.active { background: linear-gradient(135deg, rgba(192,132,252,0.22), rgba(34,211,238,0.18)); color: #f5d0fe; }
body[data-trade-theme='gamer'] #mobile-price-tag { background: linear-gradient(135deg, #14b8a6, #22d3ee) !important; }
body[data-trade-theme='gamer'] #user-balance,
body[data-trade-theme='gamer'] #sidebar-balance { color: #f0abfc !important; }
