/* ============ MONKY SNIPER — THEME GLOBAL ============ */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  /* Couleurs de fond */
  --bg: #050807;
  --bg-2: #080d0a;
  --surface: #0c1410;
  --surface-2: #101a13;
  --surface-3: #16241b;

  /* Bordures */
  --border: #1a2b20;
  --border-2: #234232;
  --border-glow: rgba(16, 185, 129, 0.3);

  /* Texte */
  --text: #e8f5ee;
  --text-dim: #7a9a87;
  --text-dimmer: #455a4e;

  /* Vert néon primaire */
  --green: #10b981;
  --green-2: #34d399;
  --green-3: #6ee7b7;
  --green-glow: rgba(16, 185, 129, 0.4);
  --green-glow-strong: rgba(16, 185, 129, 0.6);

  /* Sémantique */
  --red: #ef4444;
  --red-glow: rgba(239, 68, 68, 0.3);
  --orange: #f59e0b;
  --blue: #3b82f6;

  /* Gradients */
  --grad-green: linear-gradient(135deg, #10b981 0%, #059669 100%);
  --grad-green-soft: linear-gradient(135deg, rgba(16,185,129,0.15) 0%, rgba(5,150,105,0.05) 100%);
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, 'Segoe UI', sans-serif;
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  position: relative;
  overflow-x: hidden;
}

/* Grille lumineuse en arrière-plan */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(rgba(16, 185, 129, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(16, 185, 129, 0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, black, transparent);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, black, transparent);
}

/* Halos verts */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 50% 40% at 50% 0%, rgba(16, 185, 129, 0.12), transparent 60%),
    radial-gradient(ellipse 40% 50% at 100% 100%, rgba(5, 150, 105, 0.08), transparent 60%);
}

/* ============ TYPOGRAPHIE ============ */
h1, h2, h3, h4 { font-weight: 800; letter-spacing: -0.5px; line-height: 1.15; }
h1 { font-size: 56px; }
h2 { font-size: 38px; }
h3 { font-size: 22px; }
h4 { font-size: 16px; }

a { color: inherit; text-decoration: none; }

code, .mono {
  font-family: 'JetBrains Mono', 'Consolas', monospace;
}

/* ============ TEXTES ============ */
.text-dim { color: var(--text-dim); }
.text-dimmer { color: var(--text-dimmer); }
.text-green { color: var(--green); }
.text-red { color: var(--red); }

/* ============ BOUTONS ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 10px;
  border: none;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.3px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
}

.btn-primary {
  background: var(--grad-green);
  color: #fff;
  box-shadow:
    0 4px 16px rgba(16, 185, 129, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow:
    0 8px 24px rgba(16, 185, 129, 0.5),
    0 0 40px rgba(16, 185, 129, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

.btn-ghost {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border-2);
}
.btn-ghost:hover {
  background: var(--surface-3);
  border-color: var(--green);
  color: var(--green-3);
}

.btn-danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
  box-shadow: 0 4px 16px rgba(239, 68, 68, 0.3);
}
.btn-danger:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(239, 68, 68, 0.5);
}

.btn-sm { padding: 8px 14px; font-size: 12px; border-radius: 8px; }
.btn-lg { padding: 15px 28px; font-size: 14px; border-radius: 12px; }
.btn-icon { padding: 10px; border-radius: 10px; }

/* ============ CARTES ============ */
.card {
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface-2) 100%);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 22px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(16, 185, 129, 0.4), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}

.card:hover {
  border-color: var(--border-2);
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4), 0 0 40px rgba(16, 185, 129, 0.08);
}

.card:hover::before { opacity: 1; }

.card-static {
  transition: none;
}
.card-static:hover {
  transform: none;
  box-shadow: none;
  border-color: var(--border);
}

