/* =========================================================
   TradePulse — Premium UI Layer
   Visual-only layer. Existing JS/API/IDs remain untouched.
   ========================================================= */

:root{
  --tp-bg:#070b14;
  --tp-bg2:#0b1120;
  --tp-panel:rgba(15,23,42,.78);
  --tp-panel2:rgba(18,28,48,.72);
  --tp-border:rgba(148,163,184,.12);
  --tp-border2:rgba(99,102,241,.25);
  --tp-text:#f4f7fb;
  --tp-muted:#8492aa;
  --tp-blue:#6d7cff;
  --tp-cyan:#39c6ff;
  --tp-green:#28d7a0;
  --tp-red:#ff5f7a;
  --tp-yellow:#f5c451;
  --tp-shadow:0 20px 60px rgba(0,0,0,.28);
}

html{
  background:var(--tp-bg);
}

body{
  background:
    radial-gradient(circle at 15% -10%,rgba(91,95,255,.16),transparent 32%),
    radial-gradient(circle at 90% 0%,rgba(38,198,255,.10),transparent 28%),
    linear-gradient(180deg,#070b14 0%,#090e19 100%);
  color:var(--tp-text);
  min-height:100vh;
}

body:before{
  content:"";
  position:fixed;
  inset:0;
  pointer-events:none;
  background-image:
    linear-gradient(rgba(255,255,255,.012) 1px,transparent 1px),
    linear-gradient(90deg,rgba(255,255,255,.012) 1px,transparent 1px);
  background-size:42px 42px;
  mask-image:linear-gradient(to bottom,black,transparent 80%);
  z-index:-1;
}

/* Header */

header{
  height:76px;
  padding:0 32px;
  background:rgba(7,11,20,.78);
  backdrop-filter:blur(20px);
  -webkit-backdrop-filter:blur(20px);
  border-bottom:1px solid var(--tp-border);
  position:sticky;
  top:0;
  z-index:50;
}

.logo{
  font-size:24px;
  letter-spacing:-.5px;
  color:#fff;
}

.logo span{
  color:var(--tp-cyan);
}

.status{
  padding:8px 13px;
  border:1px solid rgba(40,215,160,.16);
  border-radius:999px;
  background:rgba(40,215,160,.06);
  color:#a8b6c9;
}

.dot{
  box-shadow:0 0 14px rgba(40,215,160,.8);
}

/* Main */

.container{
  max-width:1540px;
  padding:28px 30px 60px;
}

/* Generic cards */

.card,
.market-command,
.scanner-section,
.manual-section{
  background:
    linear-gradient(145deg,rgba(18,28,48,.88),rgba(10,16,29,.92));
  border:1px solid var(--tp-border);
  box-shadow:var(--tp-shadow);
  border-radius:20px;
}

.card{
  padding:22px;
  transition:
    transform .2s ease,
    border-color .2s ease,
    box-shadow .2s ease;
}

.card:hover{
  border-color:rgba(109,124,255,.22);
  box-shadow:
    0 22px 65px rgba(0,0,0,.32),
    0 0 0 1px rgba(109,124,255,.04);
}

.label,
.market-stat-label{
  color:var(--tp-muted);
  font-size:11px;
  letter-spacing:1px;
}

.value{
  color:#fff;
  font-weight:800;
  letter-spacing:-.5px;
}

.small{
  color:#78879f;
}

/* Market Overview */

.market-command{
  padding:24px;
  margin-bottom:18px;
  overflow:hidden;
  position:relative;
}

.market-command:before{
  content:"";
  position:absolute;
  width:420px;
  height:420px;
  right:-180px;
  top:-240px;
  border-radius:50%;
  background:rgba(109,124,255,.10);
  filter:blur(20px);
  pointer-events:none;
}

.market-command-title h2{
  font-size:21px;
  letter-spacing:-.4px;
  margin:0;
}

.market-command-sub{
  color:var(--tp-muted);
  margin-top:5px;
}

.market-live{
  padding:7px 12px;
  border-radius:999px;
  background:rgba(40,215,160,.07);
  border:1px solid rgba(40,215,160,.15);
  color:#8fe8c8;
}

.market-symbol-bar{
  margin-top:22px;
  padding:10px;
  background:rgba(4,9,18,.48);
  border:1px solid var(--tp-border);
  border-radius:15px;
}

.market-type-btn,
.market-symbol-btn,
.market-symbol-select{
  border-radius:10px;
  border:1px solid var(--tp-border);
  background:#101a2c;
  color:#dbe5f5;
}

.market-type-btn{
  transition:.2s ease;
}

.market-type-btn.active,
.market-symbol-btn.primary{
  background:linear-gradient(135deg,#6673ff,#39bff5);
  border-color:transparent;
  color:#fff;
  box-shadow:0 8px 24px rgba(82,108,255,.25);
}

.market-primary{
  margin-top:18px;
  gap:18px;
}

.market-primary-main{
  background:linear-gradient(145deg,rgba(23,34,58,.85),rgba(11,18,32,.82));
  border:1px solid var(--tp-border);
  border-radius:18px;
  padding:24px;
}

.market-primary-symbol{
  color:#91a0ba;
  font-size:13px;
  letter-spacing:1px;
}

.market-primary-price{
  margin-top:5px;
  font-size:38px;
  line-height:1.05;
  font-weight:850;
  letter-spacing:-1.5px;
}

.market-direction{
  padding:12px 20px;
  border-radius:13px;
  font-size:18px;
  font-weight:850;
  letter-spacing:.7px;
  border:1px solid currentColor;
  background:rgba(255,255,255,.025);
}

.market-direction.long{
  box-shadow:0 0 35px rgba(40,215,160,.10);
}

.market-direction.short{
  box-shadow:0 0 35px rgba(255,95,122,.10);
}

.market-primary-grid{
  gap:10px;
  margin-top:20px;
}

.market-stat{
  background:rgba(4,9,18,.52);
  border:1px solid var(--tp-border);
  border-radius:13px;
  padding:15px;
}

.market-stat-value{
  font-size:20px;
  font-weight:800;
  margin-top:7px;
}

.market-mini-chart{
  background:rgba(4,9,18,.45);
  border:1px solid var(--tp-border);
  border-radius:18px;
  padding:18px;
}

/* Signal cards */

.grid{
  gap:16px;
}

.grid > .card{
  min-height:128px;
}

.grid > .card:nth-child(1){
  background:
    linear-gradient(145deg,rgba(23,34,58,.92),rgba(11,18,32,.92));
}

.grid > .card:nth-child(2){
  background:
    radial-gradient(circle at 50% 20%,rgba(109,124,255,.12),transparent 65%),
    linear-gradient(145deg,rgba(23,34,58,.92),rgba(11,18,32,.92));
}

.signal{
  display:flex;
  flex-direction:column;
  justify-content:center;
}

.signal .value{
  font-size:36px;
  margin-top:10px;
}

.long{
  color:var(--tp-green);
}

.short{
  color:var(--tp-red);
}

.wait{
  color:var(--tp-yellow);
}

/* Metrics */

.metric{
  background:rgba(4,9,18,.48);
  border:1px solid rgba(148,163,184,.08);
  border-radius:13px;
  padding:15px;
}

.metric .v{
  color:#eef4ff;
  font-size:15px;
}

/* Tables */

table{
  border-spacing:0;
}

th{
  color:#718099;
  text-transform:uppercase;
  letter-spacing:.7px;
  font-size:10px;
}

th,td{
  border-bottom-color:rgba(148,163,184,.08);
}

tr:hover td{
  background:rgba(109,124,255,.025);
}

/* Section titles */

.section-title{
  color:#f2f6fc;
  font-size:16px;
  letter-spacing:-.2px;
}

/* Manual trading */

.manual-section{
  padding:22px;
}

.manual-form{
  gap:12px;
}

.manual-form input,
.manual-form select,
.manual-form textarea{
  background:#0a1221 !important;
  border:1px solid rgba(148,163,184,.13) !important;
  color:#edf4ff !important;
  border-radius:11px !important;
}

.manual-btn{
  border-radius:10px !important;
  border:1px solid var(--tp-border) !important;
  background:#101a2c !important;
  color:#dce7f7 !important;
  transition:.2s ease;
}

.manual-btn:hover{
  transform:translateY(-1px);
  border-color:rgba(109,124,255,.35) !important;
}

.manual-btn.primary{
  background:linear-gradient(135deg,#6673ff,#39bff5) !important;
  border:0 !important;
  color:#fff !important;
}

.manual-btn.danger{
  background:rgba(255,95,122,.08) !important;
  color:#ff8095 !important;
  border-color:rgba(255,95,122,.18) !important;
}

/* Scanner */

.scanner-section{
  overflow:hidden;
}

.scanner-title{
  color:#fff;
}

/* Scrollbar */

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

::-webkit-scrollbar-track{
  background:#070b14;
}

::-webkit-scrollbar-thumb{
  background:#202c43;
  border-radius:999px;
}

::-webkit-scrollbar-thumb:hover{
  background:#30415f;
}

/* Responsive */

@media(max-width:1100px){
  .container{
    padding:20px;
  }

  .grid{
    grid-template-columns:repeat(2,1fr);
  }
}

@media(max-width:700px){
  header{
    height:64px;
    padding:0 16px;
  }

  .container{
    padding:14px 12px 40px;
  }

  .grid,
  .two{
    grid-template-columns:1fr;
  }

  .market-primary-price{
    font-size:30px;
  }

  .market-command,
  .card,
  .manual-section{
    border-radius:15px;
  }
}
