/* ============================================
   DASHBOARD STYLES - ALIGNED WITH LANDING PAGE
   ShipFast Yellow Theme - Clean & Minimal
   ============================================ */

/* ============================================
   HEADER
   ============================================ */
.site-header {
  height: 70px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(4, 6, 14, 0.85);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--color-text);
  font-family: var(--font-display);
}

.brand__mark {
  height: 28px;
  width: auto;
}

.brand__name {
  color: var(--color-text);
}

.admin-badge {
  margin-left: 0.5rem;
  padding: 0.25rem 0.5rem;
  background: var(--color-primary);
  color: #000;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  font-weight: 700;
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.4);
}

.nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav a {
  color: var(--color-text-muted);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: color 0.2s;
}

.nav a:hover,
.nav a.nav-link--active {
  color: var(--color-text);
}

.nav-link--discord {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

/* ============================================
   MAIN LAYOUT
   ============================================ */
.dashboard-main {
  padding: 1.5rem 0;
  min-height: calc(100vh - 70px);
}

.dashboard-main .container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ============================================
   DASHBOARD HEADER
   ============================================ */
.dashboard-header {
  margin-bottom: 1rem;
  text-align: left;
}

.dashboard-header h1 {
  font-family: 'Bricolage Grotesque', var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 0.2rem 0;
  color: var(--color-text);
  letter-spacing: -0.02em;
}

.dashboard-subtitle {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin: 0;
}

/* ============================================
   GRID LAYOUT
   ============================================ */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.75rem;
}

/* ============================================
   CARDS (GLASS PANELS)
   ============================================ */
.dashboard-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--color-border);
  border-radius: 0.75rem;
  padding: 0.875rem;
  backdrop-filter: blur(10px);
  transition: border-color 0.2s, transform 0.2s;
}

.dashboard-card:hover {
  border-color: rgba(255, 215, 0, 0.3);
  background: rgba(255, 215, 0, 0.02);
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(255, 215, 0, 0.1);
}

.dashboard-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.dashboard-card__header h2 {
  font-family: 'Bricolage Grotesque', var(--font-display);
  font-size: 0.85rem;
  font-weight: 600;
  margin: 0;
  color: var(--color-text);
}

.dashboard-card__content {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.dashboard-card__description {
  color: var(--color-text-muted);
  font-size: 0.875rem;
  line-height: 1.5;
  margin: 0;
}

/* ============================================
   SPECIFIC CARD VARIANTS
   ============================================ */
.dashboard-card--api {
  grid-column: span 2;
  padding: 0.75rem;
}

.dashboard-card--credits {
  grid-column: span 1;
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.08) 0%, rgba(255, 215, 0, 0.02) 100%);
  border-color: rgba(255, 215, 0, 0.2);
}

.dashboard-card--messages { grid-column: span 1; }
.dashboard-card--conversations { grid-column: span 1; }
.dashboard-card--offers { grid-column: span 1; }

.dashboard-card--time {
  grid-column: span 1;
  padding: 0.75rem;
}

.dashboard-card--chart { grid-column: 1 / -1; }
.dashboard-card--credits-chart { grid-column: span 1; }
.dashboard-card--details { grid-column: 1 / -1; }

/* ============================================
   STATS
   ============================================ */
.stat-large {
  padding: 0.5rem 0;
}

.stat-large__value {
  font-family: 'Bricolage Grotesque', var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.1;
  margin-bottom: 0.2rem;
}

.dashboard-card--credits .stat-large__value {
  color: var(--color-primary);
  text-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
}

