/* ====================================================================
   SUKSES BERSAMA - Video Cloud Storage System
   Tema: Profesional Executive Dark Theme with Gold & Cyan/Blue Accents
   ==================================================================== */

:root {
  /* Color Palette */
  --bg-main: #0a0d14;
  --bg-sidebar: #0f1422;
  --bg-card: #141b2d;
  --bg-card-hover: #1b243b;
  --bg-input: #0a0d17;
  --bg-modal: #111728;
  --border-color: #232d45;
  --border-light: #2e3b5b;

  /* Accent Colors */
  --accent-gold: #f59e0b;
  --accent-gold-glow: rgba(245, 158, 11, 0.25);
  --accent-blue: #3b82f6;
  --accent-blue-glow: rgba(59, 130, 246, 0.25);
  --accent-emerald: #10b981;
  --accent-emerald-glow: rgba(16, 185, 129, 0.25);
  --accent-red: #ef4444;
  --accent-purple: #8b5cf6;
  --accent-cyan: #06b6d4;

  /* Platform Branding Colors */
  --brand-youtube: #ff0000;
  --brand-tiktok: #00f2fe;
  --brand-tiktok-sub: #fe0979;
  --brand-facebook: #1877f2;
  --brand-archive: #9333ea;

  /* Typography */
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-gold: #fbbf24;

  /* Shadows & Glassmorphism */
  --glass-bg: rgba(20, 27, 45, 0.85);
  --glass-border: rgba(255, 255, 255, 0.08);
  --card-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.4), 0 8px 10px -6px rgba(0, 0, 0, 0.4);
  --glow-shadow: 0 0 20px rgba(59, 130, 246, 0.15);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ====================================================================
   Top Announcement Bar (Running Ticker & Fixed Center Badge)
   ==================================================================== */
.top-announcement-bar {
  position: relative;
  width: 100%;
  height: 40px;
  background: linear-gradient(90deg, #07090e 0%, #111728 50%, #07090e 100%);
  border-bottom: 1px solid rgba(245, 158, 11, 0.35);
  display: flex;
  align-items: center;
  overflow: hidden;
  z-index: 100;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.top-announcement-bar::before,
.top-announcement-bar::after {
  content: "";
  position: absolute;
  top: 0;
  width: 60px;
  height: 100%;
  z-index: 90;
  pointer-events: none;
}

.top-announcement-bar::before {
  left: 0;
  background: linear-gradient(to right, #07090e, transparent);
}

.top-announcement-bar::after {
  right: 0;
  background: linear-gradient(to left, #07090e, transparent);
}

/* Ticker Marquee Track (Berjalan Pelan & Halus) */
.ticker-track {
  display: flex;
  width: max-content;
  will-change: transform;
  animation: marqueeTrack 70s linear infinite;
}

.ticker-track:hover {
  animation-play-state: paused;
}

.ticker-content {
  display: flex;
  align-items: center;
  gap: 36px;
  padding-right: 36px;
  white-space: nowrap;
}

.ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  background: linear-gradient(90deg, #ffffff 0%, #fef08a 50%, #f59e0b 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.ticker-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #f59e0b;
  box-shadow: 0 0 8px #f59e0b;
}

@keyframes marqueeTrack {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

/* Fixed Center Badge (Tulisan Tetap di Tengah) */
.ticker-center-fixed {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 110;
  pointer-events: none;
}

.ticker-fixed-badge {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 18px;
  background: rgba(15, 20, 34, 0.95);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(245, 158, 11, 0.7);
  border-radius: var(--radius-full);
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.35), 0 2px 8px rgba(0, 0, 0, 0.8);
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.8px;
  color: #fbbf24;
  white-space: nowrap;
}

.badge-pulse-icon {
  width: 14px;
  height: 14px;
  color: #10b981;
  animation: pulseGlow 2s infinite ease-in-out;
}

@keyframes pulseGlow {
  0%, 100% {
    transform: scale(1);
    filter: drop-shadow(0 0 2px #10b981);
  }
  50% {
    transform: scale(1.15);
    filter: drop-shadow(0 0 6px #10b981);
  }
}

/* Authentic Platform SVG Icons */
.platform-svg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.platform-svg:hover {
  transform: scale(1.08);
}

.platform-svg.yt-svg svg {
  filter: drop-shadow(0 2px 6px rgba(255, 0, 0, 0.4));
}

.platform-svg.tiktok-svg svg {
  filter: drop-shadow(0 2px 6px rgba(0, 242, 254, 0.4));
}

.platform-svg.fb-svg svg {
  filter: drop-shadow(0 2px 6px rgba(24, 119, 242, 0.4));
}

/* Reset & Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Scrollbar Customization */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
  background: var(--border-light);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Layout */
.app-container {
  display: flex;
  min-height: calc(100vh - 40px);
}

/* Sidebar */
.sidebar {
  width: 280px;
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: var(--transition);
  z-index: 40;
}

.brand-section {
  padding: 24px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border-color);
}

.brand-logo {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 50%, #b45309 100%);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px var(--accent-gold-glow);
  color: #0f1422;
  font-weight: 800;
  font-size: 22px;
}

.brand-details h1 {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.5px;
  background: linear-gradient(90deg, #ffffff 0%, #fbbf24 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.2;
}

.brand-details span {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-secondary);
  font-weight: 600;
}

/* Sidebar Nav */
.sidebar-nav {
  padding: 16px 12px;
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.nav-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  padding: 0 12px 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition);
  cursor: pointer;
  border: 1px solid transparent;
}

.nav-item:hover {
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.nav-item.active {
  background-color: rgba(245, 158, 11, 0.12);
  color: var(--text-gold);
  border-color: rgba(245, 158, 11, 0.3);
  font-weight: 600;
}

.nav-item-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  background-color: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
}

.nav-item.active .nav-badge {
  background-color: var(--accent-gold);
  color: #0f1422;
}

/* Folder List in Sidebar */
.folder-nav-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.folder-nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 13.5px;
  font-weight: 500;
  transition: var(--transition);
  cursor: pointer;
  border: 1px solid transparent;
}

.folder-nav-item:hover {
  background-color: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
}

.folder-nav-item.active {
  background-color: rgba(59, 130, 246, 0.12);
  color: #60a5fa;
  border-color: rgba(59, 130, 246, 0.3);
}

.folder-tag-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.storage-status-card {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px;
}

.storage-header {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  margin-bottom: 6px;
}

.storage-progress {
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: 6px;
}

.storage-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-gold), #f59e0b);
  border-radius: var(--radius-full);
  transition: width 0.3s ease;
}

.storage-info {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
}

/* Main Content Area */
.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow-y: auto;
}

