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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #0f1117;
  color: #e1e4e8;
  min-height: 100vh;
}

a {
  color: #58a6ff;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Login */
.login-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.login-box {
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 8px;
  padding: 32px;
  width: 100%;
  max-width: 360px;
}

.login-box h1 {
  font-size: 20px;
  margin-bottom: 24px;
  text-align: center;
  color: #f0f6fc;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 13px;
  color: #8b949e;
  margin-bottom: 6px;
}

.form-group input {
  width: 100%;
  padding: 8px 12px;
  background: #0d1117;
  border: 1px solid #30363d;
  border-radius: 6px;
  color: #e1e4e8;
  font-size: 14px;
  outline: none;
}

.form-group input:focus {
  border-color: #58a6ff;
}

.btn {
  display: inline-block;
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  font-weight: 500;
}

.btn-primary {
  background: #238636;
  color: #fff;
  width: 100%;
  padding: 10px;
}

.btn-primary:hover {
  background: #2ea043;
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.login-error {
  color: #f85149;
  font-size: 13px;
  margin-bottom: 12px;
  text-align: center;
}

/* Navbar */
.navbar {
  background: #161b22;
  border-bottom: 1px solid #30363d;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.navbar-brand {
  font-size: 18px;
  font-weight: 600;
  color: #f0f6fc;
}

.navbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.navbar-user {
  color: #8b949e;
  font-size: 13px;
}

.btn-logout {
  background: transparent;
  color: #8b949e;
  border: 1px solid #30363d;
  padding: 4px 12px;
  font-size: 12px;
  border-radius: 6px;
  cursor: pointer;
}

.btn-logout:hover {
  color: #f85149;
  border-color: #f85149;
}

/* Container */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px;
}

/* Search */
.search-bar {
  margin-bottom: 20px;
}

.search-bar input {
  width: 100%;
  max-width: 400px;
  padding: 8px 12px;
  background: #0d1117;
  border: 1px solid #30363d;
  border-radius: 6px;
  color: #e1e4e8;
  font-size: 14px;
  outline: none;
}

.search-bar input:focus {
  border-color: #58a6ff;
}

/* Page header */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.page-header h1 {
  font-size: 22px;
  color: #f0f6fc;
}

/* Server Grid */
.server-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

/* Server Card */
.server-card {
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 8px;
  padding: 16px;
  cursor: pointer;
  transition: border-color 0.2s;
}

.server-card:hover {
  border-color: #58a6ff;
}

.server-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.server-card-title {
  font-size: 15px;
  font-weight: 600;
  color: #f0f6fc;
}

.server-card-ip {
  font-size: 12px;
  color: #8b949e;
  font-family: monospace;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: 500;
}

.status-online {
  background: rgba(35, 134, 54, 0.2);
  color: #3fb950;
}

.status-offline {
  background: rgba(248, 81, 73, 0.2);
  color: #f85149;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}

.status-online .status-dot {
  background: #3fb950;
}

.status-offline .status-dot {
  background: #f85149;
}

.slot-card-details {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.slot-card-stat {
  font-size: 13px;
  color: #8b949e;
}

.slot-card-latest {
  font-size: 12px;
  color: #8b949e;
}

.slot-chip-count {
  color: #58a6ff;
  font-weight: 600;
}

/* Breadcrumb */
.breadcrumb {
  font-size: 13px;
  color: #8b949e;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.breadcrumb-sep {
  color: #484f58;
}

/* Video List */
.video-table {
  width: 100%;
  border-collapse: collapse;
}

.video-table th {
  text-align: left;
  padding: 10px 12px;
  font-size: 12px;
  color: #8b949e;
  font-weight: 500;
  border-bottom: 1px solid #30363d;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.video-table td {
  padding: 10px 12px;
  font-size: 14px;
  border-bottom: 1px solid #21262d;
}

.video-table tr {
  cursor: pointer;
  transition: background 0.15s;
}

.video-table tbody tr:hover {
  background: #161b22;
}

.video-name {
  color: #58a6ff;
  font-family: monospace;
  font-size: 13px;
}

.video-date {
  color: #e1e4e8;
}

.video-size {
  color: #8b949e;
}

.badge-recording {
  background: rgba(210, 153, 34, 0.2);
  color: #d29922;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 12px;
  margin-left: 8px;
  font-weight: 500;
}

/* Video Player */
.player-container {
  max-width: 1000px;
  margin: 0 auto;
}

.player-container video {
  width: 100%;
  border-radius: 8px;
  background: #000;
}

.player-info {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  font-size: 13px;
}

.badge {
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
}

.badge-buffering {
  background: rgba(210, 153, 34, 0.2);
  color: #d29922;
}

.badge-ready {
  background: rgba(35, 134, 54, 0.2);
  color: #3fb950;
}

.file-info {
  color: #8b949e;
  font-family: monospace;
}

/* Loading & Error */
.loading {
  text-align: center;
  padding: 40px;
  color: #8b949e;
}

.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid #30363d;
  border-top-color: #58a6ff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-right: 8px;
  vertical-align: middle;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.error-msg {
  text-align: center;
  padding: 40px;
  color: #f85149;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #484f58;
}

.empty-state h3 {
  margin-bottom: 8px;
  color: #8b949e;
}

/* Slot view header */
.slot-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.slot-header h1 {
  font-size: 22px;
  color: #f0f6fc;
}

.slot-count {
  font-size: 13px;
  color: #8b949e;
}

/* Responsive */
@media (max-width: 768px) {
  .container {
    padding: 16px;
  }

  .server-grid {
    grid-template-columns: 1fr;
  }

  .navbar {
    padding: 12px 16px;
  }
}