.stat-large__label {
  color: var(--color-text-muted);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.3rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.stat-row:last-child {
  border-bottom: none;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.stat-value {
  font-weight: 600;
  color: var(--color-text);
  font-size: 0.8rem;
}

.stat-value--success { color: #10b981; }
.stat-value--danger { color: #ef4444; }

/* Detailed stats grid */
.stats-grid-detailed {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1rem;
}

.stat-item-detailed {
  background: rgba(0,0,0,0.2);
  padding: 0.75rem;
  border-radius: 0.5rem;
  border: 1px solid rgba(255,255,255,0.05);
  text-align: center;
}

.stat-item-detailed .stat-label {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.75rem;
}

.stat-item-detailed .stat-value {
  font-size: 1.1rem;
  font-weight: 600;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  text-decoration: none;
}

.btn--primary {
  background: var(--color-primary);
  color: #000;
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.2);
}

.btn--primary:hover {
  filter: brightness(1.1);
  box-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
  transform: translateY(-1px);
}

.btn--outline,
.btn--ghost {
  background: transparent;
  color: var(--color-text);
  border: 1px solid var(--color-border);
}

.btn--outline:hover,
.btn--ghost:hover {
  background: rgba(255, 215, 0, 0.05);
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.btn--small {
  padding: 0.35rem 0.75rem;
  font-size: 0.75rem;
}

.btn--icon {
  background: rgba(255,255,255,0.1);
  color: var(--color-text);
  padding: 0.5rem;
}

.btn--icon:hover {
  background: rgba(255,255,255,0.15);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ============================================
   BADGES
   ============================================ */
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-badge--active {
  background: rgba(255, 215, 0, 0.15);
  color: var(--color-primary);
  border: 1px solid rgba(255, 215, 0, 0.3);
  box-shadow: 0 0 8px rgba(255, 215, 0, 0.2);
}

.status-badge--inactive {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

/* ============================================
   API KEY
   ============================================ */
.api-key-section {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.api-key-display {
  padding: 0.5rem 0.75rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1px dashed rgba(255, 215, 0, 0.2);
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  transition: all 0.2s;
}

.api-key-display:hover {
  border-color: rgba(255, 215, 0, 0.4);
  background: rgba(0, 0, 0, 0.4);
}

.api-key-value {
  font-family: 'Monaco', 'Menlo', 'Courier New', monospace;
  font-size: 0.75rem;
  color: var(--color-primary);
  word-break: break-all;
  flex: 1;
  text-shadow: 0 0 5px rgba(255, 215, 0, 0.2);
}

/* ============================================
   ALERTS
   ============================================ */
.alert {
  padding: 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.85rem;
  line-height: 1.4;
  margin: 0.5rem 0;
}

.alert--info {
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.2);
  color: #93c5fd;
}

.alert--warning {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.2);
  color: #fbbf24;
}

.error-card {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 1rem;
  padding: 2rem;
  text-align: center;
}

.error-card h2 {
  color: #ef4444;
  margin-bottom: 1rem;
}

/* ============================================
   CHARTS
   ============================================ */
canvas {
  width: 100% !important;
  height: auto !important;
  max-height: 350px;
}

.chart-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.interval-selector {
  padding: 0.5rem 1rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--color-border);
  border-radius: 0.5rem;
  color: var(--color-text);
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s;
}

.interval-selector:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--color-primary);
}

.interval-selector:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.3);
}

/* ============================================
   LOADING
   ============================================ */
.loading {
  text-align: center;
  padding: 3rem;
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

/* ============================================
   USER INFO
   ============================================ */
.user-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.75rem;
  background: rgba(255,255,255,0.05);
  border-radius: 999px;
  font-size: 0.85rem;
  border: 1px solid rgba(255,255,255,0.05);
}

.user-avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  object-fit: cover;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
  .dashboard-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .dashboard-card--api { grid-column: span 2; }
  .dashboard-card--chart { grid-column: span 2; }
  .dashboard-card--credits-chart { grid-column: span 2; }
  .dashboard-card--details { grid-column: span 2; }
}

@media (max-width: 640px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-card {
    grid-column: span 1 !important;
  }

  .dashboard-header h1 {
    font-size: 1.5rem;
  }

  .api-key-section {
    flex-direction: column;
  }

  .api-key-display {
    flex-direction: column;
    align-items: stretch;
  }
}

/* ============================================
   REFERRAL SECTION (PARRAINAGE)
   ============================================ */

/* Code de parrainage */
.referral-code-section {
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.08) 0%, rgba(255, 215, 0, 0.02) 100%);
  border: 1px solid rgba(255, 215, 0, 0.2);
  border-radius: 1rem;
}

.referral-code-section h3 {
  font-family: 'Bricolage Grotesque', var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 1rem 0;
  color: var(--color-text);
  letter-spacing: -0.01em;
}

