:root {
  --bg-darkest: #080b11;
  --bg-darker: #0d121f;
  --bg-panel: #121826;
  --border-color: rgba(255, 255, 255, 0.06);
  --accent-emerald: #10b981;
  --accent-emerald-glow: rgba(16, 185, 129, 0.25);
  --accent-red: #ef4444;
  --accent-red-glow: rgba(239, 68, 68, 0.25);
  --text-white: #f8fafc;
  --text-gray: #94a3b8;
  --text-muted: #64748b;
  --sidebar-width: 70px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-darkest);
  color: var(--text-white);
  font-family: var(--font-plus-jakarta-sans), 'Plus Jakarta Sans', sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Navbar - ONLY the name */
.navbar {
  height: 60px;
  width: 100%;
  background: var(--bg-darker);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100;
}

.navbar-brand {
  font-family: var(--font-outfit), 'Outfit', sans-serif;
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--accent-emerald);
  text-decoration: none;
}

/* Main Layout Grid */
.app-container {
  display: flex;
  padding-top: 60px;
  flex: 1;
  min-height: calc(100vh - 40px);
}

/* Vertical Slim Sidebar */
.vertical-sidebar {
  width: var(--sidebar-width);
  background: var(--bg-darker);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 1.5rem;
  position: fixed;
  top: 60px;
  left: 0;
  bottom: 40px;
  z-index: 90;
}

.sidebar-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
  margin-bottom: 1rem;
  transition: all 0.2s ease;
  text-decoration: none;
}

.sidebar-icon:hover, .sidebar-icon.active {
  color: var(--accent-emerald);
  background: rgba(16, 185, 129, 0.08);
}

.sidebar-icon.active {
  border-left: 3px solid var(--accent-emerald);
  border-radius: 0 10px 10px 0;
  padding-right: 3px;
}

.sidebar-bottom {
  margin-top: auto;
  margin-bottom: 1.5rem;
}

/* Layout Page Grid */
.main-grid-layout {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 320px;
  min-height: 100%;
}

@media (max-width: 1100px) {
  .main-grid-layout {
    grid-template-columns: 1fr;
  }
}

.main-stage {
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* Video Player Container */
.player-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 12px 36px rgba(0,0,0,0.4);
}

.video-viewport {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  background: #020406;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.video-overlay-top {
  position: absolute;
  top: 1rem;
  left: 1rem;
  right: 1rem;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
  z-index: 10;
}

.status-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(8px);
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-live {
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: var(--accent-emerald);
}

.badge-live::before {
  content: '';
  width: 8px;
  height: 8px;
  background-color: var(--accent-emerald);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent-emerald);
  animation: pulse-dot 1.8s infinite;
}

.watcher-count {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.08);
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-white);
}

/* Stream Title Details */
.stream-header-info {
  margin-top: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.stream-title {
  font-family: var(--font-outfit), 'Outfit', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-white);
}

.badge-row {
  display: flex;
  gap: 0.75rem;
}

.meta-badge {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-color);
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-gray);
}

.meta-badge-green {
  color: var(--accent-emerald);
  border-color: rgba(16, 185, 129, 0.2);
  background: rgba(16, 185, 129, 0.05);
}

/* Channels List */
.right-sidebar {
  background: var(--bg-darker);
  border-left: 1px solid var(--border-color);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.search-container {
  position: relative;
  width: 100%;
}

.search-input {
  width: 100%;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-color);
  padding: 0.75rem 1rem 0.75rem 2.5rem;
  border-radius: 10px;
  color: var(--text-white);
  font-size: 0.85rem;
  font-family: inherit;
}

.search-input:focus {
  outline: none;
  border-color: var(--accent-emerald);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.15);
}

.search-icon {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.channels-header {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.5rem;
}

.channel-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.channel-card {
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 0.75rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.channel-card:hover {
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.1);
}

.channel-card.active {
  border-color: var(--accent-emerald);
  background: rgba(16, 185, 129, 0.04);
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.05);
}

