/* ============================================================
   THEME GLOBAL — DARK NEO FUTURISTIC
   ============================================================ */
:root {
  --bg: #0a1224;
  --bg-light: #111a33;
  --card: #141f3d;
  --accent: #4bf2ff;
  --accent2: #7a2dff;
  --text: #d9e4ff;
  --text-dim: #9bb0d8;
  --red: #ff4d67;
  --green: #3fe88c;
  --warning: #ffd447;
  --radius: 10px;
  --shadow: 0 0 18px rgba(0, 0, 0, 0.4);
  --grad: linear-gradient(135deg, #31e0ff, #6e20ff);
  --ip-lan: #2979ff;
  --ip-wan: #ff4081;
  --ip-vpn: #4caf50;
  --ip-cf: #ffab00;
  --ip-unk: #9e9e9e;

}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Segoe UI", Roboto, Arial, sans-serif;
}

body {
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
}

/* ============================================================
   HEADER
   ============================================================ */
.header {
  height: 70px;
  background: var(--bg-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 25px;
  box-shadow: var(--shadow);
  border-bottom: 2px solid #1b2746;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* LOGO dans le header */
.logo::before {
  content: "";
  width: 32px;
  height: 32px;
  background-image: url("/icons/logo.png");
  background-size: cover;
  background-position: center;
  border-radius: 8px;
  box-shadow: 0 0 8px var(--accent);
  animation: neonPulse 3s ease-in-out infinite;
}

@keyframes neonPulse {
  0% { transform: scale(1); box-shadow: 0 0 4px var(--accent); }
  50% { transform: scale(1.05); box-shadow: 0 0 16px var(--accent2); }
  100% { transform: scale(1); box-shadow: 0 0 4px var(--accent); }
}

.logo-main {
  font-size: 22px;
  font-weight: bold;
  background: var(--grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo-sub {
  font-size: 12px;
  color: var(--text-dim);
}

.nav {
  display: flex;
  gap: 12px;
}

.nav-btn {
  padding: 8px 16px;
  background: #0f1a32;
  border-radius: var(--radius);
  font-size: 14px;
  color: var(--text);
  border: 1px solid #223054;
  cursor: pointer;
  transition: 0.2s;
}

.nav-btn:hover {
  background: #162446;
}

.nav-btn.active {
  background: var(--grad);
  border: none;
  color: white;
}

.status {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--green);
}

.dot-online {
  width: 10px;
  height: 10px;
  background: var(--green);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--green);
}

/* ============================================================
   LAYOUT
   ============================================================ */
main {
  padding: 30px;
}

.page {
  display: none;
  animation: fadeIn 0.2s ease;
}

.page.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px;
  margin: 20px 0;
  box-shadow: var(--shadow);
  border: 1px solid #213054;
}

.card h2 {
  margin-bottom: 14px;
  font-size: 18px;
  color: var(--accent);
}

.wide {
  width: 100%;
}

/* ============================================================
   TABLES
   ============================================================ */
.table {
  width: 100%;
  border-collapse: collapse;
}

.table th {
  background: #0f1a2f;
  padding: 10px;
  font-size: 14px;
  text-align: left;
  border-bottom: 2px solid #213054;
  color: var(--text);
}

.table td {
  padding: 10px;
  border-bottom: 1px solid #223455;
  color: var(--text-dim);
}

.table tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

/* ============================================================
   BADGES
   ============================================================ */
.badge {
  padding: 4px 10px;
  border-radius: var(--radius);
  background: #1a2642;
  color: var(--text-dim);
  font-size: 12px;
}

.badge-accent {
  background: var(--accent);
  color: #000;
}

.badge-danger {
  background: var(--red);
  color: white;
}

/* Badges Jellyfin */
.badge-play {
  background: var(--green);
  color: #000;
}

.badge-pause {
  background: var(--warning);
  color: #000;
}

.badge-stop {
  background: var(--red);
  color: #fff;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  padding: 6px 10px;
  border-radius: var(--radius);
  background: #142139;
  border: 1px solid #223455;
  color: var(--text);
  cursor: pointer;
  transition: 0.2s;
  font-size: 13px;
}

.btn:hover {
  background: #1d2b4d;
}

.btn.green {
  background: var(--green);
  color: #000;
  border: none;
}

.btn.red {
  background: var(--red);
  color: #fff;
  border: none;
}

.btn.grey {
  background: #2b3550;
  border: none;
}

/* ============================================================
   DOCKER STATUS DOTS
   ============================================================ */
.dot-on {
  width: 10px;
  height: 10px;
  background: var(--green);
  border-radius: 50%;
  display: inline-block;
  margin-right: 6px;
  box-shadow: 0 0 6px var(--green);
}

.dot-off {
  width: 10px;
  height: 10px;
  background: #ff6969;
  border-radius: 50%;
  display: inline-block;
  margin-right: 6px;
  box-shadow: 0 0 6px #ff2b2b;
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  margin-top: 40px;
  padding: 14px;
  font-size: 13px;
  text-align: center;
  color: var(--text-dim);
  background: #0f1a2f;
  border-top: 1px solid #223455;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 780px) {
  main { padding: 18px; }

  .table th,
  .table td {
    padding: 8px;
    font-size: 12px;
  }

  .nav { gap: 6px; }

  .nav-btn {
    padding: 6px 8px;
    font-size: 12px;
  }

  .logo-main { font-size: 18px; }
}

/* ============================================================
   DOCKER GROUPS UI
   ============================================================ */
.docker-groups-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  gap: 8px;
  flex-wrap: wrap;
}

