/* ============================================================
   QuickShare — White + Blue Gradient Glassmorphism Theme
   ============================================================ */

:root {
  --qs-blue: #2563eb;
  --qs-blue-dark: #1d4ed8;
  --qs-cyan: #06b6d4;
  --qs-gradient: linear-gradient(135deg, #2563eb 0%, #06b6d4 100%);
  --qs-bg: #f5f9ff;
  --qs-surface: rgba(255, 255, 255, 0.7);
  --qs-border: rgba(37, 99, 235, 0.12);
  --qs-text: #101828;
  --qs-text-secondary: #64748b;
  --qs-shadow: 0 10px 35px rgba(37, 99, 235, 0.12);
  --qs-radius: 22px;
}

* { box-sizing: border-box; }

body {
  font-family: 'Poppins', system-ui, -apple-system, sans-serif;
  color: var(--qs-text);
  min-height: 100vh;
  background: var(--qs-bg);
  background-image:
    radial-gradient(circle at 8% 15%, rgba(37,99,235,0.14), transparent 42%),
    radial-gradient(circle at 92% 10%, rgba(6,182,212,0.14), transparent 42%),
    radial-gradient(circle at 50% 100%, rgba(37,99,235,0.08), transparent 50%);
  background-attachment: fixed;
}

/* ---------- Header ---------- */
.qs-header {
  background: var(--qs-surface);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--qs-border);
}
.qs-logo {
  width: 42px; height: 42px;
  border-radius: 12px;
  background: var(--qs-gradient);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 1.4rem;
}
.qs-brand { font-weight: 800; font-size: 1.25rem; color: var(--qs-text); letter-spacing: -0.01em; }

/* Two-tone wordmark: base name in the page text color, a trailing
   domain-style suffix (".in", ".io"...) rendered in the brand gradient so
   it reads like a deliberate product mark rather than plain text. */
.qs-brand-main { color: inherit; }
.qs-brand-accent {
  background: var(--qs-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--qs-blue);
}
/* On the login screen's gradient-filled brand panel, a gradient-clipped
   accent would vanish against the matching background — use soft white instead. */
.qs-auth-brand .qs-brand-accent {
  background: none;
  -webkit-text-fill-color: rgba(255, 255, 255, 0.72);
  color: rgba(255, 255, 255, 0.72);
}
.qs-brand-lg { font-size: 1.9rem; letter-spacing: -0.02em; }

/* ---------- Header (compact) ---------- */
.qs-header .container { padding-top: .5rem !important; padding-bottom: .5rem !important; }
.qs-logo { width: 36px; height: 36px; font-size: 1.15rem; }
.qs-brand { font-size: 1.05rem; }

/* ---------- Header zones (Admin -> Website Branding / Header Alignment) ---------- */
.qs-header-container { position: relative; }
.qs-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  flex-wrap: wrap;
  padding-right: 3rem; /* room for the mobile hamburger toggle */
}
@media (min-width: 992px) {
  .qs-header-row { padding-right: 0; }
}
.qs-header-zone {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  min-width: 0;
}
.qs-header-zone-left { justify-content: flex-start; }
.qs-header-zone-center { flex: 1 1 auto; justify-content: center; }
.qs-header-zone-right { justify-content: flex-end; }
.qs-header-zone:empty { display: none; }

/* ---------- Mobile menu toggle (hamburger) ---------- */
.qs-menu-toggle {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 40px; height: 40px;
  border-radius: 10px;
  border: 1px solid var(--qs-border);
  background: var(--qs-surface);
  color: var(--qs-text);
  font-size: 1.3rem;
  display: flex; align-items: center; justify-content: center;
}
.qs-menu-toggle:hover { color: var(--qs-blue); }

/* ---------- Mobile slide-down menu panel ---------- */
.qs-mobile-menu-panel { border-top: 1px solid var(--qs-border); }
.qs-menu-mobile { list-style: none; padding: 0; margin: 0; }
.qs-menu-item-mobile { border-bottom: 1px solid var(--qs-border); }
.qs-menu-item-mobile:last-child { border-bottom: none; }
.qs-menu-link-mobile {
  display: block;
  padding: .65rem .1rem;
  color: var(--qs-text);
  font-weight: 600;
  text-decoration: none;
}
.qs-menu-link-mobile:hover { color: var(--qs-blue); }
.qs-submenu-mobile { list-style: none; padding-left: 1rem; margin: 0 0 .5rem; }
.qs-menu-link-mobile-sub { font-weight: 500; padding: .5rem .1rem; color: var(--qs-text-secondary); }