/* ============ INPUTS ============ */
.input, input[type="text"], input[type="password"], input[type="email"], textarea {
  width: 100%;
  background: var(--bg-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px 14px;
  border-radius: 10px;
  outline: none;
  font-family: inherit;
  font-size: 13px;
  transition: all 0.15s;
}
.input:focus, input:focus, textarea:focus {
  border-color: var(--green);
  background: rgba(16, 185, 129, 0.03);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}
textarea {
  font-family: 'JetBrains Mono', 'Consolas', monospace;
  font-size: 12px;
  resize: vertical;
  line-height: 1.7;
}
input::placeholder, textarea::placeholder { color: var(--text-dimmer); }

/* ============ BADGES ============ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.badge-green { background: rgba(16, 185, 129, 0.12); color: var(--green-3); border: 1px solid rgba(16, 185, 129, 0.2); }
.badge-red { background: rgba(239, 68, 68, 0.12); color: #fca5a5; border: 1px solid rgba(239, 68, 68, 0.2); }
.badge-orange { background: rgba(245, 158, 11, 0.12); color: #fcd34d; border: 1px solid rgba(245, 158, 11, 0.2); }
.badge-blue { background: rgba(59, 130, 246, 0.12); color: #93c5fd; border: 1px solid rgba(59, 130, 246, 0.2); }
.badge-soon {
  background: rgba(245, 158, 11, 0.1);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.25);
  font-size: 9px;
  padding: 3px 7px;
  letter-spacing: 0.8px;
}

/* ============ DOT INDICATEUR ============ */
.dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--text-dimmer);
  display: inline-block;
}
.dot-green {
  background: var(--green);
  box-shadow: 0 0 10px var(--green);
  animation: pulse-dot 1.8s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ============ SCROLLBAR ============ */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--green); }

/* ============ TOAST ============ */
.toast {
  position: fixed;
  top: 24px;
  right: 24px;
  background: rgba(12, 20, 16, 0.95);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  padding: 14px 20px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 500;
  z-index: 9999;
  animation: toastIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  max-width: 380px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
.toast.success {
  border-color: rgba(16, 185, 129, 0.4);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 40px rgba(16, 185, 129, 0.15);
}
.toast.error {
  border-color: rgba(239, 68, 68, 0.4);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 40px rgba(239, 68, 68, 0.15);
}
@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px) scale(0.95); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}

