/* ==============================================================================
   Binance AutoTrader Dashboard Stylesheet (Dark Gold Binance Theme)
   ============================================================================== */

:root {
  --bg: #0b0e11;
  --card-bg: #181a20;
  --card-border: #2b313a;
  --text-main: #eaecef;
  --text-muted: #848e9c;
  --binance-gold: #f0b90b;
  --green: #0ecb81;
  --red: #f6465d;
  --blue: #1e88e5;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

body {
  background-color: var(--bg);
  color: var(--text-main);
  padding: 16px;
  font-size: 14px;
  min-height: 100vh;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
}

/* Header */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--card-border);
  margin-bottom: 20px;
}

.logo {
  font-size: 20px;
  font-weight: bold;
  color: var(--binance-gold);
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.btn {
  padding: 7px 14px;
  border-radius: 6px;
  font-weight: bold;
  cursor: pointer;
  border: none;
  font-size: 13px;
  transition: 0.2s;
}

.btn-gold {
  background: var(--binance-gold);
  color: #000;
}

.btn-gold:hover {
  background: #dfaa07;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--card-border);
  color: var(--text-main);
}

.btn-outline:hover {
  background: #2b313a;
}

/* Auth Screen & 2FA */
#auth-screen {
  max-width: 440px;
  margin: 70px auto;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 32px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.auth-title {
  font-size: 22px;
  font-weight: bold;
  color: var(--binance-gold);
  margin-bottom: 8px;
  text-align: center;
}

.auth-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 24px;
  text-align: center;
  line-height: 1.5;
}

.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
  font-weight: 500;
}

.form-input {
  width: 100%;
  padding: 10px 14px;
  background: #0b0e11;
  border: 1px solid var(--card-border);
  border-radius: 6px;
  color: var(--text-main);
  font-size: 14px;
  outline: none;
}

.form-input:focus {
  border-color: var(--binance-gold);
}

.auth-toggle {
  text-align: center;
  margin-top: 18px;
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
}

.auth-toggle span {
  color: var(--binance-gold);
  font-weight: bold;
}

/* Guide Box */
.guide-box {
  background: rgba(30, 136, 229, 0.1);
  border: 1px solid rgba(30, 136, 229, 0.3);
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 18px;
  font-size: 12px;
  line-height: 1.6;
  color: #b3d4fc;
}

.guide-title {
  font-weight: bold;
  color: #64b5f6;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.guide-box ol {
  margin-left: 18px;
}

.guide-box code {
  background: #0b0e11;
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--binance-gold);
  font-weight: bold;
}

/* Dashboard Layout */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 18px;
}

.card-title {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.card-val {
  font-size: 26px;
  font-weight: bold;
}

.card-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
}

/* Timeframe Cards */
.tf-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.tf-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 18px;
}

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

.tf-badge {
  background: #2b313a;
  color: var(--binance-gold);
  padding: 3px 8px;
  border-radius: 6px;
  font-weight: bold;
  font-size: 12px;
}

.tf-step {
  font-size: 12px;
  color: var(--text-muted);
}

.timer-val {
  font-size: 20px;
  font-weight: bold;
  color: var(--text-main);
  font-variant-numeric: tabular-nums;
}

/* Tables */
.section-title {
  font-size: 16px;
  font-weight: bold;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

th {
  padding: 12px 10px;
  color: var(--text-muted);
  font-size: 12px;
  border-bottom: 1px solid var(--card-border);
}

td {
  padding: 12px 10px;
  border-bottom: 1px solid rgba(43, 49, 58, 0.5);
  font-size: 13px;
}

.pos-long {
  color: var(--green);
  font-weight: bold;
}

.pos-short {
  color: var(--red);
  font-weight: bold;
}

.tag {
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: bold;
}

.tag-sl {
  background: rgba(246, 70, 93, 0.2);
  color: var(--red);
}

.tag-tp {
  background: rgba(14, 203, 129, 0.2);
  color: var(--green);
}

.empty-state {
  text-align: center;
  padding: 30px;
  color: var(--text-muted);
}

/* Modal */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.7);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 28px;
  width: 90%;
  max-width: 520px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
  max-height: 90vh;
  overflow-y: auto;
}

.modal-large {
  max-width: 820px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.modal-title {
  font-size: 18px;
  font-weight: bold;
  color: var(--binance-gold);
}

.modal-close {
  font-size: 22px;
  cursor: pointer;
  color: var(--text-muted);
}

.spec-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
  font-size: 12px;
}

.spec-table th,
.spec-table td {
  padding: 9px 10px;
  border: 1px solid var(--card-border);
  text-align: center;
}

.spec-table th {
  background: rgba(255, 255, 255, 0.04);
  color: var(--binance-gold);
  font-weight: 600;
}

.rule-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 12px;
  text-align: left;
}

.rule-card-title {
  font-weight: bold;
  font-size: 13px;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Tab Navigation */
.tab-nav {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--card-border);
  padding-bottom: 10px;
}

.tab-btn {
  padding: 10px 18px;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  border: 1px solid transparent;
  font-weight: bold;
  font-size: 14px;
  cursor: pointer;
  transition: 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.tab-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.04);
}

.tab-btn.active {
  color: var(--binance-gold);
  background: rgba(240, 185, 11, 0.12);
  border-color: rgba(240, 185, 11, 0.3);
}

/* Button Disabled / Cooldown State */
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* Market Overview Bar */
.market-ticker-bar {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.ticker-price {
  font-size: 28px;
  font-weight: bold;
  letter-spacing: -0.5px;
}

.rsi-bar-container {
  width: 100%;
  height: 6px;
  background: #2b313a;
  border-radius: 3px;
  margin-top: 6px;
  overflow: hidden;
}

.rsi-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.3s;
}

/* TradingView Chart Container */
.chart-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 16px;
  margin-top: 20px;
  height: 520px;
}

/* 모바일 스마트폰 화면 최적화 (Web App 반응형) */
@media (max-width: 640px) {
  body {
    padding: 10px;
    font-size: 13px;
  }
  header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 14px;
  }
  .logo {
    font-size: 18px;
  }
  .user-actions {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 6px;
  }
  .btn {
    padding: 6px 10px;
    font-size: 12px;
  }
  .grid {
    grid-template-columns: 1fr;
    gap: 10px;
    margin-bottom: 14px;
  }
  .tf-grid {
    grid-template-columns: 1fr;
    gap: 10px;
    margin-bottom: 14px;
  }
  .card {
    padding: 14px;
  }
  .tf-card {
    padding: 14px;
  }
  .card-val {
    font-size: 22px;
  }
  .timer-val {
    font-size: 18px;
  }
  #auth-screen {
    margin: 20px auto;
    padding: 20px;
    width: 100%;
  }
  .modal {
    padding: 20px 16px;
    width: 95%;
  }
}