/* Top Header */
.top-header {
  height: 70px;
  background-color: rgba(15, 20, 34, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 30;
}

.header-search {
  position: relative;
  width: 360px;
}

.header-search input {
  width: 100%;
  padding: 10px 16px 10px 40px;
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  color: var(--text-primary);
  font-size: 13.5px;
  transition: var(--transition);
}

.header-search input:focus {
  outline: none;
  border-color: var(--accent-gold);
  box-shadow: 0 0 10px var(--accent-gold-glow);
}

.header-search .search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: var(--radius-md);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #0f1422;
  box-shadow: 0 4px 12px var(--accent-gold-glow);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px var(--accent-gold-glow);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border-color: var(--border-color);
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-light);
}

.btn-outline-gold {
  background: transparent;
  color: var(--accent-gold);
  border-color: rgba(245, 158, 11, 0.4);
}

.btn-outline-gold:hover {
  background: rgba(245, 158, 11, 0.1);
  border-color: var(--accent-gold);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: #ef4444;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: var(--radius-sm);
}

.btn-icon {
  width: 38px;
  height: 38px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
}

.btn-icon:hover {
  color: var(--text-primary);
  border-color: var(--text-muted);
}

.spin-animate {
  animation: spin 0.6s linear infinite;
}

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

/* Cloud Status Indicator */
.cloud-status-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  color: #34d399;
  cursor: pointer;
}

.cloud-status-badge.offline {
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.3);
  color: #fbbf24;
}

.status-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #10b981;
  box-shadow: 0 0 10px #10b981;
}

.cloud-status-badge.offline .status-pulse {
  background-color: #f59e0b;
  box-shadow: 0 0 10px #f59e0b;
}

/* Page Content */
.content-body {
  padding: 28px;
  flex: 1;
}

/* Banner: Lossless Guarantee */
.guarantee-banner {
  background: linear-gradient(135deg, rgba(20, 27, 45, 0.95) 0%, rgba(30, 41, 69, 0.8) 100%);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
  position: relative;
  overflow: hidden;
}

