/* =========================================
   VidQR — Clean Professional Light Theme
   Gov-friendly: white bg, large type, clear UI
   ========================================= */

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

:root {
  /* Light professional palette */
  --bg-page: #f5f7fa;
  --bg-white: #ffffff;
  --bg-subtle: #f0f2f5;
  --bg-hover: #e8ebef;

  --border: #dde1e6;
  --border-focus: #4f7df9;

  --text-dark: #1a1d23;
  --text-body: #3a3f47;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;

  --accent: #4f7df9;
  --accent-hover: #3b65d9;
  --accent-light: #e8effe;
  --accent-text: #2a4fc7;

  --success: #16a34a;
  --success-light: #dcfce7;
  --danger: #dc2626;
  --danger-light: #fef2f2;
  --danger-hover: #b91c1c;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.1);

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --transition: 0.2s ease;
}

html {
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font);
  background: var(--bg-page);
  color: var(--text-body);
  min-height: 100vh;
  line-height: 1.6;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

/* ===== LANDING PAGE (keeps visual flair) ===== */

.bg-animation {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.bg-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.25;
  animation: float 20s ease-in-out infinite;
}

.bg-orb-1 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, #4f7df9, transparent 70%);
  top: -10%;
  left: -10%;
  animation-duration: 25s;
}

.bg-orb-2 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, #a78bfa, transparent 70%);
  bottom: -15%;
  right: -10%;
  animation-duration: 20s;
  animation-delay: -5s;
}

.bg-orb-3 {
  width: 350px;
  height: 350px;
  background: radial-gradient(circle, #38bdf8, transparent 70%);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation-duration: 30s;
  animation-delay: -10s;
  opacity: 0.15;
}

@keyframes float {

  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }

  25% {
    transform: translate(40px, -30px) scale(1.05);
  }

  50% {
    transform: translate(-20px, 40px) scale(0.95);
  }

  75% {
    transform: translate(30px, 20px) scale(1.02);
  }
}

/* ===== LAYOUT ===== */

.container {
  position: relative;
  z-index: 1;
  max-width: 580px;
  margin: 0 auto;
  padding: 48px 20px 60px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.container--wide {
  max-width: 960px;
}

/* ===== HEADER / LOGO ===== */

.header {
  text-align: center;
  margin-bottom: 40px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none !important;
  margin-bottom: 12px;
}

.logo-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--accent);
  font-size: 18px;
  color: white;
}

.logo-text {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-dark);
}

.logo-accent {
  color: var(--accent);
}

.tagline {
  color: var(--text-secondary);
  font-size: 16px;
}

/* ===== TOP BAR (Dashboard) ===== */

.topbar {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.topbar .logo {
  margin-bottom: 0;
}

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

.topbar-badge {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent-text);
  background: var(--accent-light);
  padding: 6px 14px;
  border-radius: 100px;
}

.topbar-profile {
  display: flex;
  align-items: center;
  gap: 8px;
}

.topbar-user-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.profile-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

.profile-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-body);
}

/* ===== CARDS ===== */

.card {
  width: 100%;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
}

/* ===== SECTION TITLES ===== */

.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 16px;
}

.section-title svg {
  color: var(--accent);
  flex-shrink: 0;
}

.section-desc {
  color: var(--text-secondary);
  font-size: 15px;
}

/* ===== UPLOAD ROW (Dashboard) ===== */

.upload-card-dash {
  position: relative;
  background: var(--accent-light);
  border-color: transparent;
}

.upload-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.upload-row-left {
  flex: 1;
  min-width: 200px;
}

.upload-row-left .section-title {
  margin-bottom: 4px;
  color: var(--accent-text);
}

.upload-row-left .section-desc {
  color: var(--text-secondary);
}

/* Drop overlay */
.drop-overlay {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 10;
  border-radius: var(--radius);
  background: rgba(79, 125, 249, 0.06);
  border: 3px dashed var(--accent);
  align-items: center;
  justify-content: center;
}

.drop-overlay.active {
  display: flex;
}

.drop-overlay-content {
  text-align: center;
  color: var(--accent);
}

.drop-overlay-content p {
  margin-top: 12px;
  font-size: 18px;
  font-weight: 600;
}

/* ===== DROP ZONE (landing/upload page style) ===== */

.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 56px 24px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
}

.drop-zone:hover,
.drop-zone.drag-over {
  border-color: var(--accent);
  background: var(--accent-light);
}