.channel-thumb {
  width: 60px;
  height: 40px;
  background: #1e293b;
  border-radius: 6px;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255,255,255,0.05);
}

.channel-card.active .channel-thumb {
  background: linear-gradient(135deg, #090c13 0%, #16241c 100%);
  border-color: rgba(16, 185, 129, 0.2);
}

.channel-card.active .channel-thumb::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 2px;
  background: var(--accent-emerald);
  box-shadow: 0 0 8px var(--accent-emerald);
  top: 30%;
  animation: scan-line 2s infinite linear;
}

@keyframes scan-line {
  0% { top: 0%; }
  100% { top: 100%; }
}

.channel-meta {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  text-align: left;
}

.channel-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-white);
}

.channel-status {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.2px;
}

.status-live {
  color: var(--accent-emerald);
}

.status-offline {
  color: var(--text-muted);
}

.status-standby {
  color: #eab308;
}

/* Admin Dashboard Styles */
.admin-main {
  margin-left: var(--sidebar-width);
  flex: 1;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.admin-layout-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 2rem;
  width: 100%;
}

@media (max-width: 950px) {
  .admin-layout-grid {
    grid-template-columns: 1fr;
  }
}

.admin-main-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 0 12px 36px rgba(0,0,0,0.4);
  height: fit-content;
}

.admin-card-header {
  margin-bottom: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.admin-card-title {
  font-family: var(--font-outfit), 'Outfit', sans-serif;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-white);
}

.admin-card-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.admin-sidebar-cards {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.admin-sidebar-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 12px 36px rgba(0,0,0,0.4);
}

.admin-sidebar-card .card-title {
  font-family: var(--font-outfit), 'Outfit', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text-white);
  border-left: 3px solid var(--accent-emerald);
  padding-left: 0.5rem;
}

/* Tables */
.table-container {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

th {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-color);
}

td {
  font-size: 0.85rem;
  padding: 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  color: var(--text-gray);
}

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

.ip-clickable {
  font-family: var(--font-outfit), 'Outfit', sans-serif;
  font-weight: 600;
  color: var(--accent-emerald);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.15s ease;
}

.ip-clickable:hover {
  color: #34d399;
}

.device-count-badge {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border-color);
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-white);
}

.device-details-panel {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.75rem;
  margin-top: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.device-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  color: var(--text-gray);
  padding-bottom: 0.25rem;
  border-bottom: 1px solid rgba(255,255,255,0.02);
}

.device-detail-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.device-agent {
  font-weight: 500;
  color: var(--text-white);
  text-align: left;
}

/* Action Buttons */
.btn-block-ip {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: var(--accent-red);
  padding: 0.35rem 0.85rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: all 0.2s ease;
  width: 100%;
}

.btn-block-ip:hover {
  background: var(--accent-red);
  color: var(--text-white);
  box-shadow: 0 0 10px var(--accent-red-glow);
}

.btn-unblock-ip {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.2);
  color: var(--accent-emerald);
  padding: 0.3rem 0.75rem;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 700;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: all 0.2s ease;
}

.btn-unblock-ip:hover {
  background: var(--accent-emerald);
  color: var(--text-white);
  box-shadow: 0 0 10px var(--accent-emerald-glow);
}

/* Form Inputs */
.source-input-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 1rem;
  text-align: left;
}

.source-input-group label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
}

.text-input {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-color);
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  color: var(--text-white);
  font-size: 0.85rem;
  font-family: inherit;
  width: 100%;
}

.text-input:focus {
  outline: none;
  border-color: var(--accent-emerald);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.2);
}

.btn-primary {
  background: var(--accent-emerald);
  border: 1px solid transparent;
  color: var(--text-white);
  padding: 0.65rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.85rem;
  width: 100%;
  margin-top: 1.5rem;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px var(--accent-emerald-glow);
}

.btn-primary:hover {
  background: #059669;
  box-shadow: 0 4px 16px var(--accent-emerald-glow);
}