/* ============ UTILITAIRES ============ */
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-4 { gap: 4px; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-20 { gap: 20px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.mt-24 { margin-top: 24px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }
.mb-24 { margin-bottom: 24px; }

.hidden { display: none !important; }

/* ============ ANIMATIONS GLOBALES ============ */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes slideIn {
  from { opacity: 0; transform: translateX(-8px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

.animate-fade { animation: fadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1) both; }
.animate-slide { animation: slideIn 0.3s ease both; }

/* Skeleton loader */
.skeleton {
  background: linear-gradient(90deg, var(--surface) 25%, var(--surface-2) 50%, var(--surface) 75%);
  background-size: 200% 100%;
  animation: skeleton 1.5s infinite;
  border-radius: 8px;
}
@keyframes skeleton {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ============ FIX LOGO TAILLE ============ */
img.logo,
.logo img,
.logo-img,
.brand-logo img,
img[alt="Monky"],
img[alt="logo"] {
  width: 40px !important;
  height: 40px !important;
  max-width: 40px !important;
  max-height: 40px !important;
  object-fit: contain !important;
  display: inline-block !important;
}

/* Logo dans le header/navbar */
.navbar img,
header img,
nav img {
  max-width: 50px !important;
  max-height: 50px !important;
}

/* Évite que les images prennent tout l'écran */
img {
  max-width: 100%;
}

/* Logo sidebar brand */
.brand img,
.brand-logo img {
  width: 40px !important;
  height: 40px !important;
  border-radius: 10px;
}

/* ============ MOBILE RESPONSIVE ============ */
@media (max-width: 500px) {
  /* Sidebar devient un menu coulissant */
  .sidebar {
    position: fixed;
    left: -280px;
    top: 0;
    width: 260px;
    height: 100vh;
    z-index: 999;
    transition: left 0.3s ease;
    box-shadow: 4px 0 30px rgba(0,0,0,0.6);
    background: var(--sidebar);
  }
  .sidebar.mobile-open {
    left: 0;
  }

  /* Overlay derrière la sidebar */
  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(4px);
    z-index: 998;
  }
  .sidebar-overlay.active {
    display: block;
  }

  /* Bouton hamburger */
  .mobile-menu-btn {
    display: flex !important;
    position: fixed;
    top: 14px;
    left: 14px;
    z-index: 1000;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--card);
    border: 1px solid var(--border-2);
    align-items: center;
    justify-content: center;
    color: var(--green);
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.4);
  }

  /* Main content prend toute la largeur */
  .main-content {
    padding: 70px 16px 30px !important;
    max-width: 100%;
  }

  /* Topbar en colonne */
  .topbar {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .topbar-right {
    flex-wrap: wrap;
    gap: 8px;
  }
  .search-box {
    width: 100% !important;
    order: -1;
  }
  .search-kbd {
    display: none;
  }

  /* Titres plus petits */
  .page-title {
    font-size: 24px !important;
  }
  .page-subtitle {
    font-size: 12px !important;
  }

  /* Stats en colonne (1 seule colonne) */
  .stats-grid,
  .admin-stats {
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
  }
  .stat-value,
  .admin-stat .val {
    font-size: 26px !important;
  }

  /* Live stats en 2 colonnes */
  .live-stats {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
  }
  .live-stat {
    padding: 12px !important;
  }
  .live-stat-value {
    font-size: 20px !important;
  }
  .live-stat.speed .live-stat-value {
    font-size: 22px !important;
  }
  .live-stat-label {
    font-size: 8px !important;
  }

  /* Cartes */
  .card, .panel {
    padding: 16px !important;
    border-radius: 12px !important;
  }
  .card-title, .panel-title {
    font-size: 13px !important;
    margin-bottom: 14px !important;
  }

  /* Grilles en 1 colonne */
  .grid-2col,
  .grid-equal,
  .grid-3col,
  .main-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  /* Tableaux scrollables */
  .check-table,
  .admin-table {
    font-size: 12px !important;
  }
  .check-table th,
  .check-table td,
  .admin-table th,
  .admin-table td {
    padding: 8px 10px !important;
    font-size: 11px !important;
  }

  /* Boutons plus gros */
  .btn {
    padding: 12px 18px !important;
    font-size: 13px !important;
    min-height: 44px;
  }
  .btn-sm {
    padding: 10px 14px !important;
    font-size: 12px !important;
  }

  /* Inputs plus gros */
  input, textarea, .input {
    font-size: 16px !important;  /* 16px évite le zoom auto sur iOS */
    padding: 12px 14px !important;
    min-height: 44px;
  }

  /* Modals plein écran */
  .modal,
  .crypto-modal {
    max-width: 100% !important;
    margin: 10px;
    padding: 24px 20px !important;
    border-radius: 16px !important;
  }

  /* Masque les éléments décoratifs */
  .premium-pill {
    display: none !important;
  }

  /* Message de bienvenue plus petit */
  .page-subtitle {
    font-size: 11px !important;
  }

  /* Graphiques */
  .chart-wrap,
  .chart-bars {
    height: 150px !important;
  }
}

/* Très petits écrans (téléphones) */
@media (max-width: 480px) {
  .page-title {
    font-size: 20px !important;
  }
  .stat-value,
  .admin-stat .val {
    font-size: 22px !important;
  }
  .live-stat-value {
    font-size: 18px !important;
  }
  .plan-amount {
    font-size: 32px !important;
  }
  .pricing-grid {
    grid-template-columns: 1fr !important;
  }
  .plan-card.featured {
    transform: none !important;
  }
}

/* Cache le bouton hamburger sur PC */
@media (min-width: 501px) {
  .mobile-menu-btn {
    display: none !important;
  }
  .sidebar-overlay {
    display: none !important;
  }
}

/* MOBILE RESPONSIVE */
@media (max-width: 500px) {
  .sidebar { position: fixed; left: -280px; top: 0; width: 260px; height: 100vh; z-index: 999; transition: left 0.3s ease; box-shadow: 4px 0 30px rgba(0,0,0,0.6); background: var(--sidebar); }
  .sidebar.mobile-open { left: 0; }
  .sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.7); backdrop-filter: blur(4px); z-index: 998; }
  .sidebar-overlay.active { display: block; }
  .mobile-menu-btn { display: flex !important; position: fixed; top: 14px; left: 14px; z-index: 1000; width: 44px; height: 44px; border-radius: 12px; background: var(--card); border: 1px solid var(--border-2); align-items: center; justify-content: center; color: var(--green); cursor: pointer; box-shadow: 0 4px 15px rgba(0,0,0,0.4); }
  .main-content { padding: 70px 16px 30px !important; max-width: 100%; }
  .page-title { font-size: 24px !important; }
  .stats-grid { grid-template-columns: 1fr 1fr !important; gap: 10px !important; }
  .stat-value { font-size: 26px !important; }
  .live-stats { grid-template-columns: repeat(2, 1fr) !important; gap: 8px !important; }
  .live-stat-value { font-size: 20px !important; }
  .card, .panel { padding: 16px !important; }
  .grid-2col, .grid-equal, .grid-3col { grid-template-columns: 1fr !important; }
  .btn { padding: 12px 18px !important; min-height: 44px; }
  input, textarea { font-size: 16px !important; min-height: 44px; }
}
@media (min-width: 501px) {
  .mobile-menu-btn { display: none !important; }
  .sidebar-overlay { display: none !important; }
}

/* MOBILE RESPONSIVE */
@media (max-width: 500px) {
  .sidebar { position: fixed; left: -280px; top: 0; width: 260px; height: 100vh; z-index: 999; transition: left 0.3s ease; box-shadow: 4px 0 30px rgba(0,0,0,0.6); background: var(--sidebar); }
  .sidebar.mobile-open { left: 0; }
  .sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.7); backdrop-filter: blur(4px); z-index: 998; }
  .sidebar-overlay.active { display: block; }
  .mobile-menu-btn { display: flex !important; position: fixed; top: 14px; left: 14px; z-index: 1000; width: 44px; height: 44px; border-radius: 12px; background: var(--card); border: 1px solid var(--border-2); align-items: center; justify-content: center; color: var(--green); cursor: pointer; box-shadow: 0 4px 15px rgba(0,0,0,0.4); }
  .main-content { padding: 70px 16px 30px !important; max-width: 100%; }
  .page-title { font-size: 24px !important; }
  .stats-grid { grid-template-columns: 1fr 1fr !important; gap: 10px !important; }
  .stat-value { font-size: 26px !important; }
  .live-stats { grid-template-columns: repeat(2, 1fr) !important; gap: 8px !important; }
  .live-stat-value { font-size: 20px !important; }
  .card, .panel { padding: 16px !important; }
  .grid-2col, .grid-equal, .grid-3col { grid-template-columns: 1fr !important; }
  .btn { padding: 12px 18px !important; min-height: 44px; }
  input, textarea { font-size: 16px !important; min-height: 44px; }
}
@media (min-width: 501px) {
  .mobile-menu-btn { display: none !important; }
  .sidebar-overlay { display: none !important; }
}