.guarantee-banner::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(to bottom, #f59e0b, #d97706);
}

.guarantee-content {
  display: flex;
  align-items: center;
  gap: 16px;
}

.guarantee-icon {
  width: 52px;
  height: 52px;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-gold);
  font-size: 24px;
  flex-shrink: 0;
}

.guarantee-text h2 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.guarantee-text p {
  font-size: 13px;
  color: var(--text-secondary);
  max-width: 650px;
}

/* Metric / Stats Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: var(--transition);
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-light);
  box-shadow: var(--card-shadow);
}

.stat-icon {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.stat-icon.gold {
  background: rgba(245, 158, 11, 0.12);
  color: var(--accent-gold);
}
.stat-icon.blue {
  background: rgba(59, 130, 246, 0.12);
  color: var(--accent-blue);
}
.stat-icon.emerald {
  background: rgba(16, 185, 129, 0.12);
  color: var(--accent-emerald);
}
.stat-icon.purple {
  background: rgba(147, 51, 234, 0.12);
  color: var(--accent-purple);
}

.stat-info .stat-value {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
}

.stat-info .stat-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Folder Strip / Category Cards */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.section-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
}

.folder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.folder-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 18px;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 130px;
}

.folder-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent-gold);
  box-shadow: 0 10px 20px -5px rgba(0, 0, 0, 0.3);
}

.folder-card.active {
  border-color: var(--accent-gold);
  background: linear-gradient(135deg, rgba(20, 27, 45, 1) 0%, rgba(35, 47, 78, 0.6) 100%);
  box-shadow: 0 0 15px var(--accent-gold-glow);
}

.folder-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 12px;
}

.folder-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  transition: var(--transition);
}

.folder-card-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  opacity: 0.8;
}

.folder-card-actions:hover {
  opacity: 1;
}

.folder-card-actions button {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: var(--transition);
}

.folder-card-actions button:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.1);
}

.folder-card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.folder-card-meta {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Controls Toolbar (Filter, Sort, View mode) */
.toolbar-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  gap: 16px;
  flex-wrap: wrap;
}

.toolbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.filter-badge-group {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  padding: 4px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
}

.filter-pill {
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: var(--transition);
}

.filter-pill:hover {
  color: var(--text-primary);
}

.filter-pill.active {
  background: var(--accent-gold);
  color: #0f1422;
}

.toolbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.custom-select {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 8px 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
  cursor: pointer;
  outline: none;
}

.view-toggle {
  display: flex;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 2px;
}

.view-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}

.view-btn.active {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

/* Video Grid View */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 20px;
}

.video-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  position: relative;
}

.video-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-light);
  box-shadow: var(--card-shadow);
}

.video-thumb-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background-color: #000;
  overflow: hidden;
  cursor: pointer;
}

.video-thumb-preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.play-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: var(--transition);
}

.video-thumb-wrapper:hover .play-overlay {
  opacity: 1;
}

.play-btn-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(245, 158, 11, 0.95);
  color: #0f1422;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.5);
  transform: scale(0.9);
  transition: transform 0.2s ease;
}

.video-thumb-wrapper:hover .play-btn-circle {
  transform: scale(1);
}