.docker-groups-left {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.groups-title {
  font-size: 13px;
  color: var(--text-dim);
  margin-right: 4px;
}

.group-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #151f38;
  border: 1px solid #2b3c63;
  font-size: 12px;
  cursor: pointer;
}

.group-pill.active {
  background: var(--grad);
  border-color: transparent;
  color: #fff;
}

.pill-btn {
  background: transparent;
  border: none;
  color: inherit;
  font-size: 11px;
  cursor: pointer;
  padding: 0 2px;
}

.docker-group-line {
  margin-top: 4px;
  font-size: 11px;
  color: var(--text-dim);
}

.docker-group-select {
  background: #111a33;
  border-radius: 6px;
  border: 1px solid #253558;
  color: var(--text);
  padding: 2px 6px;
  font-size: 11px;
}

/* ============================================================
   JELLYFIN / HISTORIQUE
   ============================================================ */
.device-icon {
  margin-right: 4px;
}

.history-panel {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.25s ease, opacity 0.25s ease;
  margin-top: 10px;
}

.history-panel.open {
  max-height: 400px; /* ajustable */
  opacity: 1;
}

.history-toggle {
  width: 100%;
  text-align: left;
  margin-top: 4px;
}

.jf-history-card {
  margin-top: 10px;
}

/* ============================================================
   BADGES IP (PILL FUTURISTES)
   ============================================================ */

.badge-ip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid transparent;
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.4);
  white-space: nowrap;
}

.badge-ip-icon {
  font-size: 13px;
}

.badge-ip-main {
  font-weight: 500;
}

.badge-ip-label {
  opacity: 0.8;
}

/* LAN */
.badge-ip-lan {
  background: rgba(41, 98, 255, 0.18);
  color: #c8d9ff;
  border-color: #2962ff;
  box-shadow: 0 0 8px rgba(41, 98, 255, 0.6);
}

/* WAN */
.badge-ip-wan {
  background: rgba(197, 17, 98, 0.2);
  color: #ffd1e6;
  border-color: #c51162;
  box-shadow: 0 0 8px rgba(197, 17, 98, 0.6);
}

/* VPN (10.x.x.x) */
.badge-ip-vpn {
  background: rgba(56, 142, 60, 0.2);
  color: #c8f7d2;
  border-color: #388e3c;
  box-shadow: 0 0 8px rgba(56, 142, 60, 0.6);
}

/* DOCKER / PROXY (172.17/18/19.x) */
.badge-ip-docker {
  background: rgba(0, 172, 193, 0.18);
  color: #c7faff;
  border-color: #00acc1;
  box-shadow: 0 0 8px rgba(0, 172, 193, 0.6);
}

/* LOCALHOST */
.badge-ip-local {
  background: #263238;
  color: #eceff1;
  border-color: #455a64;
  box-shadow: 0 0 8px rgba(69, 90, 100, 0.6);
}

/* INCONNU */
.badge-ip-unknown {
  background: #424242;
  color: #e0e0e0;
  border-color: #616161;
  box-shadow: 0 0 8px rgba(97, 97, 97, 0.6);
}

/* ============================================================
   IP TYPE BADGES (LAN / WAN / VPN / Cloudflare)
   ============================================================ */