/* FIX MOBILE v2 */
@media (max-width: 500px) {
  body { display: block !important; }
  .dashboard-layout { display: block !important; }
  .sidebar {
    position: fixed !important;
    left: -280px !important;
    top: 0 !important;
    width: 260px !important;
    height: 100vh !important;
    z-index: 999 !important;
    transition: left 0.3s ease !important;
    background: #0b0b13 !important;
    overflow-y: auto !important;
  }
  .sidebar.mobile-open { left: 0 !important; }
  .main-content {
    padding: 70px 16px 30px !important;
    max-width: 100% !important;
    margin-left: 0 !important;
  }
  .mobile-menu-btn {
    display: flex !important;
    position: fixed !important;
    top: 14px !important;
    left: 14px !important;
    z-index: 1001 !important;
    width: 44px !important;
    height: 44px !important;
    border-radius: 12px !important;
    background: #12121b !important;
    border: 1px solid #2a2a38 !important;
    align-items: center !important;
    justify-content: center !important;
    color: #10d977 !important;
    cursor: pointer !important;
  }
  .sidebar-overlay.active {
    display: block !important;
    position: fixed !important;
    inset: 0 !important;
    background: rgba(0,0,0,0.7) !important;
    backdrop-filter: blur(4px) !important;
    z-index: 998 !important;
  }
}

/* ULTRA FORCE MOBILE */
@media (max-width: 500px) {
  .dashboard-layout > .sidebar,
  body > .sidebar,
  .sidebar {
    position: fixed !important;
    left: -280px !important;
    top: 0 !important;
    bottom: 0 !important;
    width: 260px !important;
    height: 100vh !important;
    z-index: 999 !important;
    display: flex !important;
    flex-direction: column !important;
    background: #0b0b13 !important;
    overflow-y: auto !important;
    transition: left 0.3s ease !important;
    box-shadow: 4px 0 30px rgba(0,0,0,0.6) !important;
  }
  .sidebar.mobile-open {
    left: 0 !important;
  }
  .mobile-menu-btn {
    display: flex !important;
    position: fixed !important;
    top: 14px !important;
    left: 14px !important;
    z-index: 1001 !important;
    width: 44px !important;
    height: 44px !important;
    border-radius: 12px !important;
    background: #12121b !important;
    border: 1px solid #2a2a38 !important;
    align-items: center !important;
    justify-content: center !important;
    color: #10d977 !important;
    cursor: pointer !important;
  }
  .main-content {
    padding: 70px 16px 30px !important;
    margin-left: 0 !important;
    max-width: 100% !important;
  }
}
