/* ==========================================
   VARIABLES – palette techitizi.nc
   ========================================== */
:root {
  --primary:    #2c3e50;
  --secondary:  #3498db;
  --accent:     #e74c3c;
  --text:       #333;
  --light-bg:   #f8f9fa;
  --white:      #ffffff;
  --border:     #e0e0e0;
  --muted:      #6c757d;
  --shadow:     0 2px 10px rgba(0,0,0,0.08);
  --shadow-hover: 0 8px 25px rgba(0,0,0,0.15);
  --transition: all 0.3s ease;
}

/* ==========================================
   BASE
   ========================================== */
* { box-sizing: border-box; }

body {
  background: var(--light-bg);
  color: var(--text);
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
}

/* ==========================================
   NAVBAR
   ========================================== */
.navbar {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%) !important;
  box-shadow: 0 2px 15px rgba(0,0,0,0.2);
  padding: 0.75rem 1.5rem;
}

.navbar-brand {
  color: var(--white) !important;
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.02em;
}

.last-update {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.75);
}

.btn-refresh {
  background: var(--accent);
  color: var(--white);
  border: none;
  border-radius: 5px;
  padding: 0.4rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}
.btn-refresh:hover:not(:disabled) {
  background: #c0392b;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(231,76,60,0.35);
  color: var(--white);
}
.btn-refresh:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

/* ==========================================
   SECTION TITLES
   ========================================== */
.section-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  position: relative;
}
.section-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 50px;
  height: 3px;
  background: linear-gradient(to right, var(--secondary), var(--accent));
  border-radius: 2px;
}

/* ==========================================
   CARDS
   ========================================== */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
  transition: var(--transition);
}

/* Carte indicateur (résumé) */
.indicator-card {
  background: var(--white);
  border-radius: 10px;
  border: 1px solid var(--border);
  border-left: 5px solid var(--secondary);
  box-shadow: var(--shadow);
  padding: 1.1rem 1.25rem;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}
.indicator-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 3px;
  background: linear-gradient(to right, var(--secondary), var(--accent));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}
.indicator-card:hover::before { transform: scaleX(1); }
.indicator-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.indicator-card.accent-red   {
  border-left-color: var(--secondary);
  background: #f0f7ff;
  box-shadow: 0 4px 16px rgba(52,152,219,0.18);
}
.indicator-card.accent-red .card-label { color: var(--secondary); }
.indicator-card.accent-green { border-left-color: #27ae60; }
.indicator-card.accent-navy  { border-left-color: var(--primary); }


.card-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 0.4rem;
}

.signal-value {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.2;
}

.card-sub {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 0.2rem;
}

/* Chart & table cards */
.panel-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 1.25rem 1.5rem;
}

/* ==========================================
   BADGES
   ========================================== */
.badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.3em 0.65em;
  border-radius: 5px;
  letter-spacing: 0.02em;
}