/* ---------- Dynamic header menu (Admin -> Header Menu Manager) ---------- */
.qs-menu { list-style: none; padding: 0; }
.qs-menu .nav-link {
  color: var(--qs-text);
  font-weight: 600;
  font-size: .92rem;
  padding: .4rem .2rem;
}
.qs-menu .nav-link:hover,
.qs-menu .nav-link:focus { color: var(--qs-blue); }
.qs-menu .dropdown-menu {
  border-radius: 14px;
  border: 1px solid var(--qs-border);
  box-shadow: var(--qs-shadow);
}
.qs-menu .dropdown-item:hover,
.qs-menu .dropdown-item:focus { background: var(--qs-bg); color: var(--qs-blue); }

/* ---------- Site-wide notification bar (Admin -> Content & Notifications) ---------- */
.qs-notification-bar {
  background: var(--qs-gradient);
  color: #fff;
}
.qs-notification-bar .btn-close { filter: invert(1) grayscale(100%) brightness(200%); opacity: .85; }

/* ---------- Main section spacing (single-view fit) ---------- */
.qs-main-section { margin-top: .75rem; margin-bottom: .75rem; }

/* ---------- Features Banner (below header, admin-managed) ---------- */
.qs-features-banner-wrap { margin-top: .75rem; }
.qs-ad-banner.qs-features-banner {
  height: 150px;
  min-height: 150px;
  max-height: 150px;
  padding: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.qs-features-banner img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  border-radius: var(--qs-radius);
  display: block;
}
/* AdSense/HTML code slots vary in what they render — keep them boxed to the same 150px area */
.qs-features-banner > *:not(img):not(a) { max-height: 150px; overflow: hidden; }
.qs-features-banner a { display: block; width: 100%; height: 150px; }

/* ---------- Stacked action cards (Send above Receive, no tabs) ---------- */
.qs-action-card {
  background: var(--qs-surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--qs-border);
  border-radius: var(--qs-radius);
  box-shadow: var(--qs-shadow);
  padding: 16px 18px;
}
.qs-action-card h2 {
  font-weight: 800;
  font-size: 1.05rem;
  margin-bottom: 10px;
}

/* ---------- Glass Card ---------- */
.glass-card {
  background: var(--qs-surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--qs-border);
  border-radius: var(--qs-radius);
  box-shadow: var(--qs-shadow);
  transition: transform .25s ease, box-shadow .25s ease;
}

/* ---------- Center Panel Tabs ---------- */
.qs-center-panel {
  background: var(--qs-surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--qs-border);
  border-radius: var(--qs-radius);
  box-shadow: var(--qs-shadow);
  overflow: hidden;
}
.qs-tabs {
  display: flex;
  background: rgba(37, 99, 235, 0.06);
}
.qs-tab-btn {
  flex: 1;
  border: none;
  background: transparent;
  padding: 18px 12px;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--qs-text-secondary);
  cursor: pointer;
  transition: all .25s ease;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.qs-tab-btn.active {
  background: var(--qs-gradient);
  color: #fff;
}
.qs-tab-content { padding: 32px 28px; }
.qs-tab-pane.d-none { display: none; }

