:root {
  --bg-primary: #0a0c10;
  --bg-card: rgba(18, 22, 32, 0.75);
  --bg-card-hover: rgba(28, 34, 50, 0.85);
  --border-color: rgba(255, 255, 255, 0.08);
  --accent-cyan: #00f2fe;
  --accent-blue: #4facfe;
  --accent-purple: #7f53ac;
  --accent-green: #00e676;
  --accent-red: #ff5252;
  --text-main: #f0f4f8;
  --text-muted: #8a99ad;
  --font-main: 'Outfit', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

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

body {
  background-color: var(--bg-primary);
  color: var(--text-main);
  font-family: var(--font-main);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  padding-bottom: 2rem;
}

/* Background Decor */
.background-decor {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.25;
}

.orb-1 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, #00f2fe, #4facfe);
  top: -100px;
  left: -100px;
}

.orb-2 {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, #64748b, #00f2fe);
  bottom: -200px;
  right: -100px;
}

.grid-overlay {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 32px 32px;
}

/* Container */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  position: relative;
  z-index: 1;
}

/* Header */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding: 1.25rem 1.5rem;
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, #00f2fe, #4facfe);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 0 20px rgba(0, 242, 254, 0.3);
}

.logo-icon svg {
  width: 28px;
  height: 28px;
}

.brand h1 {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}

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

.status-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  background: rgba(0, 230, 118, 0.1);
  border: 1px solid rgba(0, 230, 118, 0.3);
  color: var(--accent-green);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-green);
  box-shadow: 0 0 10px var(--accent-green);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.18);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-icon svg {
  width: 24px;
  height: 24px;
}

.ptv-color { background: rgba(0, 242, 254, 0.15); color: #00f2fe; }
.silence-color { background: rgba(127, 83, 172, 0.15); color: #b472fb; }
.sw-color { background: rgba(255, 171, 0, 0.15); color: #ffab00; }
.uptime-color { background: rgba(0, 230, 118, 0.15); color: #00e676; }

.stat-details {
  display: flex;
  flex-direction: column;
}

.stat-title {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  font-family: var(--font-mono);
}

.stat-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Layout */
.main-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 1.5rem;
}

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

.panel {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 1.5rem;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
}

.panel-header h2 {
  font-size: 1.1rem;
  font-weight: 600;
}

.badge {
  font-size: 0.75rem;
  padding: 0.25rem 0.6rem;
  border-radius: 12px;
  background: rgba(0, 242, 254, 0.15);
  color: var(--accent-cyan);
  border: 1px solid rgba(0, 242, 254, 0.3);
  font-weight: 600;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 0.5rem;
  background: rgba(0, 0, 0, 0.3);
  padding: 0.3rem;
  border-radius: 12px;
  margin-bottom: 1.5rem;
}

.tab-btn {
  flex: 1;
  padding: 0.6rem 0.8rem;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-main);
  font-size: 0.85rem;
  font-weight: 500;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tab-btn.active {
  background: var(--bg-card-hover);
  color: #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* Form */
.upload-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.file-dropzone {
  border: 2px dashed rgba(255, 255, 255, 0.15);
  border-radius: 14px;
  padding: 2rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  background: rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.file-dropzone:hover {
  border-color: var(--accent-cyan);
  background: rgba(0, 242, 254, 0.05);
}

.file-dropzone svg {
  width: 36px;
  height: 36px;
  color: var(--accent-cyan);
}

.file-dropzone span {
  font-size: 0.9rem;
  color: var(--text-main);
}

.custom-select {
  width: 100%;
  padding: 0.75rem;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-family: var(--font-main);
  outline: none;
}

.submit-btn {
  width: 100%;
  padding: 0.85rem;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #00f2fe, #4facfe);
  color: #000;
  font-family: var(--font-main);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.submit-btn:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.submit-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Result Box */
.result-box {
  margin-top: 1.5rem;
  padding: 1.25rem;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-color);
}

.result-box h3 {
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

#mediaPreview video, #mediaPreview img {
  max-width: 100%;
  max-height: 320px;
  border-radius: 10px;
  display: block;
  margin: 0 auto 1rem;
}

.download-link {
  display: block;
  text-align: center;
  padding: 0.75rem;
  border-radius: 10px;
  background: var(--accent-green);
  color: #000;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.9rem;
}

/* Endpoints & Logs */
.endpoints-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.endpoint-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.8rem;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.25);
  font-size: 0.8rem;
}

.method {
  font-family: var(--font-mono);
  font-weight: 700;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.7rem;
}

.method.get { background: rgba(0, 230, 118, 0.2); color: var(--accent-green); }
.method.post { background: rgba(0, 242, 254, 0.2); color: var(--accent-cyan); }

.path {
  font-family: var(--font-mono);
  font-weight: 500;
  color: var(--text-main);
}

.desc {
  color: var(--text-muted);
  font-size: 0.75rem;
  margin-left: auto;
}

.log-viewer {
  background: #05070a;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 0.85rem;
  height: 220px;
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.log-line {
  color: #a0aec0;
  word-break: break-all;
}

.log-line.error { color: var(--accent-red); }
.log-line.info { color: var(--accent-cyan); }