.badge-acheter  { background: #d4edda; color: #155724; }
.badge-vendre   { background: #f8d7da; color: #721c24; }
.badge-neutre   { background: #e2e3e5; color: #383d41; }
.badge-up       { background: #d4edda; color: #155724; }
.badge-down     { background: #f8d7da; color: #721c24; }
.badge-no-trend { background: #fff3cd; color: #856404; }
.badge-strong   { background: #cce5ff; color: #004085; }
.badge-weak     { background: #e2e3e5; color: #383d41; }
.badge-undefined{ background: #e2e3e5; color: #383d41; }

/* ==========================================
   TABLE
   ========================================== */
.table {
  color: var(--text);
  margin-bottom: 0;
}
.table thead th {
  background: var(--primary);
  color: rgba(255,255,255,0.85);
  border-color: rgba(255,255,255,0.1);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  vertical-align: middle;
  padding: 0.65rem 0.75rem;
}
.table tbody td {
  border-color: var(--border);
  font-size: 0.82rem;
  vertical-align: middle;
  padding: 0.5rem 0.75rem;
}
.table tbody tr:hover { background: rgba(52,152,219,0.05); }

.row-acheter { background: rgba(39,174,96,0.07) !important; }
.row-vendre  { background: rgba(231,76,60,0.07) !important; }

/* ==========================================
   CHART
   ========================================== */
#chart-container { position: relative; height: 380px; }

/* ==========================================
   TOAST
   ========================================== */
.toast {
  border-radius: 8px;
  font-size: 0.875rem;
}
.toast-success { background: #27ae60 !important; }
.toast-danger  { background: var(--accent) !important; }

.spinner-border { width: 0.9rem; height: 0.9rem; border-width: 0.15em; }

/* ==========================================
   ASSET SWITCHER
   ========================================== */
.asset-switcher {
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.btn-asset {
  background: var(--white);
  color: var(--muted);
  border: 1px solid var(--border);
  padding: 0.5rem 1.6rem;
  font-weight: 500;
  font-size: 0.95rem;
  transition: var(--transition);
}

.btn-asset:hover {
  background: var(--light-bg);
  color: var(--primary);
}

.btn-asset.active {
  background: var(--primary);
  color: var(--white);
  border-color: var(--primary);
}

.asset-ticker {
  font-size: 0.72rem;
  opacity: 0.7;
  margin-left: 0.3rem;
}

/* ==========================================
   TIMEFRAME SWITCHER
   ========================================== */
.timeframe-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.timeframe-switcher {
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.btn-tf {
  background: var(--white);
  color: var(--muted);
  border: 1px solid var(--border);
  padding: 0.3rem 1rem;
  font-weight: 500;
  font-size: 0.82rem;
  transition: var(--transition);
}

.btn-tf:hover {
  background: var(--light-bg);
  color: var(--primary);
}

.btn-tf.active {
  background: var(--secondary);
  color: var(--white);
  border-color: var(--secondary);
}

/* ==========================================
   INFO MULTI-TIMEFRAME
   ========================================== */
.mtf-info {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  background: #f0f7ff;
  border: 1px solid #b8d9f5;
  border-left: 5px solid var(--secondary);
  border-radius: 10px;
  padding: 0.8rem 1.1rem;
  box-shadow: var(--shadow);
}

.mtf-icon {
  font-size: 1rem;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.mtf-text {
  flex: 1;
  font-size: 0.8rem;
  color: #1a4a6e;
  margin: 0;
  line-height: 1.5;
}

/* ==========================================
   DISCLAIMER LÉGAL
   ========================================== */
.legal-disclaimer {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  background: #fffbf0;
  border: 1px solid #f0c040;
  border-left: 5px solid #e6a817;
  border-radius: 10px;
  padding: 0.9rem 1.1rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow);
}

.legal-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.legal-text {
  flex: 1;
  font-size: 0.8rem;
  color: #7a5c00;
  margin: 0;
  line-height: 1.5;
}


/* ==========================================
   NOTE MÉTHODOLOGIQUE (BACKTEST)
   ========================================== */
.strategy-info {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  background: #f4f0fa;
  border: 1px solid #c8b8e3;
  border-left: 5px solid #7e57c2;
  border-radius: 10px;
  padding: 0.8rem 1.1rem;
  box-shadow: var(--shadow);
}

.strategy-icon {
  font-size: 1rem;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.strategy-text {
  flex: 1;
  font-size: 0.8rem;
  color: #3d2566;
  margin: 0;
  line-height: 1.5;
}

/* ==========================================
   ACTION RECOMMANDÉE
   ========================================== */
.action-panel {
  background: #ffffff;
  border-radius: 12px;
  padding: 1.1rem 1.4rem;
  box-shadow: var(--shadow);
  border-left: 6px solid var(--secondary);
  text-align: center;
}

.action-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #6c757d;
  margin-bottom: 0.3rem;
}

.action-value {
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.2;
  color: #1a1a1a;
}

.action-sub {
  font-size: 0.82rem;
  color: #6c757d;
  margin-top: 0.3rem;
  font-style: italic;
}

.action-panel.action-enter {
  background: #f0fbf2;
  border-left-color: #28a745;
}
.action-panel.action-enter .action-value { color: #1e7e34; }

.action-panel.action-hold {
  background: #f0f7ff;
  border-left-color: #2196f3;
}
.action-panel.action-hold .action-value { color: #1565c0; }

.action-panel.action-exit {
  background: #fff0f0;
  border-left-color: #dc3545;
}
.action-panel.action-exit .action-value { color: #b71c1c; }

.action-panel.action-wait {
  background: #f7f7f7;
  border-left-color: #9e9e9e;
}
.action-panel.action-wait .action-value { color: #555555; }

/* ==========================================
   FOOTER LÉGAL PERMANENT
   ========================================== */
body {
  padding-bottom: 2.6rem; /* éviter que le contenu passe derrière le footer fixe */
}

.legal-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1050;
  background: #2c3e50;
  color: #ecf0f1;
  font-size: 0.74rem;
  text-align: center;
  padding: 0.45rem 1rem;
  border-top: 2px solid #e6a817;
  line-height: 1.4;
  letter-spacing: 0.01em;
}

.legal-footer strong {
  color: #ffd76a;
}

.legal-footer-icon {
  margin-right: 0.35rem;
}

/* ==========================================
   RESPONSIVE
   ========================================== */
@media (max-width: 768px) {
  .signal-value { font-size: 1.25rem; }
  .action-value { font-size: 1.25rem; }
  .navbar-brand { font-size: 0.95rem; }
  body          { padding-bottom: 4rem; }
  .legal-footer { font-size: 0.7rem; padding: 0.4rem 0.6rem; }
}