/* Resolution & Duration Badges on Thumbnail */
.res-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  backdrop-filter: blur(8px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.res-badge.res-4k {
  background: linear-gradient(135deg, #f59e0b 0%, #b45309 100%);
  color: #000;
}

.res-badge.res-1080p {
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  color: #fff;
}

.res-badge.res-720p {
  background: linear-gradient(135deg, #10b981 0%, #047857 100%);
  color: #fff;
}

.res-badge.res-sd {
  background: rgba(100, 116, 139, 0.85);
  color: #fff;
}

.duration-badge {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.video-card-body {
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.video-card-title {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.4;
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}

.video-card-title:hover {
  color: var(--accent-gold);
}

.video-card-folder {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.video-card-footer {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
}

.video-actions-dropdown {
  position: relative;
}

.action-menu-dropdown {
  position: absolute;
  right: 0;
  bottom: 30px;
  background-color: var(--bg-modal);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 6px 0;
  min-width: 160px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6);
  z-index: 50;
  display: none;
}

.action-menu-dropdown.show {
  display: block;
}

.action-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  font-size: 12.5px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
}

.action-menu-item:hover {
  background-color: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

.action-menu-item.danger {
  color: #f87171;
}

.action-menu-item.danger:hover {
  background-color: rgba(239, 68, 68, 0.15);
}

/* Video List View */
.video-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.video-list-row {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 18px;
  display: grid;
  grid-template-columns: 80px 2.5fr 1.2fr 1fr 1fr 100px;
  align-items: center;
  gap: 16px;
  transition: var(--transition);
}

.video-list-row:hover {
  background-color: var(--bg-card-hover);
  border-color: var(--border-light);
}

.video-list-thumb {
  width: 70px;
  height: 44px;
  border-radius: var(--radius-sm);
  background-color: #000;
  overflow: hidden;
  position: relative;
  cursor: pointer;
}

.video-list-thumb img,
.video-list-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  background-color: var(--bg-card);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-lg);
  margin-top: 20px;
}

.empty-icon {
  width: 64px;
  height: 64px;
  background: rgba(245, 158, 11, 0.1);
  color: var(--accent-gold);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  margin: 0 auto 16px;
}

.empty-state h3 {
  font-size: 18px;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.empty-state p {
  color: var(--text-muted);
  font-size: 13.5px;
  max-width: 440px;
  margin: 0 auto 20px;
}

/* Modals */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  padding: 20px;
}

.modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-box {
  background-color: var(--bg-modal);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 580px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
  overflow: hidden;
  transform: translateY(20px) scale(0.97);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-backdrop.active .modal-box {
  transform: translateY(0) scale(1);
}

.modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: var(--transition);
}

.modal-close-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.1);
}

.modal-body {
  padding: 24px;
  max-height: 75vh;
  overflow-y: auto;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  background-color: rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

/* Form Styles */
.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 13.5px;
  transition: var(--transition);
}

.form-control:focus {
  outline: none;
  border-color: var(--accent-gold);
  box-shadow: 0 0 10px var(--accent-gold-glow);
}

/* Upload Dropzone */
.dropzone-container {
  border: 2px dashed var(--border-light);
  border-radius: var(--radius-lg);
  padding: 36px 20px;
  text-align: center;
  background-color: rgba(0, 0, 0, 0.2);
  cursor: pointer;
  transition: var(--transition);
}

.dropzone-container:hover,
.dropzone-container.dragover {
  border-color: var(--accent-gold);
  background-color: rgba(245, 158, 11, 0.05);
}

.dropzone-icon {
  font-size: 42px;
  color: var(--accent-gold);
  margin-bottom: 12px;
}

.dropzone-text h4 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.dropzone-text p {
  font-size: 12.5px;
  color: var(--text-muted);
}

/* Video Player Modal (Cinema Mode) */
.cinema-modal-box {
  max-width: 960px;
  width: 95%;
  background-color: #0b0f19;
}

.cinema-video-container {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background-color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cinema-video-container video {
  width: 100%;
  height: 100%;
  max-height: 70vh;
}

.cinema-info-panel {
  padding: 20px 24px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  border-top: 1px solid var(--border-color);
}

.cinema-title-area h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
}

.cinema-specs-list {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.spec-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--text-secondary);
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 200;
}

.toast {
  padding: 12px 18px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 13.5px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  animation: slideInRight 0.3s ease forwards;
}

.toast.success {
  border-left: 4px solid var(--accent-emerald);
}

.toast.error {
  border-left: 4px solid var(--accent-red);
}

.toast.info {
  border-left: 4px solid var(--accent-blue);
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* ====================================================================
   Mobile & Cross-Platform Responsive Styles (Android, iOS & Windows/PC)
   ==================================================================== */

/* Mobile Sidebar Backdrop */
.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  z-index: 140;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.sidebar-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

/* Close Button on Mobile Drawer */
.sidebar-close-btn {
  display: none;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-size: 16px;
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  align-items: center;
  justify-content: center;
  margin-left: auto;
  transition: var(--transition);
}

.sidebar-close-btn:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border-color: #ef4444;
}

/* Mobile Hamburger Button */
.mobile-menu-btn {
  display: none;
  flex-shrink: 0;
}

