/* ============================================================
   Trading Bot IA - Styles personnalisés
   ============================================================ */

:root {
  --bg-darker: #0d1117;
  --bg-dark: #161b22;
  --sidebar-width: 240px;
  --sidebar-collapsed-width: 0px;
  --success-glow: 0 0 15px rgba(25, 200, 100, 0.2);
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ====== Layout ====== */
body { font-family: 'Inter', sans-serif; background: var(--bg-darker); }
body.no-scroll { overflow: hidden; }

.bg-darker { background-color: var(--bg-darker) !important; }

.sidebar {
  width: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
  flex-shrink: 0;
}

.sidebar.collapsed { width: var(--sidebar-collapsed-width); overflow: hidden; }

.main-content {
  min-height: 100vh;
  overflow-x: hidden;
  transition: var(--transition);
}

/* Backdrop mobile */
.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  opacity: 0;
  pointer-events: none;
  transition: var(--transition);
  z-index: 999;
}
.sidebar-backdrop.show {
  opacity: 1;
  pointer-events: auto;
}

/* ====== Sidebar Navigation ====== */
.sidebar .nav-link {
  color: #8b949e;
  border-radius: 8px;
  padding: 0.6rem 0.9rem;
  margin-bottom: 2px;
  font-size: 0.9rem;
  transition: var(--transition);
}
.sidebar .nav-link:hover { color: #e6edf3; background: rgba(255,255,255,0.05); }
.sidebar .nav-link.active { color: #58d68d; }
.sidebar .nav-link i { width: 20px; }

/* ====== Top Bar ====== */
.topbar { background: var(--bg-darker); height: 54px; }

/* ====== Exchange dropdown ====== */
.exchange-dd-btn {
  background: rgba(255,255,255,0.02);
  border-color: rgba(255,255,255,0.12);
}
.exchange-dd-btn:hover {
  border-color: rgba(25, 200, 100, 0.35);
  box-shadow: var(--success-glow);
}
.exchange-dd-menu {
  min-width: 280px;
  background: rgba(13, 17, 23, 0.96);
  border: 1px solid rgba(255,255,255,0.08);
  backdrop-filter: blur(10px);
}
.exchange-dd-item { border-radius: 10px; margin: 2px 6px; }
.exchange-dd-item:hover { background: rgba(255,255,255,0.05); }
.exchange-dot {
  width: 9px; height: 9px; border-radius: 999px; flex-shrink: 0;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.10);
}
.exchange-dot.on { background: rgba(25, 200, 100, 0.95); border-color: rgba(25, 200, 100, 0.55); }
.exchange-dot.off { background: rgba(255,255,255,0.14); }

/* ====== Cartes ====== */
.card { border-radius: 12px; }
.stat-card { transition: var(--transition); }
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--success-glow); }

/* ====== Badges ====== */
.badge { font-weight: 500; }
.btn-xs { padding: 0.15rem 0.4rem; font-size: 0.75rem; }

/* ====== Metrics ====== */
.metric-box { transition: var(--transition); }
.metric-box:hover { background: #1e2530 !important; }

/* ====== Icon boxes ====== */
.icon-box { width: 48px; height: 48px; display: flex; align-items: center; justify-content: center; }
.avatar-sm { width: 32px; height: 32px; font-size: 0.85rem; }

/* ====== Tables ====== */
.table-dark { --bs-table-bg: transparent; }
.table-hover > tbody > tr:hover { background: rgba(255,255,255,0.03); }
th { font-weight: 500; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; }

/* ====== Forms ====== */
.form-control, .form-select {
  font-size: 0.9rem;
  transition: var(--transition);
}
.form-control:focus, .form-select:focus {
  box-shadow: 0 0 0 0.2rem rgba(25, 200, 100, 0.15);
  border-color: rgba(25, 200, 100, 0.5) !important;
}

/* ====== Buttons ====== */
.btn-success { background: #19c864; border-color: #19c864; }
.btn-success:hover { background: #15b558; border-color: #15b558; box-shadow: var(--success-glow); }

/* ====== Strategy cards ====== */
.strategy-card { transition: var(--transition); }
.strategy-card:hover { border-color: rgba(88, 214, 141, 0.3) !important; }

.strategy-item:last-child { border-bottom: none !important; }
.strategy-item:hover { background: rgba(255,255,255,0.02); }

/* ====== Spinners et loading ====== */
.spinner-border { width: 1.5rem; height: 1.5rem; border-width: 0.2rem; }

/* ====== Font Monospace ====== */
.font-monospace { font-size: 0.85rem; }

/* ====== Size utilities ====== */
.x-small { font-size: 0.75rem; }
.x-small-2 { font-size: 0.7rem; }

/* ====== Progress bars ====== */
.progress { background: rgba(255,255,255,0.05); border-radius: 100px; }

/* ====== Alerts ====== */
.alert { border-radius: 10px; }

/* ====== Scrollbar ====== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #30363d; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #58a6ff; }

/* ====== Animations ====== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.card { animation: fadeIn 0.3s ease; }

/* ====== Responsive ====== */
@media (max-width: 768px) {
  .sidebar { position: fixed; z-index: 1000; transform: translateX(-100%); }
  .sidebar.show { transform: translateX(0); }
  .main-content { margin-left: 0 !important; }
}

/* ====== Auth pages ====== */
.auth-bg {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(1200px 600px at 20% 20%, rgba(25, 200, 100, 0.14), transparent 60%),
    radial-gradient(900px 500px at 85% 30%, rgba(88, 166, 255, 0.12), transparent 55%),
    radial-gradient(700px 420px at 70% 85%, rgba(247, 166, 0, 0.10), transparent 55%),
    linear-gradient(180deg, var(--bg-darker), #0b0f15 50%, var(--bg-darker));
  pointer-events: none;
}

.auth-logo {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 18px 60px rgba(0,0,0,0.45);
}
.auth-logo i { font-size: 2.1rem; }

.auth-card {
  border-color: rgba(255,255,255,0.08) !important;
  background: rgba(13, 17, 23, 0.78) !important;
  backdrop-filter: blur(10px);
}