.referral-code-display {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.3);
  border: 2px solid rgba(255, 215, 0, 0.3);
  border-radius: 0.75rem;
  margin-bottom: 1rem;
  transition: all 0.2s;
}

.referral-code-display:hover {
  border-color: rgba(255, 215, 0, 0.5);
  background: rgba(0, 0, 0, 0.4);
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.15);
}

.referral-code-value {
  flex: 1;
  font-family: 'Monaco', 'Menlo', 'Courier New', monospace;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-primary);
  letter-spacing: 2px;
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

.referral-link-display label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  color: var(--color-text-muted);
  font-weight: 500;
}

.referral-link-display .referral-code-value {
  font-size: 0.875rem;
  word-break: break-all;
}

.referral-code-description {
  color: var(--color-text-muted);
  font-size: 0.875rem;
  line-height: 1.5;
  margin: 0.5rem 0 0 0;
}

/* Statistiques de parrainage */
.referral-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  margin: 2rem 0;
}

.referral-stat-item {
  padding: 1.25rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--color-border);
  border-radius: 1rem;
  text-align: center;
  transition: all 0.2s;
}

.referral-stat-item:hover {
  border-color: rgba(255, 215, 0, 0.3);
  background: rgba(255, 215, 0, 0.05);
  transform: translateY(-2px);
}

.referral-stat-item--highlight {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.15) 0%, rgba(255, 215, 0, 0.05) 100%);
  border-color: rgba(255, 215, 0, 0.4);
}

.referral-stat-item--highlight:hover {
  border-color: rgba(255, 215, 0, 0.6);
  box-shadow: 0 0 25px rgba(255, 215, 0, 0.2);
}

.referral-stat-value {
  font-family: 'Bricolage Grotesque', var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 0.5rem;
  display: block;
}

.referral-stat-item--highlight .referral-stat-value {
  color: var(--color-primary);
  text-shadow: 0 0 15px rgba(255, 215, 0, 0.4);
}

.referral-stat-label {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

/* Section de retrait */
.referral-withdrawal-section {
  margin: 2rem 0;
  padding: 1.5rem;
  background: rgba(255, 215, 0, 0.05);
  border: 1px solid rgba(255, 215, 0, 0.2);
  border-radius: 1rem;
}

.referral-withdrawal-section h3 {
  font-family: 'Bricolage Grotesque', var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 1rem 0;
  color: var(--color-text);
}

.referral-withdrawal-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text);
}

.form-group input {
  padding: 0.75rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--color-border);
  border-radius: 0.5rem;
  color: var(--color-text);
  font-size: 1rem;
  transition: all 0.2s;
}

.form-group input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.2);
  background: rgba(0, 0, 0, 0.4);
}

/* Liste des filleuls */
.referral-list-section {
  margin-top: 2rem;
}

.referral-list-section h3 {
  font-family: 'Bricolage Grotesque', var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 1rem 0;
  color: var(--color-text);
}

.referral-list-table {
  overflow-x: auto;
  border-radius: 0.75rem;
  border: 1px solid var(--color-border);
  margin-bottom: 1rem;
}

.referral-list-table table {
  width: 100%;
  border-collapse: collapse;
}

.referral-list-table thead {
  background: rgba(255, 215, 0, 0.08);
}

.referral-list-table th {
  padding: 0.75rem;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid rgba(255, 215, 0, 0.2);
}

.referral-list-table td {
  padding: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--color-text);
  font-size: 0.875rem;
}

.referral-list-table tbody tr:hover {
  background: rgba(255, 215, 0, 0.03);
}

.referral-list-table tbody tr:last-child td {
  border-bottom: none;
}

.referral-empty {
  text-align: center;
  padding: 2rem;
  color: var(--color-text-muted);
  font-style: italic;
  font-size: 0.9rem;
}

/* Pagination */
.referral-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 1rem;
}

.pagination-info {
  color: var(--color-text-muted);
  font-size: 0.875rem;
  font-weight: 500;
}

/* Responsive pour parrainage */
@media (max-width: 640px) {
  .referral-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .referral-code-value {
    font-size: 1rem;
  }
}