/* ---------- Dropzone (compact) ---------- */
.dropzone {
  border: 2px dashed rgba(37, 99, 235, 0.35);
  border-radius: 14px;
  padding: 18px 14px;
  text-align: center;
  cursor: pointer;
  transition: all .25s ease;
  background: rgba(37, 99, 235, 0.03);
}
.dropzone.dragover {
  border-color: var(--qs-blue);
  background: rgba(37, 99, 235, 0.08);
  transform: scale(1.01);
}
.dropzone i {
  font-size: 1.8rem;
  background: var(--qs-gradient);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ---------- Buttons ---------- */
.qs-btn-gradient {
  background: var(--qs-gradient);
  color: #fff !important;
  border: none;
  font-weight: 600;
  transition: transform .2s ease, box-shadow .2s ease;
}
.qs-btn-gradient:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(37,99,235,0.35); color: #fff; }
.btn-primary { background: var(--qs-gradient); border: none; }
.btn-primary:hover { filter: brightness(1.08); }

/* ---------- Code display ---------- */
.download-code-box {
  font-size: 1.4rem;
  letter-spacing: 0.25rem;
  font-weight: 800;
  background: var(--qs-gradient);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  word-break: break-all;
}

/* ---------- Progress ---------- */
.upload-progress { height: 10px; border-radius: 10px; overflow: hidden; }

/* ---------- Ad Panels ---------- */
.qs-ad-panel {
  background: var(--qs-surface);
  border: 1px dashed var(--qs-border);
  border-radius: var(--qs-radius);
  min-height: 140px;
  display: flex; align-items: center; justify-content: center;
  color: var(--qs-text-secondary);
  font-size: .85rem;
  overflow: hidden;
  padding: 10px;
}
.qs-ad-banner {
  background: var(--qs-surface);
  border: 1px dashed var(--qs-border);
  border-radius: var(--qs-radius);
  min-height: 60px;
  display: flex; align-items: center; justify-content: center;
  color: var(--qs-text-secondary);
  font-size: .85rem;
  overflow: hidden;
  padding: 8px;
}
.qs-ad-panel:empty::before,
.qs-ad-panel.qs-ad-empty::after { content: 'Ad Space'; }

/* ---------- Animations ---------- */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
.animate-in { animation: fadeInUp .55s ease both; }

/* ---------- Footer ---------- */
.qs-footer {
  background: var(--qs-surface);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--qs-border);
}
.qs-footer-link { color: var(--qs-text-secondary); text-decoration: none; }
.qs-footer-link:hover { color: var(--qs-blue); }

/* ---------- Admin layout (responsive: desktop = fixed sidebar, mobile/tablet = off-canvas) ---------- */
.admin-shell {
  display: flex;
  min-height: 100vh;
  background: var(--qs-bg);
}
.admin-sidebar {
  width: 260px;
  min-width: 260px;
  min-height: 100vh;
  background: var(--qs-surface);
  backdrop-filter: blur(16px);
  border-right: 1px solid var(--qs-border);
  position: sticky;
  top: 0;
  align-self: flex-start;
  height: 100vh;
  overflow-y: auto;
  z-index: 1040;
  transition: transform 0.25s ease;
}
.admin-content {
  flex: 1 1 0%;
  min-width: 0; /* allow tables/charts to shrink instead of overflowing */
}
.admin-sidebar .nav-link {
  color: var(--qs-text-secondary);
  border-radius: 12px;
  padding: 10px 14px;
  margin-bottom: 4px;
  font-weight: 500;
}
.admin-sidebar .nav-link.active,
.admin-sidebar .nav-link:hover {
  background: var(--qs-gradient);
  color: #fff;
}
.admin-sidebar-toggle {
  border: 1px solid var(--qs-border);
  background: var(--qs-surface);
  color: var(--qs-text);
  border-radius: 10px;
  width: 40px;
  height: 40px;
  font-size: 1.2rem;
  flex: 0 0 auto;
}
.admin-sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(16, 24, 40, 0.45);
  z-index: 1035;
}
@media (max-width: 991.98px) {
  .admin-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    transform: translateX(-100%);
    box-shadow: 0 25px 60px rgba(16, 24, 40, 0.25);
  }
  .admin-sidebar.show { transform: translateX(0); }
  .admin-sidebar-backdrop.show { display: block; }
}

