/* =======================================================
   SAT VISION — UNIVERSAL THEME STYLES (Dark + Light)
   Responsive + Modern
   ======================================================= */

/* === THEME VARIABLES === */
:root {
  /* Default (dark) */
  --bg: #111827;
  --text: #f9fafb;
  --card-bg: #1f2937;
  --border: #374151;
  --muted: #9ca3af;
  --panel: #1e293b;
  --panel-2: #2d364d;
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --focus: 0 0 0 2px rgba(59,130,246,.4);
}

/* Light mode */
[data-theme="light"] {
  --bg: #f9fafb;
  --text: #111827;
  --card-bg: #ffffff;
  --border: #d1d5db;
  --muted: #6b7280;
  --panel: #f3f4f6;
  --panel-2: #e5e7eb;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --focus: 0 0 0 2px rgba(37,99,235,.35);
}

/* === GLOBAL === */
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; padding: 0; }

body.sv-body {
  background: radial-gradient(1200px 600px at 20% -10%, rgba(79,140,255,.12), transparent 60%), var(--bg);
  color: var(--text);
  font: 15px/1.6 "Inter", system-ui, Segoe UI, Roboto, Arial, sans-serif;
  transition: background-color .3s, color .3s;
  -webkit-tap-highlight-color: transparent;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* === NAVBAR === */
.sv-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  background: linear-gradient(0deg, transparent, rgba(255,255,255,.02));
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(6px);
  position: sticky;
  top: 0;
  z-index: 10;
}
.sv-brand a {
  color: var(--text);
  font-weight: 700;
  font-size: 18px;
}
.sv-menu {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

/* === BUTTONS & INPUTS === */
.btn, .input, select {
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  outline: none;
  transition: all .2s ease;
  font-size: 0.95rem;
}
.input:focus, select:focus, .btn:focus { box-shadow: var(--focus); }

.btn {
  cursor: pointer;
  font-weight: 600;
}
.btn:hover { background: var(--panel-2); filter: brightness(1.05); }

.btn-primary {
  background: var(--primary);
  color: #fff;
  border: 1px solid var(--primary-hover);
}
.btn-primary:hover { background: var(--primary-hover); }

.btn-secondary { background: var(--panel-2); }
.btn-danger { background: #b91c1c; color: #fff; }
.btn-danger:hover { background: #dc2626; }

.btn-icon {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 10px;
  padding: 8px 10px;
  cursor: pointer;
  transition: all .2s;
}
.btn-icon:hover { background: var(--panel-2); }

.btn-small {
  background: var(--primary);
  border: none;
  color: #fff;
  padding: 6px 10px;
  margin-left: 6px;
  border-radius: 6px;
  cursor: pointer;
  font-size: .8rem;
  margin-top: 10px;
}
.btn-small:hover { background: var(--primary-hover); }

.inline { display: inline; }

/* === CARDS === */
.sv-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  box-shadow: 0 10px 24px rgba(0,0,0,.25);
  transition: background-color .3s, border-color .3s;
}

/* === MAIN GRID === */
.sv-main {
  max-width: 980px;
  margin: 30px auto;
  padding: 0 16px;
  display: grid;
  gap: 16px;
}
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 1024px) {
  .grid-2 { grid-template-columns: 1fr; gap: 20px; }
  .sv-card { padding: 16px; }
}
@media (max-width: 600px) {
  body.sv-body { font-size: 14px; }
  .sv-card { padding: 14px; border-radius: 10px; }
  .btn, .input, select { padding: 9px 10px; border-radius: 8px; }
}

/* === TABLES === */
.table { width: 100%; border-collapse: separate; border-spacing: 0 8px; overflow-x: auto; display: block; }
.table thead th {
  color: var(--muted);
  font-weight: 600;
  text-align: left;
  padding: 8px;
  white-space: nowrap;
}
.table tbody tr {
  background: rgba(255,255,255,.03);
  transition: background-color .2s;
}
.table tbody tr:hover { background: rgba(255,255,255,.07); }
.table tbody td {
  padding: 10px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

/* === ALERTS & BADGES === */
/* === BADGES (Dark + Light unified) === */
.badge {
  font-size: 12px;
  border-radius: 999px;
  padding: 4px 8px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  display: inline-block;
  transition: background-color .3s, border-color .3s, color .3s;
}

/* Success / OK badge */
.badge.ok {
  border-color: rgba(52,211,153,.4);
  background: rgba(52,211,153,.12);
  color: #22c55e; /* bright green readable on both themes */
}

/* Warning / Error badge */
.badge.warn {
  border-color: rgba(239,68,68,.4);
  background: rgba(239,68,68,.12);
  color: #ef4444; /* readable red on light & dark */
}

/* Optional hover effect */
.badge:hover {
  filter: brightness(1.1);
}


.alert {
  padding: 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.04);
  transition: background-color .3s;
  word-break: break-word;
}
.alert.error {
  border-color: rgba(239,68,68,.35);
  background: rgba(239,68,68,.1);
  color: #ffd1d1;
}
.alert.ok {
  border-color: rgba(52,211,153,.35);
  background: rgba(52,211,153,.1);
  color: #bdf5de;
}
.alert code {
  background: var(--panel);
  padding: 3px 6px;
  border-radius: 4px;
  word-break: break-word;
}

/* === KEY VALUE === */
.kv {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 8px;
  margin: 8px 0;
  align-items: center;
}
@media (max-width: 700px) {
  .kv { grid-template-columns: 1fr; gap: 4px; }
  .kv div:first-child { font-weight: 600; }
}

.kv input[type=text], .kv input[readonly] {
  width: 100%;
  background: var(--card-bg);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 6px;
  padding: 6px;
  font-size: .9rem;
  overflow-x: auto;
}

/* === COPYABLE === */
.copyable {
  cursor: pointer;
  user-select: text;
  transition: background-color .3s;
  word-break: break-all;
}
.copyable:hover {
  background-color: rgba(59,130,246,0.15);
}

/* === FOOTER === */
.sv-footer {
  text-align: center;
  margin: 30px 0 10px;
  color: var(--muted);
  font-size: 13px;
}

/* === RESPONSIVE UTILITIES === */
@media (max-width: 480px) {
  .sv-brand a { font-size: 16px; }
  .sv-menu { flex-direction: column; gap: 6px; align-items: flex-start; }
  .btn, .input, select { width: 100%; }
  .sv-card { box-shadow: none; }
}

@media (min-width: 1600px) {
  .sv-main { max-width: 1280px; }
  body.sv-body { font-size: 16px; }
}
/* === RESPONSIVE NAVBAR === */
.menu-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  width: 36px;
  height: 32px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: all .3s ease;
}
.menu-btn span {
  width: 20px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all .3s ease;
}
.menu-btn.active span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}
.menu-btn.active span:nth-child(2) {
  opacity: 0;
}
.menu-btn.active span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

