/* Variables CSS */
:root {
  --primary-color: #f5e000;       /* Jaune principal */
  --primary-dark: #d3c200;        /* Jaune foncé */
  --secondary-color: #ffeb5b;     /* Jaune secondaire doux */
  --danger-color: #ef4444;
  --warning-color: #ffd500;       /* Avertissement jaune */
  --success-color: #cbed50;       /* Jaune verdâtre succès */

  --bg-primary: #0a0f1a;
  --bg-secondary: #0f1b2e;
  --bg-tertiary: #12233a;
  --bg-card: #0f1b2e;

  --text-primary: #fff5b8;       /* Texte légèrement jaune */
  --text-secondary: #d8cd82;
  --text-muted: #968c50;

  --border-color: #483b16;
  --border-hover: #6a551c;
  
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);

  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;

  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}


/* Reset et base */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: linear-gradient(135deg, var(--bg-primary) 0%, #0c1426 100%);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Navigation */
.navbar {
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-lg);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4rem;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--primary-color);
}

.nav-brand i {
  font-size: 1.5rem;
}

.nav-menu {
  display: flex;
  gap: 0.5rem;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: var(--radius-md);
  transition: var(--transition);
  font-weight: 500;
}

.nav-link:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.nav-link.active {
  background: var(--primary-color);
  color: white;
}

/* Contenu principal */
.main-content {
  min-height: calc(100vh - 4rem);
}

.page {
  display: none;
  animation: fadeIn 0.3s ease-in-out;
}

.page.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.app-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.page-header {
  text-align: center;
  margin-bottom: 3rem;
}

.page-header h1 {
  font-size: 2.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.page-header p {
  font-size: 1.125rem;
  color: var(--text-secondary);
}

/* Cartes */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 2rem;
  box-shadow: var(--shadow-lg);
  transition: var(--transition);
}

.card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-xl);
}

.card h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--primary-color);
}

/* Onglets */
.tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 2rem;
  background: var(--bg-secondary);
  padding: 0.5rem;
  border-radius: var(--radius-lg);
}

.tab-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: transparent;
  color: var(--text-secondary);
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-weight: 500;
  transition: var(--transition);
}

.tab-btn:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.tab-btn.active {
  background: var(--primary-color);
  color: white;
  box-shadow: var(--shadow-md);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

.tab-content.hidden {
  display: none !important;
}

/* Formulaires */
.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--text-primary);
}

input[type="text"],
input[type="password"],
textarea {
  width: 100%;
  padding: 0.875rem 1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 1rem;
  transition: var(--transition);
}

input[type="text"]:focus,
input[type="password"]:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(245, 224, 0, 0.1);
}

input::placeholder,
textarea::placeholder {
  color: var(--text-muted);
}

/* Boutons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 1.5rem;
  border: none;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  justify-content: center;
}

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

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: var(--border-hover);
}

.btn-success {
  background: var(--success-color);
  color: white;
}

.btn-success:hover {
  background: #d3c200;
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}

.btn-danger {
  background: var(--danger-color);
  color: white;
}

.btn-danger:hover {
  background: #dc2626;
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}

/* Affichage du token */
.token-display {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
}

.token-display label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--text-primary);
}

.token-box {
  display: flex;
  gap: 0.5rem;
}

.token-box textarea {
  flex: 1;
  min-height: 80px;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 0.875rem;
  resize: vertical;
}

.token-box .btn {
  align-self: flex-start;
  padding: 0.75rem;
}

/* Grille d'actions */
.actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 2rem;
}

/* Grille cartes (amis + recherche) */
.friends-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }

.friend-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 12px;
  transition: var(--transition);
}

.friend-card:hover { border-color: var(--primary-color); box-shadow: var(--shadow-md); }

.friend-profile { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }

.profile-image-placeholder { width: 280px; height: 60px; display: flex; align-items: center; justify-content: center; background: var(--bg-primary); border: 1px solid var(--border-color); border-radius: 8px; color: var(--text-muted); }
.profile-image { width: 280px; height: 60px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border-color); background: var(--bg-primary); }

.friend-info { flex: 1; }
.friend-name { font-weight: 600; color: var(--text-primary); margin-bottom: 4px; }
.friend-uid { font-size: 0.85rem; color: var(--text-muted); font-family: 'Monaco','Menlo','Ubuntu Mono',monospace; }

.friend-actions { display: flex; justify-content: center; }
.btn-sm { padding: 8px 12px; font-size: 0.85rem; }

/* Boîtes de résultats */
.result-box {
  margin-top: 1rem;
}

.result-box pre {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--text-secondary);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 300px;
  overflow-y: auto;
  min-height: 60px;
}

/* Hacker themed card for account page */
.hacker-card {
  background: linear-gradient(180deg, rgba(18,24,38,0.9) 0%, rgba(11,16,28,0.95) 100%);
  border: 1px solid rgba(245,224,0,0.25);
  box-shadow: 0 0 0 1px rgba(245,224,0,0.1), 0 10px 30px rgba(0,0,0,0.35);
}
.hacker-card:hover {
  border-color: rgba(245,224,0,0.45);
  box-shadow: 0 0 0 1px rgba(245,224,0,0.2), 0 16px 40px rgba(0,0,0,0.45);
}

/* Profile card image styling */
.profile-card-img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 0.5rem;
  border: 1px solid var(--border-color);
  background: var(--bg-primary);
}

/* Controls bar for Search & Requests */
.controls-bar { display:flex; flex-wrap:wrap; gap:12px; align-items:flex-end; }
.control { flex:1; min-width: 220px; }
.control-button { flex:0 0 auto; }
.result-inline pre { margin-top: 8px; }