/* ---------- Dashboard stat cards ---------- */
.stat-card {
  border-radius: var(--qs-radius);
  padding: 1.35rem 1.5rem;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.stat-card .stat-icon {
  flex: 0 0 auto;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  color: #fff;
  background: var(--qs-gradient);
}
.stat-card .stat-number { font-size: 1.7rem; font-weight: 800; color: var(--qs-text); line-height: 1.15; }
.stat-card .stat-label { color: var(--qs-text-secondary); font-size: 0.86rem; font-weight: 500; }
.stat-card.stat-warning .stat-icon { background: linear-gradient(135deg, #f59e0b 0%, #f97316 100%); }
.stat-card.stat-danger .stat-icon { background: linear-gradient(135deg, #ef4444 0%, #f43f5e 100%); }
.stat-card.stat-green .stat-icon { background: linear-gradient(135deg, #10b981 0%, #06b6d4 100%); }
.stat-card.stat-purple .stat-icon { background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%); }

/* ---------- Dashboard chart / widget cards ---------- */
.chart-card { border-radius: var(--qs-radius); }
.chart-card canvas { max-width: 100%; }
/* Chart.js with maintainAspectRatio:false needs an ancestor with a real,
   non-content-derived height to resize against — otherwise on mobile,
   where columns stack and no longer share a row height, the canvas
   collapses or grows unbounded. This wrapper supplies that height. */
.chart-wrap { position: relative; width: 100%; height: 280px; }
@media (max-width: 575.98px) {
  .chart-wrap { height: 220px; }
}
.chart-legend-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin-right: 6px; }
.activity-empty { color: var(--qs-text-secondary); text-align: center; padding: 2rem 0.5rem; }
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}
.status-pill.pill-active { background: rgba(16,185,129,0.12); color: #067647; }
.status-pill.pill-downloading { background: rgba(245,158,11,0.14); color: #b45309; }
.status-pill.pill-expired { background: rgba(239,68,68,0.12); color: #b91c1c; }

@media (max-width: 575.98px) {
  .stat-card { padding: 1.1rem 1.2rem; }
  .stat-card .stat-number { font-size: 1.4rem; }
}

/* ---------- Responsive layout: Ad | Main | Ad -> stacked ---------- */
@media (max-width: 991.98px) {
  .qs-ad-panel { min-height: 120px; }
}
@media (max-width: 575.98px) {
  .download-code-box { font-size: 1.4rem; letter-spacing: 0.2rem; }
  .qs-tab-content { padding: 22px 16px; }
}

/* ============================================================
   Admin / Auth pages — attractive split-screen login
   ============================================================ */
.qs-auth-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--qs-bg);
  background-image:
    radial-gradient(circle at 8% 15%, rgba(37,99,235,0.14), transparent 42%),
    radial-gradient(circle at 92% 10%, rgba(6,182,212,0.14), transparent 42%),
    radial-gradient(circle at 50% 100%, rgba(37,99,235,0.08), transparent 50%);
}

.qs-auth-wrap { width: 100%; max-width: 920px; }

.qs-auth-shell {
  display: flex;
  min-height: 560px;
  background: var(--qs-surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--qs-border);
  border-radius: 28px;
  box-shadow: 0 25px 60px rgba(37, 99, 235, 0.18);
  overflow: hidden;
}

.qs-auth-brand {
  position: relative;
  flex: 0 0 42%;
  background: var(--qs-gradient);
  padding: 48px 40px;
  display: flex;
  align-items: center;
  overflow: hidden;
}
.qs-auth-brand-content { position: relative; z-index: 2; }
.qs-auth-points li { margin-bottom: 10px; display: flex; align-items: center; }

.qs-auth-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(10px);
  opacity: .35;
}
.qs-blob-1 { width: 260px; height: 260px; background: #ffffff; top: -80px; right: -80px; }
.qs-blob-2 { width: 200px; height: 200px; background: #0f172a; bottom: -70px; left: -60px; opacity: .18; }

.qs-logo-lg { width: 56px; height: 56px; font-size: 1.6rem; background: rgba(255,255,255,0.18); }

.qs-auth-form-panel {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  background: rgba(255,255,255,0.55);
}
.qs-auth-form-inner { width: 100%; max-width: 340px; }

.qs-input-icon-group {
  position: relative;
  display: flex;
  align-items: center;
}
.qs-input-icon-group > i:first-child {
  position: absolute;
  left: 14px;
  color: var(--qs-text-secondary);
  font-size: .95rem;
  pointer-events: none;
}
.qs-input-icon-group .form-control {
  padding-left: 40px;
  padding-right: 40px;
}
.qs-input-toggle {
  position: absolute;
  right: 10px;
  border: none;
  background: transparent;
  color: var(--qs-text-secondary);
  padding: 4px;
}
.qs-input-toggle:hover { color: var(--qs-blue); }

@media (max-width: 767.98px) {
  .qs-auth-shell { flex-direction: column; min-height: auto; }
  .qs-auth-brand { display: none; }
  .qs-auth-form-panel { padding: 32px 24px; }
}
