/* FlexIPTV Website Styles */
:root {
  --bg: #0b1220;
  --bg-accent: #0f1b33;
  --primary: #ff7a59;
  --primary-2: #ff9a76;
  --brand: #ffd600;
  --text: #e6edf7;
  --muted: #9fb0c3;
  --card: #121a2b;
  --card-2: #101827;
  --success: #2ecc71;
  --error: #e74c3c;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, Helvetica Neue, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  background: radial-gradient(1200px 800px at 80% -10%, #1b2a4a 0%, #0b1220 55%);
  color: var(--text);
}

.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }

/* Header */
.header { position: sticky; top: 0; z-index: 50; background: rgba(11,18,32,0.7); backdrop-filter: blur(8px); border-bottom: 1px solid #15213a; }
.nav { display: flex; align-items: center; justify-content: space-between; padding: 14px 0; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-weight: 800; letter-spacing: .3px; }
.logo-badge { background: #111a2c; border:1px solid #1e2b46; padding: 6px 10px; border-radius: 8px; font-weight: 900; }
.logo-badge b { color: var(--brand); }
.nav-links { display:flex; gap: 18px; }
.nav a { color: var(--muted); text-decoration: none; font-weight: 600; }
.nav a:hover { color: var(--text); }
.cta-btn { background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #0b1220; font-weight: 800; border: none; padding: 10px 16px; border-radius: 10px; cursor: pointer; box-shadow: 0 6px 18px rgba(255,122,89,.25); }
.cta-btn:hover { transform: translateY(-1px); }

.download-btn { background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #0b1220; font-weight: 800; border: none; padding: 10px 16px; border-radius: 10px; cursor: pointer; box-shadow: 0 6px 18px rgba(255,122,89,.25); }
.download-btn:hover { transform: translateY(-1px); }

/* Hero */
.hero { padding: 70px 0 40px; text-align: center; max-width: 700px; margin: 0 auto; }
.hero h1 { font-size: clamp(32px, 3.6vw, 54px); line-height: 1.05; margin: 0 0 16px; }
.hero p { color: var(--muted); margin: 0 0 18px; font-size: 18px; }
.hero-card { background: linear-gradient(180deg, #121a2b, #0f1929); border:1px solid #1b2946; border-radius: 16px; padding: 16px; box-shadow: 0 10px 30px rgba(0,0,0,.35); }
.hero-actions { display:flex; gap: 12px; margin-top: 10px; justify-content: center; }
.subtext { color: var(--muted); font-size: 13px; margin-top: 6px; }

/* Chess board layout */
.chess-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px 60px;
  padding: 40px 0;
  align-items: center;
}

.chess-item {
  display: flex;
  align-items: center;
  justify-content: center;
}

.chess-item.text-content {
  background: var(--card);
  border: 1px solid #1c2b49;
  border-radius: 16px;
  padding: 40px;
  text-align: left;
  position: relative;
  display: flex;             /* enforce vertical stacking */
  flex-direction: column;
  align-items: flex-start;
}

.chess-item.text-content::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--primary-2));
  border-radius: 16px 16px 0 0;
}

.chess-item.text-content h3 {
  margin: 0 0 32px;         /* clear separation from body text */
  font-size: 30px;
  color: var(--text);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.01em;
  width: 100%;
}

.chess-item.text-content p {
  color: var(--muted);
  margin: 0;
  font-size: 17px;
  line-height: 1.65;
  max-width: 64ch;          /* keep readable line length */
  width: 100%;
}

.badge { display:inline-flex; align-items:center; gap:8px; padding:6px 10px; border-radius:999px; border:1px solid #203155; background:#0f1b33; color:#b7c6da; font-weight:700; font-size:12px; letter-spacing:.3px; }
.badge i { color: var(--brand); }

/* Cards grid */
.grid { display:grid; grid-template-columns: repeat(3,1fr); gap: 18px; }
.card { background: var(--card); border:1px solid #1c2b49; border-radius: 16px; padding: 18px; }
.card h3 { margin: 6px 0 8px; }
.card p { color: var(--muted); margin: 0; }

/* Screenshots */
.screens { margin: 18px 0 8px; display:grid; grid-template-columns: repeat(3, minmax(360px, 1fr)); gap: 20px; align-items: center; }
.screen {
  position: relative;
  background: radial-gradient(800px 300px at 50% -40%, rgba(255,255,255,.06) 0%, rgba(13,22,42,1) 60%);
  border:1px solid #1a2746;
  border-radius: 16px;
  overflow: hidden;
  padding: 8px 8px 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.04);
  transition: transform .35s ease, box-shadow .35s ease;
  max-width: 500px; /* limit size for chess layout */
  margin: 0 auto;
}
.screen:hover { transform: translateY(-4px) scale(1.01); box-shadow: 0 18px 42px rgba(0,0,0,.45); }
.screen::after {
  content: "";
  position: absolute; inset: 0;
  border-radius: 16px;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.03);
}
.screen img {
  display:block; width:100%; height:auto; border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.35);
  -webkit-box-reflect: below 0 linear-gradient(transparent 0, rgba(255,255,255,.05) 16%, rgba(11,18,32,0.25) 38%, rgba(11,18,32,0.6) 58%, rgba(11,18,32,0.85) 78%, rgba(11,18,32,1) 100%);
}

/* Footer */
.footer { margin-top: 48px; border-top:1px solid #16254a; background:#0a1020; color:#8fa2be; }
.footer-inner { padding: 22px 0; display:flex; justify-content: space-between; align-items:center; gap:12px; flex-wrap: wrap; }
.footer a { color:#b9c8dc; text-decoration:none; }
.footer a:hover { color:#fff; }

/* Portal form */
.form { background: var(--card-2); border:1px solid #1b2a48; border-radius: 16px; padding: 18px; }
.form .row { display:grid; grid-template-columns: 1fr; gap: 14px; }
.label { font-weight: 700; color:#b7c6da; font-size: 14px; margin-bottom: 6px; display:block; }
.input, .textarea, .select { width:100%; background:#0d1527; border:1px solid #213257; color:#e6edf7; border-radius: 10px; padding: 12px 12px; font-size: 15px; }
.textarea { min-height: 110px; resize: vertical; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace; }
.help-inline { color:#9fb0c3; font-size: 12px; margin-top: 6px; }
.actions { display:flex; gap: 12px; align-items:center; margin-top: 8px; }
.btn { background:#17294f; color:#e6edf7; border:1px solid #2a3b64; padding: 10px 14px; border-radius: 10px; font-weight: 700; cursor: pointer; }
.btn.primary { background: linear-gradient(135deg, var(--primary), var(--primary-2)); color:#0b1220; border: none; box-shadow: 0 6px 18px rgba(255,122,89,.25); }
.notice { margin-top: 12px; padding: 10px 12px; border-radius: 10px; font-weight: 600; }
.notice.success { background: rgba(46, 204, 113, .15); border:1px solid rgba(46,204,113,.35); color:#baf7d3; }
.notice.error { background: rgba(231, 76, 60, .12); border:1px solid rgba(231,76,60,.35); color:#ffd3ce; }

.table { width: 100%; border-collapse: collapse; margin-top: 14px; }
.table th, .table td { text-align:left; padding: 10px; border-bottom: 1px solid #1b2948; font-size: 14px; }
.table th { color:#9fb0c3; font-weight:800; }
.code { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono"; background:#0c1426; border:1px solid #213257; padding: 3px 6px; border-radius: 6px; }

/* Modal */
.modal { position: fixed; inset: 0; display:none; align-items:center; justify-content:center; background: rgba(0,0,0,.55); z-index: 100; }
.modal.active { display:flex; }
.modal-card { width:min(680px, 92vw); background:#0d162a; border:1px solid #1c2b49; border-radius: 16px; padding: 18px; }
.modal-header { display:flex; justify-content:space-between; align-items:center; margin-bottom: 8px; }
.close { background: transparent; border:none; color:#9fb0c3; font-size: 22px; cursor: pointer; }
.ol { padding-left: 18px; color:#cdd9ea; }

/* Responsive */
@media (max-width: 1100px) {
  .screens { grid-template-columns: repeat(2, minmax(280px, 1fr)); }
  .chess-grid { gap: 30px 40px; }
  .chess-item.text-content { padding: 32px; }
  .chess-item.text-content h3 { font-size: 24px; }
  .chess-item.text-content p { font-size: 16px; }
}
@media (max-width: 700px) {
  .hero { grid-template-columns: 1fr; text-align: center; }
  .grid { grid-template-columns: 1fr; }
  .screens { grid-template-columns: 1fr; }
  .chess-grid { 
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .chess-item.text-content { padding: 24px; }
  .chess-item.text-content h3 { font-size: 22px; }
  .chess-item.text-content p { font-size: 15px; }
  .hero-actions { flex-direction: column; align-items: center; }
}

/* Admin Panel Styles */
.stat-card {
  background: var(--card);
  border: 1px solid #2a3b64;
  border-radius: 12px;
  padding: 20px;
  text-align: center;
}

.stat-number {
  font-size: 32px;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 8px;
}

.stat-label {
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

.table-container {
  background: var(--card);
  border: 1px solid #2a3b64;
  border-radius: 12px;
  overflow: hidden;
}

.devices-table {
  width: 100%;
  border-collapse: collapse;
}

.devices-table th {
  background: var(--bg-accent);
  color: var(--text);
  font-weight: 700;
  padding: 16px 12px;
  text-align: left;
  border-bottom: 1px solid #2a3b64;
}

.devices-table td {
  padding: 12px;
  border-bottom: 1px solid #1e2b46;
  color: var(--text);
}

.devices-table tr:hover {
  background: rgba(255, 122, 89, 0.05);
}

.devices-table tr:last-child td {
  border-bottom: none;
}

.devices-table code {
  background: var(--bg-accent);
  color: var(--brand);
  padding: 4px 8px;
  border-radius: 4px;
  font-family: 'Monaco', 'Menlo', monospace;
  font-size: 12px;
}

.btn-small {
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 6px;
  font-weight: 600;
}

@media (max-width: 768px) {
  .devices-table {
    font-size: 14px;
  }
  
  .devices-table th,
  .devices-table td {
    padding: 8px 6px;
  }
  
  .stat-card {
    padding: 16px;
  }
  
  .stat-number {
    font-size: 24px;
  }
}

/* Tabs */
.tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid #2a3b64;
  margin-bottom: 20px;
}

.tab-button {
  background: transparent;
  border: none;
  color: var(--muted);
  padding: 12px 20px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  font-weight: 600;
  transition: all 0.3s ease;
}

.tab-button:hover {
  color: var(--text);
  background: rgba(255, 122, 89, 0.1);
}

.tab-button.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.tab-content {
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* License Cards */
.license-card {
  background: var(--card);
  border: 1px solid #2a3b64;
  border-radius: 12px;
  margin-bottom: 16px;
  overflow: hidden;
}

.license-header {
  background: var(--bg-accent);
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.license-mac code {
  background: var(--brand);
  color: var(--bg);
  padding: 4px 8px;
  border-radius: 4px;
  font-weight: 700;
}

.license-status {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.status-active {
  background: var(--success);
  color: white;
}

.status-inactive {
  background: var(--muted);
  color: white;
}

.status-expired {
  background: var(--error);
  color: white;
}

.status-trial {
  background: #fff3cd;
  color: #856404;
}

.license-details {
  padding: 20px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

.license-detail {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.detail-label {
  color: var(--muted);
  font-weight: 600;
  font-size: 14px;
}

.detail-value {
  color: var(--text);
  font-weight: 500;
}

.detail-value.expired {
  color: var(--error);
  font-weight: 700;
}

.detail-value.warning {
  color: #f39c12;
  font-weight: 700;
}

.license-actions {
  padding: 16px 20px;
  background: rgba(255, 122, 89, 0.05);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-activate {
  background: var(--success);
  color: white;
}

.btn-deactivate {
  background: var(--error);
  color: white;
}

.btn-extend {
  background: #3498db;
  color: white;
}

.btn-reset {
  background: #f39c12;
  color: white;
}