/* Mobile Nav Behavior */
@media (max-width: 768px) {
  .menu-btn { display: flex; }
  .sv-menu {
    position: absolute;
    top: 58px;
    right: 10px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    flex-direction: column;
    align-items: flex-start;
    padding: 10px;
    gap: 6px;
    box-shadow: 0 6px 18px rgba(0,0,0,.25);
    display: none;
    animation: fadeIn .25s ease;
    z-index: 99;
  }
  .sv-menu.open { display: flex; }
  .sv-menu a, .sv-menu form, .sv-menu button {
    width: 100%;
    text-align: left;
  }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}
.form-row{
    display: flex;
    flex-direction: column;
    gap: 1em;
}
#sv-card-change{
    position: relative;
    left: 50%;
    transform: translate(-50%);
}
#create{
    margin-top: -2.5em;
}

.btn-channels {
  display: inline-block;
  background: linear-gradient(90deg, #3b82f6, #2563eb);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  padding: 0.7rem 1.4rem;
  border-radius: 12px;
  font-size: 0.95rem;
  transition: all 0.2s ease;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}
.btn-channels:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.45);
}
.btn-channels:active {
  transform: scale(0.98);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}
.xtream, .m3up {
  background: linear-gradient(180deg, rgba(17,24,39,0.9), rgba(10,15,25,0.9));
  border: 1px solid rgba(59,130,246,0.3); /* soft blue outline */
  border-radius: 18px;
  padding: 18px 22px;
  margin-top: 1.2rem;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.xtream:hover, .m3up:hover {
  box-shadow: 0 0 20px rgba(59,130,246,0.35);
  transform: translateY(-2px);
}

.xtream h4, .m3up h4 {
  font-size: 1.05rem;
  color: #93c5fd; /* soft light blue */
  margin-bottom: 0.8rem;
  letter-spacing: 0.3px;
}

.kv {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.4rem;
  font-size: 0.95rem;
}

.kv strong {
  color: #e5e7eb;
}

.copyable {
  cursor: pointer;
  color: #60a5fa;
  font-weight: 500;
}

.copyable:hover {
  text-decoration: underline;
}

input#m3u_input {
  background: rgba(17,24,39,0.85);
  color: #e5e7eb;
  border: 1px solid rgba(59,130,246,0.4);
  border-radius: 10px;
}

input#m3u_input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 6px rgba(59,130,246,0.4);
}
/* === ACCOUNT CARD (Unified with sv-card) === */
.account-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
  box-shadow: 0 10px 24px rgba(0,0,0,0.25);
  transition: background-color .3s, border-color .3s, box-shadow .3s, transform .2s;
  color: var(--text);
}

.account-card:hover {
  box-shadow: 0 0 25px rgba(59,130,246,0.25);
  transform: translateY(-2px);
}

.account-card h3 {
  color: var(--primary);
  font-size: 1.2rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: .3rem;
}

/* === SUBSCRIPTION BOX === */
.subscription-box {
  margin-top: 1.8rem;
  padding: 1rem 1.2rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: background-color .3s, border-color .3s;
}

.subscription-box h3 {
  color: var(--primary);
  font-size: 1.1rem;
  margin-bottom: .8rem;
}

.subscription-box label {
  color: var(--text);
  font-weight: 500;
  font-size: .9rem;
}

.subscription-box select {
  width: 100%;
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: .6rem .8rem;
  border-radius: 8px;
  font-size: .95rem;
  transition: all .2s ease;
}

.subscription-box select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 6px rgba(59,130,246,0.4);
  outline: none;
}
.badge.pending {
      border-color: rgba(245, 158, 11, 0.4);  /* soft amber border */
  background: rgba(245, 158, 11, 0.12);   /* faint amber background */
  color: #f59e0b;                         /* main amber text */
}