.ip-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  background: #152040;
  border: 1px solid #26345b;
}

.ip-pill-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.ip-pill-ip {
  color: var(--text);
  font-weight: 600;
}

.ip-pill-type {
  color: var(--text-dim);
}

/* Colors */
.ip-type-lan .ip-pill-dot { background: var(--ip-lan); box-shadow: 0 0 4px var(--ip-lan); }
.ip-type-wan .ip-pill-dot { background: var(--ip-wan); box-shadow: 0 0 4px var(--ip-wan); }
.ip-type-vpn .ip-pill-dot { background: var(--ip-vpn); box-shadow: 0 0 4px var(--ip-vpn); }
.ip-type-cf  .ip-pill-dot { background: var(--ip-cf);  box-shadow: 0 0 4px var(--ip-cf); }
.ip-type-unknown .ip-pill-dot { background: var(--ip-unk); }

/* ============================================================
   GEOLOCATION TEXT
   ============================================================ */

.ip-geo-text {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 3px;
  opacity: 0.8;
}

/* ============================================================
   WATCHTIME PANEL (Temps total de visionnage Jellyfin)
   ============================================================ */

#jf-watchtime {
  background: #14213f;
  padding: 15px;
  border-radius: var(--radius);
  border: 1px solid #24345a;
  margin-top: 10px;
}

.watchtime-title {
  font-size: 16px;
  color: var(--accent);
  margin-bottom: 8px;
}

.watchtime-list {
  margin-left: 15px;
  margin-top: 5px;
  color: var(--text-dim);
}

.watchtime-list li {
  margin-bottom: 4px;
}

.watchtime-empty {
  font-size: 13px;
  color: var(--text-dim);
  opacity: 0.7;
}

/* ============================================================
   drapeau
   ============================================================ */


.flag-icon {
  width: 22px;
  height: 16px;
  border-radius: 3px;
  margin-right: 6px;
  box-shadow: 0 0 4px #000;
  object-fit: cover;
}

.ip-flag {
  height: 16px;
  width: 22px;
  border-radius: 3px;
  margin-right: 5px;
}

.geo-info {
  font-size: 0.85rem;
  opacity: 0.8;
  margin-top: 2px;
}

.geo-country, .geo-city, .geo-isp {
  margin-left: 3px;
}

/* ============================================================
   JELLYFIN STATS
   ============================================================ */
.jf-stats-grid{
  display:flex;
  gap:12px;
  flex-wrap:wrap;
  margin-bottom:12px;
}
.jf-stat-box{
  flex: 1 1 240px;
  background:#0f1a2f;
  border:1px solid #223455;
  border-radius: var(--radius);
  padding:12px;
}
.jf-stat-title{
  font-size:13px;
  color: var(--text);
  margin-bottom:8px;
  opacity:.9;
}
.jf-stat-list{
  font-size:12px;
  color: var(--text-dim);
  line-height:1.6;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.jf-stat-line{
  display:flex;
  justify-content:space-between;
  gap:10px;
}
.jf-stat-right{
  color: var(--text);
  font-weight:600;
}

/* ============================================================
   WAN — BADGES TYPE VISITEUR
   ============================================================ */

.badge-proxy {
  background: rgba(255, 171, 0, 0.2);
  color: #ffcc80;
  border: 1px solid #ffab00;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
}

.badge-human {
  background: rgba(76, 175, 80, 0.2);
  color: #b9f6ca;
  border: 1px solid #4caf50;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
}

.badge-vpn {
  background: rgba(33, 150, 243, 0.2);
  color: #bbdefb;
  border: 1px solid #2196f3;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
}

/* ============================================================
   WAN — ALERTE NOUVEAU VISITEUR HUMAIN
   ============================================================ */

.wan-alert {
  background: linear-gradient(135deg, #00e5ff, #2979ff);
  color: #000;
  padding: 12px 16px;
  border-radius: 10px;
  margin-bottom: 15px;
  font-weight: 600;
  box-shadow: 0 0 18px rgba(0, 229, 255, 0.6);
  animation: pulseAlert 1.5s infinite;
}

@keyframes pulseAlert {
  0% { box-shadow: 0 0 8px rgba(0,229,255,.4); }
  50% { box-shadow: 0 0 18px rgba(0,229,255,.9); }
  100% { box-shadow: 0 0 8px rgba(0,229,255,.4); }
}