.drop-zone-content {
  position: relative;
}

.upload-icon {
  color: var(--text-muted);
  margin-bottom: 16px;
}

.drop-zone:hover .upload-icon {
  color: var(--accent);
}

.drop-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 6px;
}

.drop-subtitle {
  color: var(--text-secondary);
  font-size: 16px;
  margin-bottom: 14px;
}

.drop-hint {
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ===== PROGRESS ===== */

.progress-container {
  margin-top: 20px;
}

.progress-info {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
}

.progress-filename {
  font-size: 14px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 70%;
}

.progress-percent {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--bg-subtle);
  border-radius: 100px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: 100px;
  transition: width 0.3s ease;
}

.progress-status {
  margin-top: 6px;
  font-size: 14px;
  color: var(--text-muted);
  text-align: center;
}

/* ===== BUTTONS ===== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 15px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none !important;
  white-space: nowrap;
}

.btn-lg {
  padding: 16px 32px;
  font-size: 17px;
  border-radius: var(--radius);
}

.btn-sm {
  padding: 8px 14px;
  font-size: 13px;
  border-radius: 6px;
}

.btn-full {
  width: 100%;
}

.btn-primary {
  background: var(--accent);
  color: white;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-secondary {
  background: var(--bg-subtle);
  color: var(--text-body);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--bg-hover);
}

.btn-danger {
  background: var(--danger-light);
  color: var(--danger);
  border: 1px solid transparent;
}

.btn-danger:hover {
  background: #fee2e2;
  color: var(--danger-hover);
}

.btn-copy {
  background: var(--bg-subtle);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  padding: 12px 16px;
}

.btn-copy:hover {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--accent);
}

.btn-copy.copied {
  background: var(--success-light);
  border-color: var(--success);
  color: var(--success);
}

/* ===== RESULT SECTION (Upload page) ===== */

.result-card {
  margin-bottom: 20px;
}

.result-header {
  text-align: center;
  margin-bottom: 24px;
}

.success-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--success-light);
  color: var(--success);
  margin-bottom: 16px;
}

.result-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 4px;
}

.result-subtitle {
  color: var(--text-secondary);
  font-size: 15px;
}

.result-actions {
  display: flex;
  gap: 12px;
}

.result-actions .btn {
  flex: 1;
}

/* ===== QR CODE ===== */

.qr-wrapper {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

.qr-container {
  background: white;
  border-radius: var(--radius);
  padding: 16px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.qr-container canvas,
.qr-container img {
  display: block;
  width: 200px !important;
  height: 200px !important;
}

/* URL box */
.result-url-box {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.url-input {
  flex: 1;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-family: var(--font);
  font-size: 14px;
  color: var(--text-dark);
  outline: none;
}

.url-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79, 125, 249, 0.12);
}

/* ===== VIDEO LIST (Dashboard) ===== */

.video-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.vitem {
  display: flex;
  align-items: stretch;
  gap: 20px;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  transition: box-shadow var(--transition);
}

.vitem:hover {
  box-shadow: var(--shadow-md);
}

.vitem-left {
  flex: 1;
  display: flex;
  gap: 16px;
  min-width: 0;
}

.vitem-preview {
  position: relative;
  width: 130px;
  min-width: 130px;
  height: 85px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #f0f0f0;
  cursor: pointer;
  flex-shrink: 0;
}

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

.vitem-play-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.35);
  color: white;
  transition: opacity var(--transition);
}

.vitem-preview.playing .vitem-play-overlay {
  opacity: 0;
}

.vitem-preview:hover .vitem-play-overlay {
  opacity: 0.9;
}

.vitem-details {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.vitem-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}

.vitem-meta {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.vitem-buttons {
  display: flex;
  gap: 6px;
}

/* Inline QR code — right side */
.vitem-qr {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  flex-shrink: 0;
  padding: 4px;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
}

.vitem-qr:hover {
  background: var(--bg-subtle);
}

.vitem-qr-canvas {
  display: block;
  width: 100px !important;
  height: 100px !important;
  border-radius: 6px;
}

.vitem-qr-hint {
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
}

.vitem-qr:hover .vitem-qr-hint {
  color: var(--accent);
}

/* ===== QR ENLARGED OVERLAY ===== */

.qr-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.qr-overlay-card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  max-width: 420px;
  width: 100%;
  position: relative;
  box-shadow: var(--shadow-lg);
}

