/*!
 * ta-skin.css v1.0 — JC Algos 技術分析：金色交易終端主題
 * 只做視覺層，唔改任何 id / class / 功能。
 */

:root {
  --ta-gold:   #f6b73c;
  --ta-gold-2: #ff8f3c;
  --ta-gold-3: #ffd98a;
  --ta-ink:    #eef3f8;
  --ta-muted:  #a7b4c2;
  --ta-bg:     #090c11;
  --ta-card:   rgba(24, 27, 33, 0.90);
  --ta-line:   rgba(246, 183, 60, 0.24);
  --ta-line-2: rgba(246, 183, 60, 0.38);

  /* 覆蓋原頁面變數，令 Bootstrap 元件一齊跟色 */
  --primary: #b57a12;
  --primary-light: #f6b73c;
  --secondary: #f6b73c;
  --accent: #ffcf7a;
  --success: #22c55e;
  --danger: #f43f5e;
}

html { scroll-behavior: smooth; }

body {
  background:
    radial-gradient(1100px 720px at 12% -8%, rgba(246, 183, 60, 0.13), transparent 60%),
    radial-gradient(900px 640px at 88% 4%, rgba(255, 143, 60, 0.10), transparent 62%),
    radial-gradient(900px 900px at 50% 110%, rgba(120, 90, 20, 0.16), transparent 65%),
    linear-gradient(160deg, #090c11 0%, #0d1219 55%, #0a0e14 100%);
  background-attachment: fixed;
  color: var(--ta-ink);
  font-family: 'Inter', 'Microsoft JhengHei', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

#taBg {
  position: fixed; inset: 0; width: 100%; height: 100%;
  z-index: 0; pointer-events: none; opacity: .85;
}
.container-fluid { position: relative; z-index: 1; }

/* ---------------------------------------------------------------- header */
.header {
  background: linear-gradient(135deg, rgba(24, 18, 8, .92) 0%, rgba(32, 22, 9, .86) 55%, rgba(18, 14, 8, .92) 100%);
  border: 1px solid var(--ta-line);
  border-radius: 22px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 216, 138, .12);
  position: relative;
  overflow: hidden;
}
.header::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--ta-gold), var(--ta-gold-2), transparent);
  animation: taSweep 7s linear infinite;
}
@keyframes taSweep { 0% { transform: translateX(-60%); } 100% { transform: translateX(60%); } }

.header h1 {
  background: linear-gradient(92deg, #fff 0%, var(--ta-gold-3) 45%, var(--ta-gold) 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  letter-spacing: -0.02em;
}
.header p { color: rgba(233, 238, 245, .78); }

/* ----------------------------------------------------------------- cards */
.card-dark, .chart-container, .loading-spinner {
  background: var(--ta-card);
  border: 1px solid var(--ta-line);
  border-radius: 20px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .04);
  backdrop-filter: blur(16px) saturate(125%);
  -webkit-backdrop-filter: blur(16px) saturate(125%);
  transition: transform .35s cubic-bezier(.16,1,.3,1), box-shadow .35s, border-color .35s;
}
.card-dark:hover, .chart-container:hover {
  transform: translateY(-3px);
  border-color: var(--ta-line-2);
  box-shadow: 0 26px 64px rgba(0, 0, 0, .55), 0 0 24px rgba(246, 183, 60, .10);
}
.card-dark h5 {
  color: var(--ta-gold-3);
  border-bottom: 1px solid var(--ta-line);
  letter-spacing: .02em;
}
.login-container {
  background: rgba(23, 30, 41, .92);
  border: 1px solid rgba(246, 183, 60, .26);
  border-radius: 20px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .6), 0 0 60px rgba(246, 183, 60, .10);
  backdrop-filter: blur(16px);
}

