:root {
  --bg-main: #0a0e17;
  --bg-card: rgba(16, 24, 40, 0.75);
  --bg-card-hover: rgba(22, 33, 56, 0.85);
  --border-color: rgba(56, 189, 248, 0.15);
  --border-glow: rgba(56, 189, 248, 0.4);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --accent-cyan: #00f2fe;
  --accent-blue: #4facfe;
  --accent-emerald: #10b981;
  --accent-purple: #8b5cf6;
  --accent-rose: #f43f5e;
  --font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

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

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

/* Background Atmospheric Glows */
.bg-glow-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(140px);
  pointer-events: none;
  z-index: 0;
}
.orb-1 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(0, 242, 254, 0.12), transparent 70%);
  top: -150px;
  left: -150px;
}
.orb-2 {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.1), transparent 70%);
  bottom: -200px;
  right: -200px;
}
.bg-grid-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
}

.app-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 32px 24px;
  position: relative;
  z-index: 1;
}

/* Header */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 28px;
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  margin-bottom: 28px;
}
.header-left {
  display: flex;
  align-items: center;
  gap: 18px;
}
.logo-box {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: #fff;
  box-shadow: 0 0 20px rgba(0, 242, 254, 0.35);
}
.brand-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-row h1 {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 0.04em;
  background: linear-gradient(90deg, #fff, var(--accent-cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.badge-tag {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  background: rgba(0, 242, 254, 0.12);
  color: var(--accent-cyan);
  border: 1px solid rgba(0, 242, 254, 0.3);
  letter-spacing: 0.06em;
}
.subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}
.domain-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 8px 16px;
  border-radius: 30px;
}
.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-emerald);
  box-shadow: 0 0 10px var(--accent-emerald);
  animation: pulseGlow 2s infinite;
}
@keyframes pulseGlow {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}
.domain-text {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  color: #fff;
}
.cdn-badge {
  font-size: 10px;
  font-weight: 700;
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-emerald);
  padding: 2px 8px;
  border-radius: 12px;
}

/* Stats Row */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin-bottom: 28px;
}
.stat-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 22px;
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  transition: all 0.25s ease;
}
.stat-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-glow);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}
.stat-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}
.icon-video { background: rgba(0, 242, 254, 0.12); color: var(--accent-cyan); }
.icon-files { background: rgba(139, 92, 246, 0.12); color: var(--accent-purple); }
.icon-storage { background: rgba(244, 63, 94, 0.12); color: var(--accent-rose); }
.icon-server { background: rgba(16, 185, 129, 0.12); color: var(--accent-emerald); }
.stat-info {
  display: flex;
  flex-direction: column;
}
.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}
.stat-value {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  margin-top: 2px;
  font-family: var(--font-mono);
}

/* Upload Section & Dropzone */
.upload-section {
  margin-bottom: 28px;
}
.dropzone {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 2px dashed rgba(56, 189, 248, 0.35);
  border-radius: 20px;
  padding: 44px 28px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}
.dropzone:hover, .dropzone.dragover {
  border-color: var(--accent-cyan);
  background: rgba(22, 33, 56, 0.85);
  box-shadow: 0 0 30px rgba(0, 242, 254, 0.2);
  transform: scale(1.005);
}
.upload-icon-pulse {
  width: 72px;
  height: 72px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: rgba(0, 242, 254, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  color: var(--accent-cyan);
  transition: transform 0.3s ease;
}
.dropzone:hover .upload-icon-pulse {
  transform: translateY(-4px) scale(1.08);
}
.dropzone h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
}
.dropzone-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 20px;
}
.btn-browse {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  background: linear-gradient(135deg, #00c6ff, #0072ff);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0, 114, 255, 0.35);
  transition: all 0.2s ease;
}
.btn-browse:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 114, 255, 0.5);
}

/* Progress bar */
.upload-progress-container {
  margin-top: 20px;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}
.progress-info {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.progress-bar-track {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-purple));
  transition: width 0.2s ease;
}

/* Quick Copied Card on Upload */
.recent-upload-box {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.12), rgba(16, 24, 40, 0.9));
  border: 1px solid rgba(16, 185, 129, 0.4);
  border-radius: 16px;
  padding: 20px 24px;
  margin-bottom: 28px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
  animation: slideDown 0.3s ease;
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Library Section */
.library-section {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 24px 28px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}
.library-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 24px;
}
.lib-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.lib-title-row h2 {
  font-size: 18px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}
