:root {
  --bg: #050816;
  --bg-card: #0b1020;
  --accent: #4fd1c5;
  --accent-soft: rgba(79, 209, 197, 0.1);
  --text: #f9fafb;
  --muted: #9ca3af;
  --error: #f97373;
  --radius-lg: 16px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: radial-gradient(circle at top, #111827 0, #020617 55%, #000 100%);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.cp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.75rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.25);
  backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(2, 6, 23, 0.8);
}

.cp-logo {
  font-weight: 800;
  font-size: 1.3rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.cp-tagline {
  font-size: 0.9rem;
  color: var(--muted);
}

.cp-main {
  flex: 1;
  width: 100%;
  max-width: 1400px; /* Augmenter la largeur maximale */
  margin: 2rem auto 3rem;
  padding: 0 1.5rem; /* Ajouter un peu plus de padding */
  display: flex;
  flex-direction: row;
  gap: 2.5rem; /* Espacement plus large entre les colonnes */
}

.cp-card {
  background: linear-gradient(
    135deg,
    rgba(15, 23, 42, 0.96),
    rgba(15, 23, 42, 0.9)
  );
  border-radius: 24px;
  padding: 1.75rem;
  box-shadow: 0 25px 60px rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(148, 163, 184, 0.3);
  max-width: 1400px; /* Augmenter la largeur maximale des cartes */
}

.cp-card h1 {
  margin-top: 0;
  margin-bottom: 0.75rem;
}

.cp-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1rem;
}

.cp-field label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.cp-field input,
.cp-field textarea {
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.5);
  padding: 0.65rem 0.9rem;
  background: rgba(15, 23, 42, 0.9);
  color: var(--text);
  resize: vertical;
  font: inherit;
}

.cp-field input:focus,
.cp-field textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.cp-button {
  align-self: flex-start;
  padding: 0.55rem 1.4rem;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, #22c55e, #4fd1c5);
  color: #020617;
  font-weight: 700;
  cursor: pointer;
  font-size: 0.95rem;
  box-shadow: 0 10px 30px rgba(34, 197, 94, 0.35);
}

.cp-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 40px rgba(15, 118, 110, 0.5);
}

.cp-footer {
  text-align: center;
  padding: 0.75rem 1rem 1.5rem;
  font-size: 0.85rem;
  color: var(--muted);
}

/* flashes */
.cp-flash-container {
  margin-bottom: 1rem;
}

.cp-flash {
  padding: 0.75rem 1rem;
  border-radius: 12px;
  font-size: 0.9rem;
}

.cp-flash-error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.6);
}

/* paste view */
.cp-paste-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 1.25rem;
}

.cp-meta {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.cp-link {
  text-align: right;
  font-size: 0.85rem;
  color: var(--muted);
}

.cp-link code {
  display: block;
  margin-top: 0.25rem;
  padding: 0.3rem 0.5rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.95);
  border: 1px dashed rgba(148, 163, 184, 0.5);
  font-size: 0.75rem;
  white-space: nowrap;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* notes */
.cp-notes {
  margin-bottom: 1.5rem;
  padding: 0.9rem 1rem;
  border-radius: 18px;
  background: var(--accent-soft);
}

/* team grid from original (unused but kept) */
.cp-team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}

/* ... original CobblePaste styles omitted for brevity ... */
/* (you can keep the full block you pasted; I'm not removing anything) */

@media (max-width: 700px) {
  .cp-paste-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .cp-link {
    text-align: left;
  }
}

/* toggle styles kept as-is ... */

/* --- ServerWatch specific tweaks --- */

.sw-server-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); /* Colonnes plus larges */
  gap: 2rem; /* Espacement plus large entre les cartes */
}

.sw-server-card {
  background: radial-gradient(
    circle at top left,
    rgba(79, 209, 197, 0.12),
    rgba(15, 23, 42, 1)
  );
  border-radius: 18px;
  padding: 1rem 1.1rem;
  border: 1px solid rgba(148, 163, 184, 0.35);
}

.sw-server-header h2 {
  margin: 0;
  font-size: 1.1rem;
}