/* ---------------------------------------------------------------- inputs */
.form-control-dark, .form-select-dark, .form-control, .form-select {
  background: rgba(10, 14, 20, .78) !important;
  border: 1px solid rgba(246, 183, 60, .18) !important;
  color: var(--ta-ink) !important;
  border-radius: 12px !important;
  transition: border-color .25s, box-shadow .25s, background .25s;
}
.form-control-dark:focus, .form-select-dark:focus, .form-control:focus, .form-select:focus {
  background: rgba(14, 19, 26, .95) !important;
  border-color: var(--ta-gold) !important;
  box-shadow: 0 0 0 3px rgba(246, 183, 60, .18), 0 0 22px rgba(246, 183, 60, .18) !important;
  color: #fff !important;
}
.form-control-dark::placeholder { color: #6b7885 !important; }

.form-select-dark {
  background: rgba(10, 14, 20, .78) url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23f6b73c' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e") no-repeat right 12px center / 16px 12px !important;
}

/* --------------------------------------------------------------- buttons */
.btn-cyan {
  background: linear-gradient(135deg, var(--ta-gold-3) 0%, var(--ta-gold) 45%, var(--ta-gold-2) 100%);
  color: #1a1206 !important;
  font-weight: 800;
  letter-spacing: .02em;
  border: none;
  border-radius: 12px;
  box-shadow: 0 12px 30px rgba(246, 183, 60, .26);
  position: relative; overflow: hidden;
  transition: transform .25s cubic-bezier(.16,1,.3,1), box-shadow .3s, filter .3s;
}
.btn-cyan:hover, .btn-cyan:focus {
  transform: translateY(-2px);
  filter: brightness(1.06);
  box-shadow: 0 18px 40px rgba(246, 183, 60, .38);
  color: #1a1206 !important;
}
.btn-cyan:active { transform: translateY(0) scale(.99); }
.btn-outline-cyan, .btn-outline-info {
  background: rgba(246, 183, 60, .06);
  color: var(--ta-gold-3) !important;
  border: 1px solid rgba(246, 183, 60, .45) !important;
  border-radius: 10px;
  transition: all .25s;
}
.btn-outline-cyan:hover, .btn-outline-info:hover,
.btn-outline-info.active { background: rgba(246, 183, 60, .18); color: #fff !important; }

/* ------------------------------------------------------------ stat chips */
.stat-grid { gap: 10px; }
.stat-item {
  background: linear-gradient(180deg, rgba(246, 183, 60, .11), rgba(246, 183, 60, .03));
  border: 1px solid rgba(246, 183, 60, .22);
  border-radius: 14px;
  transition: transform .3s, border-color .3s, box-shadow .3s;
}
.stat-item:hover {
  transform: translateY(-2px);
  border-color: rgba(246, 183, 60, .5);
  box-shadow: 0 10px 26px rgba(0, 0, 0, .35), 0 0 20px rgba(246, 183, 60, .12);
}
.stat-item .label { color: var(--ta-muted); letter-spacing: .08em; }
.stat-item .value { color: var(--ta-gold-3); text-shadow: 0 0 22px rgba(246, 183, 60, .35); }
.stat-item .sub { color: #6f7d8b; }

/* ----------------------------------------------------------- report text */
.report-box {
  background: rgba(8, 11, 16, .72);
  border: 1px solid rgba(246, 183, 60, .16);
  border-radius: 16px;
  color: #d7e2ec;
  font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  font-size: .88rem;
  line-height: 1.75;
}
.report-box::-webkit-scrollbar-thumb { background: linear-gradient(180deg, var(--ta-gold), var(--ta-gold-2)); }

/* ---------------------------------------------------------------- charts */
.chart-container { padding: 18px; }
.chart-container h6 { color: var(--ta-gold-3); }
.chart-container img { border-radius: 12px; box-shadow: 0 12px 30px rgba(0, 0, 0, .45); }
#interactiveChart { border-radius: 14px; background: #0b0f14; }

/* ----------------------------------------------------------------- modal */
.chart-modal { background: rgba(4, 6, 9, .9) !important; backdrop-filter: blur(6px); }
.chart-modal img { border-radius: 14px; box-shadow: 0 30px 80px rgba(0, 0, 0, .7); }

/* ------------------------------------------------------------- bootstrap */
.alert-danger {
  background: rgba(244, 63, 94, .12);
  border-color: rgba(244, 63, 94, .45);
  color: #ffb4bf;
  border-radius: 12px;
}
.text-bullish { color: #34d399 !important; }
.text-bearish { color: #fb7185 !important; }
.spinner-custom { border-color: rgba(246, 183, 60, .18); border-top-color: var(--ta-gold); }
hr, .border-bottom, .border-top { border-color: rgba(246, 183, 60, .12) !important; }


/* ------------------------------------------------------------ typography */
.text-muted, .form-text { color: #a9b6c4 !important; }
.form-label { color: #cfd9e3 !important; font-weight: 600; letter-spacing: .02em; font-size: .86rem; }
.login-container h3 { font-weight: 800; letter-spacing: -.01em; }
.login-container .form-control { border-color: rgba(246,183,60,.28) !important; }
.alert, .alert-info { background: rgba(246,183,60,.08) !important; border-color: rgba(246,183,60,.28) !important; color: #f0d9a8 !important; }


/* ------------------------------------------------------------- controls */
.btn-sm.btn-outline-cyan {
  border-radius: 999px !important; padding: 6px 12px !important;
  font-size: .78rem !important; letter-spacing: .02em;
}
.btn-sm.btn-outline-cyan:hover { background: rgba(246,183,60,.22) !important; }

.btn-group .btn-outline-info {
  border-color: rgba(246,183,60,.35) !important;
  color: #d9c39a !important; font-weight: 600;
}
.btn-group .btn-outline-info.active {
  background: linear-gradient(135deg, var(--ta-gold-3), var(--ta-gold)) !important;
  color: #1a1206 !important; font-weight: 800;
  box-shadow: 0 6px 18px rgba(246,183,60,.3);
}

/* 側欄唔好長過畫面 */
#mainContainer .col-lg-3 .card-dark {
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  scrollbar-width: thin;
}
#mainContainer .col-lg-3 .card-dark::-webkit-scrollbar { width: 6px; }
#mainContainer .col-lg-3 .card-dark::-webkit-scrollbar-thumb { background: rgba(246,183,60,.4); border-radius: 6px; }

/* 圖表未載入：深色佔位，唔好出現死白 */
#interactiveChartContainer.chart-empty { position: relative; }
#interactiveChartContainer.chart-empty iframe { opacity: 0; }
#interactiveChartContainer.chart-empty::after {
  content: "輸入股票代碼後顯示圖表";
  position: absolute; inset: 0; display: grid; place-items: center;
  color: #8b98a5; font-size: .85rem; letter-spacing: .06em;
  background:
    repeating-linear-gradient(45deg, rgba(246,183,60,.035) 0 10px, transparent 10px 20px),
    rgba(8, 11, 16, .8);
  border: 1px dashed rgba(246,183,60,.22); border-radius: 14px;
}
::placeholder { color: #7d8a97 !important; }
small, .small { color: #a9b6c4; }


/* ---------------------------------------------------------- scrollbars */
html { scrollbar-color: #f6b73c #0b0f14; scrollbar-width: thin; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #0b0f14; }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #f6b73c, #ff8f3c);
  border-radius: 10px; border: 2px solid #0b0f14;
}
::-webkit-scrollbar-thumb:hover { background: linear-gradient(180deg, #ffd98a, #ff8f3c); }

/* 次要比賽：登出更低调 */
.header .btn-outline-cyan[onclick*="logout"] { opacity: .8; }
.header .btn-outline-cyan[onclick*="logout"]:hover { opacity: 1; }

/* --------------------------------------------------------------- motion */
@keyframes taIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.ta-in { animation: taIn .7s cubic-bezier(.16,1,.3,1) both; }
@media (prefers-reduced-motion: reduce) {
  .ta-in { animation-duration: .01ms; }
  .header::after { animation: none; }
}

/* ripple */
.ta-ripple {
  position: absolute; border-radius: 50%; transform: scale(0);
  background: rgba(255, 255, 255, .55); pointer-events: none;
  animation: taRipple .6s ease-out forwards;
}
@keyframes taRipple { to { transform: scale(2.6); opacity: 0; } }

/* ------------------------------------------------------------ anim toggle */
#taAnimToggle {
  position: fixed; right: 16px; bottom: 16px; z-index: 2147483000;
  width: 42px; height: 42px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(18, 24, 33, .9); color: var(--ta-gold-3);
  border: 1px solid rgba(246, 183, 60, .35);
  cursor: pointer; font-size: 17px;
  box-shadow: 0 10px 26px rgba(0, 0, 0, .5);
  transition: transform .2s, opacity .2s;
}
#taAnimToggle:hover { transform: translateY(-2px); }
#taAnimToggle.off { opacity: .45; filter: grayscale(1); }

/* ------------------------------------------------------------------ mobile */
@media (max-width: 576px) {
  .header { padding: 18px 18px; border-radius: 18px; }
  .header p { word-break: keep-all; }
  #mainContainer { padding-bottom: 72px; }
  #taAnimToggle { width: 38px; height: 38px; font-size: 15px; right: 12px; bottom: 12px; }
  .header h1 { font-size: 1.25rem !important; line-height: 1.3; }
  .header p { font-size: .82rem; }
  .card-dark, .login-container { padding: 18px !important; border-radius: 18px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .stat-item .value { font-size: 1rem; }
  .report-box { font-size: .8rem; }
  .btn-cyan { padding: 12px 18px; }
  #interactiveChart { height: 340px !important; }
}