.qr-overlay-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 4px;
  padding-right: 36px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.qr-overlay-sub {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 20px;
}

.qr-container--large canvas,
.qr-container--large img {
  width: 260px !important;
  height: 260px !important;
}

/* ===== EMPTY STATE ===== */

.empty-state {
  text-align: center;
  padding: 48px 24px;
}

.empty-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.empty-state h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 6px;
}

.empty-state p {
  color: var(--text-secondary);
  font-size: 15px;
}

/* ===== MODAL CLOSE ===== */

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.modal-close:hover {
  background: var(--bg-hover);
  color: var(--text-dark);
}

/* ===== LOGIN PAGE ===== */

.login-card {
  max-width: 400px;
  margin: 0 auto;
}

.login-header {
  text-align: center;
  margin-bottom: 28px;
}

.login-icon-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--accent-light);
  color: var(--accent);
  margin-bottom: 16px;
}

.login-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 6px;
}

.login-subtitle {
  color: var(--text-secondary);
  font-size: 15px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-body);
}

.form-input {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-family: var(--font);
  font-size: 16px;
  color: var(--text-dark);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.form-input::placeholder {
  color: var(--text-muted);
}

.form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79, 125, 249, 0.12);
}

.login-error {
  text-align: center;
  color: var(--danger);
  font-size: 14px;
  font-weight: 500;
  padding: 10px;
  background: var(--danger-light);
  border-radius: var(--radius-sm);
  border: 1px solid #fecaca;
}

/* ===== WATCH PAGE ===== */

.header--watch {
  margin-bottom: 20px;
}

.watch-card {
  padding: 0;
  overflow: hidden;
}

.video-wrapper {
  width: 100%;
  background: #000;
  border-radius: var(--radius) var(--radius) 0 0;
}

.video-wrapper video {
  display: block;
  width: 100%;
  max-height: 70vh;
  outline: none;
}

.video-info {
  padding: 16px 20px;
}

.video-name {
  font-size: 14px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.watch-actions {
  padding: 0 20px 20px;
}

.watch-actions .btn {
  width: 100%;
}

/* ===== LOADER ===== */

.loader {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 48px;
}

.loader-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--bg-subtle);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin-bottom: 12px;
}

.loader-text {
  color: var(--text-secondary);
  font-size: 14px;
}

/* ===== ERROR STATE ===== */

.error-content {
  text-align: center;
  padding: 48px 32px;
}

.error-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--danger-light);
  color: var(--danger);
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 12px;
}

.error-content h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 6px;
}

.error-content p {
  color: var(--text-secondary);
  font-size: 15px;
  margin-bottom: 20px;
}

/* ===== FOOTER ===== */

.footer {
  margin-top: auto;
  padding-top: 32px;
  text-align: center;
  width: 100%;
}

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

/* ===== TOAST ===== */

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--text-dark);
  color: white;
  border-radius: var(--radius-sm);
  padding: 12px 24px;
  font-family: var(--font);
  font-size: 14px;
  box-shadow: var(--shadow-lg);
  z-index: 2000;
  transition: transform 0.3s ease;
  pointer-events: none;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}

/* ===== ANIMATIONS (minimal) ===== */

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

/* ===== RESPONSIVE ===== */

@media (max-width: 768px) {
  .vitem {
    flex-direction: column;
  }

  .vitem-left {
    flex-direction: column;
  }

  .vitem-preview {
    width: 100%;
    height: 160px;
  }

  .vitem-qr {
    flex-direction: row;
    gap: 12px;
    padding: 12px;
    background: var(--bg-subtle);
    border-radius: var(--radius-sm);
  }

  .vitem-qr-canvas {
    width: 80px !important;
    height: 80px !important;
  }

  .vitem-buttons .btn {
    flex: 1;
  }

  .upload-row {
    flex-direction: column;
    align-items: stretch;
  }

  .topbar {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }

  .qr-overlay-card {
    padding: 24px;
  }
}

@media (max-width: 640px) {
  .container {
    padding: 20px 16px 40px;
  }

  .card {
    padding: 20px;
  }

  .logo-text {
    font-size: 24px;
  }

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

  .result-actions {
    flex-direction: column;
  }

  .qr-container canvas,
  .qr-container img {
    width: 160px !important;
    height: 160px !important;
  }
}