.sw-server-address {
  margin: 0.2rem 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.sw-server-body {
  margin-top: 0.75rem;
  font-size: 0.9rem;
}

.sw-server-current {
  margin: 0 0 0.3rem;
}

.sw-server-status {
  margin: 0 0 0.3rem;
}

.sw-server-timestamp {
  margin: 0 0 0.7rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.sw-server-pill {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.8rem;
}

.sw-server-pill-online {
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid rgba(34, 197, 94, 0.8);
  color: #bbf7d0;
}

.sw-server-pill-offline {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.8);
  color: #fecaca;
}

.sw-server-button {
  margin-top: 0.3rem;
}

.sw-muted {
  color: var(--muted);
}

.sw-back-link {
  margin-top: 0.35rem;
}

/* chart */

.cp-chart-container {
  margin-top: 1rem;
}

.sw-chart {
  width: 100%;
  max-height: 360px;
}

/* range pills */

.sw-range-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.9rem;
}

.sw-range-pill {
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  font-size: 0.85rem;
  color: var(--muted);
  cursor: pointer;
  text-decoration: none;
}

.sw-range-pill:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.sw-range-pill-active {
  background: rgba(79, 209, 197, 0.18);
  border-color: var(--accent);
  color: var(--accent);
}

.sw-notes p {
  margin: 0;
}

.sw-range-label {
  color: var(--accent);
  font-weight: 500;
}

.sw-server-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); /* Colonnes plus larges */
  gap: 2rem; /* Espacement plus large entre les cartes */
}

.sw-server-card {
  background: radial-gradient(circle at top left, rgba(79,209,197,0.12), rgba(15,23,42,1));
  padding: 1rem;
  border-radius: 16px;
  border: 1px solid rgba(148,163,184,0.3);
}

.sw-server-address {
  margin-top: -5px;
  color: var(--muted);
  font-size: 0.85rem;
}

.sw-chart {
  width: 100%;
  height: 400px; /* Augmenter la hauteur */
}

.sw-chart-mini {
  width: 100%;
  height: 160px; /* Augmenter la hauteur */
  margin-top: 1.5rem; /* Ajouter un peu plus d'espacement au-dessus */
}

.sw-range-controls {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.sw-range-pill {
  padding: 0.3rem 0.75rem;
  border: 1px solid rgba(148,163,184,0.4);
  border-radius: 999px;
  font-size: 0.85rem;
  color: var(--muted);
  cursor: pointer;
}

.sw-range-pill-active {
  background: rgba(79,209,197,0.2);
  border-color: var(--accent);
  color: var(--accent);
}

.sw-range-pill:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.sw-lang-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: .6rem;
  margin: 0 auto 1.2rem auto;
  width: 100%;
}

.sw-lang-pill {
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(148,163,184,0.4);
  color: var(--muted);
  cursor: pointer;
  font-size: 0.85rem;
  text-decoration: none;
}

.sw-lang-pill-active {
  background: rgba(79,209,197,0.2);
  border-color: var(--accent);
  color: var(--accent);
}

.sw-lang-pill:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* CENTER EVERYTHING NICELY + SPACING FIX */

.cp-card {
  margin: 0 auto 2.5rem auto;  /* center + add spacing between sections */
  max-width: 1200px;          /* keep everything nicely centered */
}

/* language filter block */
.sw-lang-controls {
  justify-content: center;
  margin-bottom: 1.2rem;
}

/* range filter (1h / 24h / 7d / 30d) */
.sw-range-controls {
  justify-content: center;
  margin-bottom: 1.5rem;
}

/* space between global graph card + server list card */
.cp-card + .cp-card {
  margin-top: 2.5rem !important;
}

/* global comparison title */
.cp-card h1 {
  text-align: center;
  width: 100%;
}

/* server grid centered */
.sw-server-grid {
  max-width: 1100px;
  margin: 0 auto;
}

/* make sure server cards never touch borders */
.sw-server-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); /* Colonnes plus larges */
  gap: 2rem; /* Espacement plus large entre les cartes */
  max-width: 1100px;
  margin: 0 auto;
}

.sw-server-card {
  position: relative;
  padding: 1rem;
  border-radius: 20px;
  background: radial-gradient(circle at top left, rgba(79, 209, 197, 0.12), rgba(15, 23, 42, 1));
  border: 1px solid rgba(148, 163, 184, 0.3);
}