.lib-title-row h2 i {
  color: var(--accent-cyan);
}
.badge-count {
  font-size: 12px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.08);
  padding: 3px 10px;
  border-radius: 20px;
  color: var(--text-muted);
}
.filter-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.search-box {
  position: relative;
  display: flex;
  align-items: center;
}
.search-box i {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
  font-size: 13px;
}
.search-box input {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-color);
  padding: 8px 14px 8px 36px;
  border-radius: 10px;
  color: #fff;
  font-family: var(--font-family);
  font-size: 13px;
  width: 220px;
  outline: none;
  transition: all 0.2s ease;
}
.search-box input:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 10px rgba(0, 242, 254, 0.25);
  width: 260px;
}
.tabs-row {
  display: flex;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 3px;
}
.tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.tab-btn.active, .tab-btn:hover {
  background: rgba(56, 189, 248, 0.15);
  color: var(--accent-cyan);
}
.btn-refresh {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}
.btn-refresh:hover {
  color: #fff;
  border-color: var(--accent-cyan);
}

/* Media Grid */
.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}
.media-card {
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  overflow: hidden;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}
.media-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-glow);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
}
.media-preview-box {
  width: 100%;
  height: 160px;
  background: #000;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.media-preview-box video, .media-preview-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}
.media-card:hover .media-preview-box video, 
.media-card:hover .media-preview-box img {
  transform: scale(1.04);
}
.media-type-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 5px;
  z-index: 2;
}
.play-overlay-icon {
  position: absolute;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.7);
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  opacity: 0.85;
  transition: all 0.2s ease;
}
.media-preview-box:hover .play-overlay-icon {
  transform: scale(1.15);
  opacity: 1;
  background: rgba(0, 242, 254, 0.85);
  color: #000;
}
.media-meta-box {
  padding: 14px 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.media-filename {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}
.media-sub-meta {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
}
.media-actions-row {
  display: grid;
  grid-template-columns: 1fr 1fr 34px;
  gap: 8px;
}
.btn-action {
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s ease;
}
.btn-action:hover {
  background: rgba(56, 189, 248, 0.2);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}
.btn-delete {
  color: var(--accent-rose);
}
.btn-delete:hover {
  background: rgba(244, 63, 94, 0.2);
  border-color: var(--accent-rose);
  color: #fff;
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}
.modal-card {
  background: #0f172a;
  border: 1px solid var(--border-glow);
  border-radius: 20px;
  width: 100%;
  max-width: 760px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
  animation: zoomIn 0.25s ease;
}
@keyframes zoomIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.modal-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 600;
}
.modal-title-wrap i { color: var(--accent-cyan); }
.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  transition: color 0.2s ease;
}
.modal-close-btn:hover { color: #fff; }
.modal-body {
  max-height: 480px;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-body video, .modal-body img {
  max-width: 100%;
  max-height: 480px;
  width: auto;
  height: auto;
}
.modal-footer {
  padding: 16px 20px;
  background: rgba(15, 23, 42, 0.95);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.url-input-wrap {
  display: flex;
  gap: 10px;
}
.url-input-wrap input {
  flex: 1;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--border-color);
  padding: 10px 14px;
  border-radius: 10px;
  color: var(--accent-cyan);
  font-family: var(--font-mono);
  font-size: 13px;
  outline: none;
}
.btn-copy-url {
  padding: 10px 20px;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
  color: #000;
  font-weight: 700;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Toast */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.toast {
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid var(--border-glow);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  padding: 12px 18px;
  border-radius: 12px;
  color: #fff;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideLeft 0.3s ease;
}
.toast i { color: var(--accent-cyan); }
@keyframes slideLeft {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

.loading-state, .empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.loading-state i {
  font-size: 28px;
  color: var(--accent-cyan);
  margin-bottom: 12px;
}

@media (max-width: 768px) {
  .app-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
  .header-right {
    width: 100%;
  }
  .domain-pill {
    width: 100%;
    justify-content: space-between;
  }
}