/* Informations du compte */
.account-info {
  display: grid;
  gap: 1.5rem;
}

.account-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.account-item-label {
  font-weight: 600;
  color: var(--text-primary);
}

.account-item-value {
  color: var(--primary-color);
  font-weight: 500;
}

/* Loading */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 2rem;
  color: var(--text-secondary);
}

.loading i {
  font-size: 1.5rem;
}

/* Avertissements */
.warning {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid var(--warning-color);
  border-radius: var(--radius-md);
  color: var(--warning-color);
  margin-bottom: 1rem;
}

/* Notifications */
.notifications {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  z-index: 1000;
  display: flex;
  flex-direction: column-reverse; /* la plus récente apparaît au bas de la pile visuelle */
  gap: 0.5rem;
}

.notification {
  padding: 1rem 1.5rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  animation: slideIn 0.3s ease-out;
  max-width: 400px;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.notification.success {
  background: var(--success-color);
  color: white;
}

.notification.error {
  background: var(--danger-color);
  color: white;
}

.notification.info {
  background: var(--primary-color);
  color: white;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Responsive */
@media (max-width: 768px) {
  .friends-grid { grid-template-columns: 1fr; }
  .nav-container {
    padding: 0 1rem;
    flex-direction: column;
    height: auto;
    padding-top: 1rem;
    padding-bottom: 1rem;
  }

  .nav-menu {
    margin-top: 1rem;
    flex-wrap: wrap;
    justify-content: center;
  }

  .nav-link {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
  }

  .page-header h1 {
    font-size: 2rem;
    flex-direction: column;
    gap: 0.5rem;
  }

  .app-container {
    padding: 1rem;
  }

  .card {
    padding: 1.5rem;
  }

  .tabs {
    flex-direction: column;
  }

  .actions-grid {
    grid-template-columns: 1fr;
  }

  .token-box {
    flex-direction: column;
  }

  .account-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
}

@media (max-width: 480px) {
  .page-header h1 {
    font-size: 1.75rem;
  }

  .card {
    padding: 1rem;
  }

  .btn {
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
  }

  .notifications {
    left: 1rem;
    right: 1rem;
  }

  .notification {
    max-width: none;
  }
}

/* Scrollbar personnalisée */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--border-hover);
  border-radius: var(--radius-sm);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* --- Overrides thème hacker sombre (jaune néon) --- */
body {
  background: radial-gradient(1200px 600px at 50% -10%, rgba(245,224,0,0.08) 0%, transparent 60%),
              linear-gradient(135deg, var(--bg-primary) 0%, #08101c 100%);
}

.nav-link.active {
  background: rgba(245,224,0,0.12);
  color: var(--primary-color);
  box-shadow: 0 0 0 1px rgba(245,224,0,0.25) inset;
}

.card {
  background: linear-gradient(180deg, rgba(9,16,28,0.9) 0%, rgba(7,13,24,0.95) 100%);
  box-shadow: 0 0 0 1px rgba(245,224,0,0.06), 0 10px 30px rgba(0,0,0,0.35);
}

.card h3 { color: #f5e000; }

.tab-btn.active {
  background: rgba(245,224,0,0.1);
  color: var(--primary-color);
  box-shadow: 0 0 0 1px rgba(245,224,0,0.25) inset;
}

.btn-primary {
  background: rgba(245,224,0,0.12);
  color: var(--primary-color);
  border: 1px solid rgba(245,224,0,0.3);
}
.btn-primary:hover {
  background: rgba(245,224,0,0.18);
  transform: translateY(-1px);
  box-shadow: 0 0 0 1px rgba(245,224,0,0.35) inset, var(--shadow-lg);
}

.btn-secondary {
  background: rgba(255,235,59,0.08);
  color: var(--secondary-color);
  border: 1px solid rgba(255,235,59,0.28);
}

.btn-success {
  background: rgba(245,224,0,0.12);
  color: var(--primary-color);
  border: 1px solid rgba(245,224,0,0.3);
}
.btn-success:hover {
  background: rgba(245,224,0,0.2);
  transform: translateY(-1px);
  box-shadow: 0 0 0 1px rgba(245,224,0,0.35) inset, var(--shadow-lg);
}

.btn-danger {
  background: rgba(239,68,68,0.12);
  color: #f87171;
  border: 1px solid rgba(239,68,68,0.35);
}
.btn-danger:hover {
  background: rgba(239,68,68,0.2);
  transform: translateY(-1px);
  box-shadow: 0 0 0 1px rgba(239,68,68,0.4) inset, var(--shadow-lg);
}

.friends-grid { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }

.friend-card {
  background: linear-gradient(180deg, rgba(10,17,29,0.9) 0%, rgba(8,14,25,0.95) 100%);
}

#account-profile-card { display:flex; justify-content:center; }
.profile-card-img { width: 280px; height: 60px; display:block; margin: 0 auto; border-radius: 8px; border: 1px solid var(--border-color); background: var(--bg-primary); }
.profile-fallback { width: 280px; height: 60px; display:flex; align-items:center; justify-content:center; border: 1px dashed var(--border-hover); border-radius: 8px; background: rgba(245,224,0,0.06); color: var(--text-secondary); font-family: 'Monaco','Menlo','Ubuntu Mono',monospace; text-align:center; padding: 6px; }

.notification.success { background: rgba(245,224,0,0.16); color: var(--primary-color); border: 1px solid rgba(245,224,0,0.35); }
.notification.error { background: rgba(239,68,68,0.16); color: #f87171; border: 1px solid rgba(239,68,68,0.35); }
.notification.info { background: rgba(255,235,59,0.16); color: var(--secondary-color); border: 1px solid rgba(255,235,59,0.35); }