/* Chart sizes */
.sw-chart {
  width: 100%;
  height: 400px; /* Augmenter la hauteur */
}
.sw-chart-mini {
  width: 100%;
  height: 160px; /* Augmenter la hauteur */
  margin-top: 1.5rem; /* Ajouter un peu plus d'espacement au-dessus */
}


/* Globe Button */
.sw-globe-btn {
  position: absolute;
  bottom: 8px;
  right: 10px;
  background: rgba(79, 209, 197, 0.15);
  border: 1px solid var(--accent);
  padding: 4px 10px;
  border-radius: 10px;
  color: var(--accent);
  text-decoration: none;
  transition: .2s ease;
}

.sw-globe-btn:hover {
  background: var(--accent);
  color: #020617;
  transform: translateY(-2px);
}

/* Global chart container */
.echart-global {
  width: 100%;
  height: 400px; /* Augmenter la hauteur */
}

/* Mini sparkline charts */
.echart-mini {
  width: 100%;
  height: 160px; /* Augmenter la hauteur */
  margin-top: 1.5rem; /* Ajouter un peu plus d'espacement au-dessus */
}

/* Server card positional fix for the globe button */
.sw-server-card {
  position: relative;
}

/* Globe button */
.sw-globe-btn {
  position: absolute;
  bottom: 10px;
  right: 12px;
  background: rgba(79, 209, 197, 0.15);
  border: 1px solid var(--accent);
  padding: 4px 10px;
  border-radius: 10px;
  color: var(--accent);
  text-decoration: none;
  transition: .2s ease;
}

.sw-globe-btn:hover {
  background: var(--accent);
  color: #020617;
  transform: translateY(-2px);
}

/* Classe pour le classement des serveurs */
.cp-ranking {
  flex: 0 0 300px; /* Largeur fixe pour le classement */
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.5);
}

.cp-ranking h2 {
  margin-top: 0;
  margin-bottom: 1rem;
}

.cp-ranking ol {
  padding-left: 1.5rem;
}

.cp-ranking li {
  margin-bottom: 0.5rem;
}

/* Ajustement pour le contenu principal */
.cp-content {
  flex: 1; /* Prend tout l'espace restant */
}

/* ------------------------------
   NEW PREMIUM RANKING DESIGN
--------------------------------*/

.cp-main {
  display: flex;
  flex-direction: row;
  justify-content: center; /* Center everything */
  gap: 3rem;
  width: 100%;
  max-width: 1600px;
  margin: 2rem auto;
}

.cp-ranking {
  width: 320px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 24px;
  padding: 1.8rem 1.5rem;
  box-shadow: 0 20px 40px rgba(0,0,0,0.3);
  backdrop-filter: blur(18px);
  color: var(--text);
  height: fit-content;
}

.cp-ranking-title {
  margin: 0 0 1rem 0;
  font-size: 1.35rem;
  font-weight: 700;
  text-align: center;
}

.cp-ranking-list {
  padding: 0;
  margin: 0;
  list-style: none;
}

.cp-ranking-item {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  background: rgba(255,255,255,0.03);
  border-radius: 12px;
  padding: 0.6rem 0.7rem;
  margin-bottom: 0.6rem;
  border: 1px solid rgba(148, 163, 184, 0.15);
}

.cp-ranking-item:hover {
  background: rgba(79, 209, 197, 0.1);
  border-color: var(--accent);
}

.cp-rank-number {
  font-size: 1.1rem;
  font-weight: 700;
  padding: 0.3rem 0.7rem;
  border-radius: 10px;
  background: rgba(79, 209, 197, 0.18);
  color: var(--accent);
}

.cp-rank-info {
  display: flex;
  flex-direction: column;
}

.cp-rank-name {
  font-weight: 600;
  font-size: 0.95rem;
}

.flag-icon {
  width: 18px;
  height: 18px;
  vertical-align: -3px;
  margin-right: 6px;
}

.echart-global {
  height: 600px;
}

.sw-lang-controls {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 14px;
    width: 100%;
    margin: 0 auto;
    text-align: center;
}