.btn-secondary {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border-color);
  color: var(--text-white);
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background: rgba(255,255,255,0.1);
}

.blocked-registry-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1rem;
  max-height: 250px;
  overflow-y: auto;
}

.blocked-registry-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(239, 68, 68, 0.05);
  border: 1px solid rgba(239, 68, 68, 0.1);
  padding: 0.6rem 0.85rem;
  border-radius: 8px;
}

.blocked-ip-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-white);
  font-family: var(--font-outfit), 'Outfit', sans-serif;
}

.blocked-empty {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
  padding: 1.5rem 0;
}

.no-sessions-empty {
  text-align: center;
  padding: 2.5rem 0;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Login Panel */
.login-panel-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  margin-top: 60px;
}

.login-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 2.5rem;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 12px 36px rgba(0,0,0,0.5);
  text-align: center;
}

.login-title {
  font-family: var(--font-outfit), 'Outfit', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.login-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
}

/* Footer Sync Text */
.sync-text {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

@keyframes pulse-dot {
  0% { transform: scale(0.9); opacity: 0.6; }
  50% { transform: scale(1.1); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.6; }
}

/* Footer Bar styling */
.footer-bar {
  height: 40px;
  width: 100%;
  background: var(--bg-darker);
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  position: fixed;
  bottom: 0;
  left: 0;
  z-index: 100;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.sync-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sync-dot {
  width: 8px;
  height: 8px;
  background-color: var(--accent-emerald);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent-emerald);
  animation: pulse-dot 1.8s infinite;
}

.footer-control-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 4px;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.2s ease;
}

.footer-control-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-white);
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
  :root {
    --sidebar-width: 0px;
  }

  .navbar {
    padding: 0 1rem;
  }

  .app-container {
    padding-top: 60px;
    padding-bottom: 100px;
    flex-direction: column;
  }

  .vertical-sidebar {
    width: 100%;
    height: 60px;
    flex-direction: row;
    justify-content: space-around;
    padding-top: 0;
    align-items: center;
    position: fixed;
    top: auto;
    bottom: 40px;
    left: 0;
    right: 0;
    border-right: none;
    border-top: 1px solid var(--border-color);
    background: rgba(13, 18, 31, 0.95);
    backdrop-filter: blur(12px);
  }

  .sidebar-icon {
    margin-bottom: 0;
    width: 44px;
    height: 44px;
  }

  .sidebar-bottom {
    margin-top: 0;
    margin-bottom: 0;
  }

  .sidebar-icon.active {
    border-left: none;
    border-bottom: 3px solid var(--accent-emerald);
    border-radius: 6px 6px 0 0;
    padding-right: 0;
    padding-bottom: 3px;
  }

  .main-grid-layout {
    margin-left: 0;
    margin-bottom: 0;
    grid-template-columns: 1fr;
  }

  .main-stage {
    padding: 1rem 0.75rem;
    gap: 1.25rem;
  }

  .player-card {
    padding: 1rem;
    border-radius: 12px;
  }

  .stream-title {
    font-size: 1.25rem;
  }

  .right-sidebar {
    border-left: none;
    border-top: 1px solid var(--border-color);
    padding: 1.5rem 0.75rem;
    background: var(--bg-darkest);
  }

  .admin-main {
    margin-left: 0;
    padding: 1rem 0.75rem;
  }

  .admin-main-card {
    padding: 1.25rem 1rem;
  }

  .admin-card-header {
    flex-direction: column;
    gap: 1rem;
    align-items: stretch;
  }

  .admin-card-header button {
    align-self: flex-start;
  }

  .admin-layout-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  th, td {
    padding: 0.75rem 0.5rem;
    font-size: 0.8rem;
  }

  .btn-block-ip {
    padding: 0.35rem 0.6rem;
    font-size: 0.7rem;
  }

  .login-panel-container {
    padding: 1rem;
    margin-top: 60px;
  }

  .login-card {
    padding: 1.75rem 1.25rem;
  }
}
