/* ===== Futuristic / Neon Dark UI for OBS Remote ===== */
:root{
  --bg-0:#020025;
  --bg-1:#090032;
  --card:#0c0733cc;             /* glass */
  --border:#6a5acd44;           /* slate/neon */
  --text:#e9e9ff;
  --muted:#b6b6d6;
  --accent:#8a7dff;             /* neon violet */
  --accent-2:#00e6ff;           /* cyan */
  --danger:#ff3b6e;
  --ok:#28f0a5;
  --warn:#ffcc66;
  --shadow:0 0 0 1px var(--border), 0 10px 30px #0008, 0 0 40px #7b71ff22 inset;
}

/* --- Global --- */
html, body{
  background: var(--bg-0);
  color: var(--text);
font-size: 0.80rem;
}
body.is-dark{
  /* Animated star grid + soft gradient */
  background:
    radial-gradient(1200px 700px at 20% -10%, #2a1eff22 0, transparent 60%),
    radial-gradient(1200px 700px at 120% 110%, #00e6ff22 0, transparent 60%),
    linear-gradient(180deg, #020025 0%, #06002a 50%, #020025 100%),
    repeating-linear-gradient(90deg, #ffffff05 0 1px, transparent 1px 80px),
    repeating-linear-gradient(0deg, #ffffff05 0 1px, transparent 1px 80px);
  background-attachment: fixed;
  min-height: 100vh;
  animation: bgPulse 18s ease-in-out infinite;
}
@keyframes bgPulse{
  0%,100%{ filter: hue-rotate(0deg) brightness(1); }
  50%{    filter: hue-rotate(10deg) brightness(1.05); }
}

/* Spacing helpers (overrides vanilla margins a tad) */
.row{ padding-inline: 12px; }
.p-card{ margin-block: 18px; }

/* --- Cards --- */
.p-card{
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px) saturate(115%);
  -webkit-backdrop-filter: blur(8px) saturate(115%);
  overflow: hidden;
}
.p-card h4, .p-card h5{
  margin: 0 0 10px 0;
  letter-spacing: .6px;
  text-transform: uppercase;
  font-weight: 700;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* --- Table --- */
#connections{
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  border-radius: 14px;
  box-shadow: inset 0 0 0 1px var(--border);
}
#connections thead th{
  font-size: .9rem;
  text-transform: uppercase;
  letter-spacing: .8px;
  padding: 12px 14px;
  position: sticky;
  top: 0;
  background:
    linear-gradient(180deg, #1a1450 0%, #120c3d 100%);
  color: #dfe1ff;
  border-bottom: 1px solid var(--border);
}
#connections tbody td{
  padding: 12px 14px;
  color: var(--text);
  border-bottom: 1px dashed #6a5acd33;
}
#connections tbody tr{
  transition: transform .16s ease, background-color .2s ease, box-shadow .2s ease;
}
#connections tbody tr:hover{
  background: #120c3d99;
  transform: translateY(-1px);
  box-shadow: 0 2px 20px #7b71ff22 inset;
}

/* --- Status badges (se aplican a tus spans existentes) --- */
#relayStatus, #obsStatus, .status-badge{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  font-size: .85rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: 0 0 18px #7b71ff22 inset, 0 0 16px #7b71ff22;
  background: linear-gradient(180deg, #130d3b 0%, #0e0930 100%);
  color: var(--muted);
}
.status--ok{    border-color: #28f0a522; color: var(--ok);    box-shadow: 0 0 24px #28f0a522 inset, 0 0 18px #28f0a522; }
.status--warn{  border-color: #ffcc6622; color: var(--warn);  box-shadow: 0 0 24px #ffcc6622 inset, 0 0 18px #ffcc6622; }
.status--error{ border-color: #ff3b6e22; color: var(--danger);box-shadow: 0 0 24px #ff3b6e22 inset, 0 0 18px #ff3b6e22; }

/* --- Inputs --- */
input[type="text"], input[type="password"]{
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg,#0f0a35cc,#070429cc);
  color: var(--text);
  outline: none;
  transition: box-shadow .2s ease, border-color .2s ease, transform .06s ease;
}
input[readonly]{ opacity: .92; }
input:focus{
  border-color: var(--accent);
  box-shadow: 0 0 0 3px #8a7dff33, 0 0 35px #8a7dff22 inset;
}
label{
  display:block;
  margin: 10px 0 6px 2px;
  color: var(--muted);
  font-size:.92rem;
}

/* Grouped inputs with buttons */
div[style*="display: flex"]{
  gap: 8px;
}
div[style*="display: flex"] > input{
  flex: 1 1 auto;
}

/* --- Buttons (vanilla overrides + generic) --- */
button,
.p-button--base,
.p-button--negative{
  border-radius: 12px !important;
  border: 1px solid var(--border) !important;
  background: linear-gradient(180deg, #1a1450, #0f0a37) !important;
  color: var(--text) !important;
  text-transform: uppercase;
  letter-spacing: .8px;
  padding: 10px 14px !important;
  transition: transform .08s ease, box-shadow .2s ease, border-color .2s ease, filter .2s ease;
  box-shadow: var(--shadow);
}
button:hover{
  transform: translateY(-1px);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px #8a7dff33, 0 10px 30px #0008, 0 0 40px #7b71ff22 inset;
  filter: saturate(115%);
}
button:active{ transform: translateY(0); }
.p-button--negative{
  border-color:#ff3b6e55 !important;
  background: linear-gradient(180deg,#2a0b25,#1a0618) !important;
  box-shadow: 0 0 0 1px #ff3b6e33, 0 10px 30px #0008, 0 0 40px #ff3b6e22 inset;
}
.p-button--negative:hover{
  box-shadow: 0 0 0 3px #ff3b6e33, 0 10px 30px #0008, 0 0 60px #ff3b6e33 inset;
}

/* Password toggle icon button from vanilla */
.p-form-password-toggle .p-button--base{
  padding: 8px 10px !important;
  border-radius: 10px !important;
}

/* --- Notices --- */
.p-card p.u-align-text--center{
  margin: 4px 0 0 0;
  padding: 10px 12px;
  font-weight: 600;
  color: #ffe4f1;
  border: 1px dashed #ff8fb633;
  border-radius: 12px;
  background:
    linear-gradient(180deg, #2b0c2a99, #18061699);
  box-shadow: inset 0 0 22px #ff3b6e22, 0 0 18px #ff3b6e11;
}

/* --- Forms block spacing --- */
#help{ margin-top: 12px; color: var(--muted); }
#saveSettings, #resetSettings{ min-width: 140px; }

/* --- Nice scrollbars (webkit) --- */
*::-webkit-scrollbar{ height:12px; width:12px; }
*::-webkit-scrollbar-thumb{
  background: linear-gradient(180deg,#6f65ff,#00e6ff);
  border:3px solid #0d0933;
  border-radius: 999px;
}
*::-webkit-scrollbar-track{ background:#0d0933; }

/* --- Tiny utilities --- */
.u-align--center{ margin-block: 18px; }
.u-no-margin--right{ margin-right: 0 !important; }

/* --- Responsive tweaks --- */
@media (max-width: 768px){
  .row .col-2{ display:none; }
  .row .col-8{ width: 100%; }
  #connections thead th, #connections tbody td{ padding: 10px 10px; }
}