/* Tablet & Mobile Screens (<= 992px) */
@media (max-width: 992px) {
  .mobile-menu-btn {
    display: inline-flex;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: -320px;
    width: 290px;
    height: 100vh;
    height: 100dvh; /* Dynamic viewport for iOS Safari address bar */
    z-index: 150;
    box-shadow: 15px 0 40px rgba(0, 0, 0, 0.8);
    transition: left 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .sidebar.open {
    left: 0;
  }

  .sidebar-close-btn {
    display: flex;
  }

  .top-header {
    padding: 0 16px;
  }

  .content-body {
    padding: 20px 16px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .folder-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .video-list-row {
    grid-template-columns: 60px 1.8fr 1fr 1fr;
  }
}

/* Smartphone Screens (Android & iOS) (<= 640px) */
@media (max-width: 640px) {
  /* Ticker Bar on Mobile */
  .top-announcement-bar {
    height: 34px;
  }

  .ticker-item {
    font-size: 11px;
    letter-spacing: 0.5px;
  }

  /* Header on Mobile */
  .top-header {
    height: 60px;
    padding: 0 12px;
    gap: 8px;
  }

  .header-search {
    max-width: 140px;
  }

  .header-search input {
    padding: 7px 12px 7px 32px;
    font-size: 12px;
  }

  .header-search .search-icon {
    left: 10px;
    width: 14px;
    height: 14px;
  }

  .header-actions {
    gap: 6px;
  }

  .header-actions .btn span {
    display: none; /* Icon-only on very narrow phones to save space */
  }

  .header-actions .btn {
    padding: 8px 12px;
  }

  .cloud-status-badge {
    padding: 5px 8px;
    font-size: 11px;
  }

  #cloudStatusText {
    display: none; /* Only status pulse icon on mobile header */
  }

  /* Content & Guarantee Banner on Mobile */
  .content-body {
    padding: 14px 12px;
  }

  .guarantee-banner {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 14px;
    margin-bottom: 20px;
  }

  .guarantee-content {
    gap: 12px;
  }

  .guarantee-icon {
    width: 42px;
    height: 42px;
    font-size: 20px;
  }

  .guarantee-text h2 {
    font-size: 14.5px;
  }

  .guarantee-text p {
    font-size: 12px;
    line-height: 1.45;
  }

  /* Stats Cards Mobile */
  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 20px;
  }

  .stat-card {
    padding: 12px 14px;
    gap: 10px;
  }

  .stat-icon {
    width: 38px;
    height: 38px;
    font-size: 16px;
  }

  .stat-info .stat-value {
    font-size: 17px;
  }

  .stat-info .stat-label {
    font-size: 10px;
  }

  /* Folder Grid Mobile */
  .folder-grid {
    grid-template-columns: 1fr;
    gap: 10px;
    margin-bottom: 24px;
  }

  .folder-card {
    padding: 14px;
    min-height: 100px;
  }

  /* Toolbar Controls */
  .toolbar-container {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .toolbar-left,
  .toolbar-right {
    width: 100%;
    justify-content: space-between;
  }

  .filter-badge-group {
    overflow-x: auto;
    max-width: 100%;
    padding: 4px;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
  }

  .filter-pill {
    flex-shrink: 0;
    font-size: 11.5px;
    padding: 5px 10px;
  }

  /* Video Grid Mobile (Full-width clean 16:9 cards) */
  .video-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .video-card-body {
    padding: 12px;
  }

  .video-card-title {
    font-size: 14px;
  }

  /* Modal Mobile (iOS & Android Touch-Friendly) */
  .modal-backdrop {
    padding: 10px;
    align-items: flex-end; /* Bottom sheet style on small mobile */
  }

  .modal-box {
    max-height: 90vh;
    max-height: 90dvh;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  }

  .modal-header {
    padding: 14px 18px;
  }

  .modal-body {
    padding: 16px 18px;
    max-height: 70vh;
    -webkit-overflow-scrolling: touch;
  }

  .modal-footer {
    padding: 12px 18px;
  }

  /* Prevent iOS automatic zoom on text input focus */
  .form-control,
  .custom-select {
    font-size: 16px !important;
  }

  /* Cinema Player Mobile */
  .cinema-modal-box {
    width: 100%;
    margin: 0;
    border-radius: var(--radius-md);
  }

  .cinema-info-panel {
    flex-direction: column;
    padding: 14px;
    gap: 14px;
  }

  .cinema-title-area h3 {
    font-size: 15px;
  }

  #btnDownloadOriginal {
    width: 100%;
    justify-content: center;
  }
}
