/* =====================================================
   PDF MERGE - ENTERPRISE HIGH CONTRAST & RESPONSIVE UI
   AV Technologies
===================================================== */

:root {
  --bg-main: #0a0f1d;
  --bg-section: #0f172a;
  --card-bg: rgba(17, 24, 39, 0.85);
  --border-soft: rgba(255, 255, 255, 0.16);
  --border-hover: rgba(99, 102, 241, 0.65);

  --primary: #4f46e5;
  --primary-hover: #818cf8;
  --primary-glow: rgba(79, 70, 229, 0.45);

  --text-main: #f8fafc;
  --text-muted: #cbd5e1;
  --text-dim: #94a3b8;
  --text-subtle: #e2e8f0;
}

/* =====================================================
   WCAG AAA HIGH CONTRAST & ACCESSIBILITY OVERRIDES
===================================================== */
.text-muted,
.text-secondary,
.text-body-secondary {
  color: #cbd5e1 !important; /* Slate 300 - High contrast 13.8:1 */
}

small.text-muted,
span.text-muted,
p.text-muted,
div.text-muted {
  color: #cbd5e1 !important;
}

.text-dim {
  color: #94a3b8 !important;
}

.text-primary {
  color: #818cf8 !important;
}

.text-danger {
  color: #f87171 !important;
}

.text-success {
  color: #34d399 !important;
}

.text-info {
  color: #38bdf8 !important;
}

.text-warning {
  color: #fbbf24 !important;
}

.text-light {
  color: #f8fafc !important;
}

.text-white {
  color: #ffffff !important;
}

/* Subtle Badges */
.bg-danger-subtle {
  background-color: rgba(239, 68, 68, 0.18) !important;
  color: #fca5a5 !important;
}

.border-danger-subtle {
  border-color: rgba(248, 113, 113, 0.45) !important;
}

.bg-primary-subtle {
  background-color: rgba(99, 102, 241, 0.18) !important;
  color: #a5b4fc !important;
}

.border-primary-subtle {
  border-color: rgba(129, 140, 248, 0.45) !important;
}

/* Outline Buttons High Contrast */
.btn-outline-danger {
  border-color: #f87171 !important;
  color: #f87171 !important;
}

.btn-outline-danger:hover {
  background-color: #ef4444 !important;
  border-color: #ef4444 !important;
  color: #ffffff !important;
}

.btn-outline-primary {
  border-color: #818cf8 !important;
  color: #818cf8 !important;
}

.btn-outline-primary:hover {
  background-color: #4f46e5 !important;
  border-color: #4f46e5 !important;
  color: #ffffff !important;
}

html, body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: #0a0f1d !important;
  background-image:
    radial-gradient(circle at 15% 20%, rgba(239, 68, 68, 0.18), transparent 40%),
    radial-gradient(circle at 85% 80%, rgba(79, 70, 229, 0.18), transparent 40%),
    linear-gradient(145deg, #0a0f1d 0%, #0f172a 100%) !important;
  background-attachment: fixed !important;
  color: #f8fafc !important;
  min-height: 100vh;
  margin: 0;
  padding: 0;
}

.nav-spacer {
  height: 76px;
}

/* Glass Navbar */
.glass-nav {
  background: rgba(10, 15, 29, 0.95) !important;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-soft);
  box-shadow: 0 4px 25px rgba(0, 0, 0, 0.5);
  z-index: 1050 !important;
  padding: 14px 0;
}

.glass-nav .navbar-brand {
  color: #ffffff !important;
  font-size: 1.25rem;
}

.glass-nav .nav-link {
  color: var(--text-muted) !important;
  font-weight: 500;
  transition: color 0.2s;
}

.glass-nav .nav-link:hover {
  color: #ffffff !important;
}

/* Glass Card */
.glass-card {
  background: var(--card-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-soft);
  border-radius: 20px;
  padding: 36px 30px;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.45);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-card:hover {
  border-color: var(--border-hover);
}

.section-title {
  font-size: clamp(1.6rem, 3.2vw, 2.3rem);
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.5px;
}

/* Drop Zone */
.drop-zone {
  border: 2px dashed rgba(255, 255, 255, 0.25);
  border-radius: 16px;
  padding: 40px 20px;
  text-align: center;
  background: rgba(255, 255, 255, 0.02);
  cursor: pointer;
  position: relative;
  transition: all 0.3s ease;
}

.drop-zone:hover,
.drop-zone.drag-over {
  background: rgba(239, 68, 68, 0.08);
  border-color: #f87171;
  transform: scale(1.01);
}

.drop-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

/* Sortable File List */
.sortable-list .list-group-item {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid var(--border-soft);
  color: #f8fafc;
  margin-bottom: 8px;
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 0.92rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.2s;
}

.sortable-list .list-group-item:hover {
  background: rgba(30, 41, 59, 0.95);
  border-color: rgba(99, 102, 241, 0.4);
}

.sortable-ghost {
  opacity: 0.4;
  background: rgba(79, 70, 229, 0.2) !important;
}

/* Glow Button */
.btn-glow {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  border: none;
  color: #ffffff !important;
  font-weight: 600;
  padding: 14px 28px;
  border-radius: 12px;
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.45);
  transition: all 0.25s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.btn-glow:hover {
  background: linear-gradient(135deg, #f87171, #ef4444);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(239, 68, 68, 0.65);
}

/* Progress */
.progress-container .progress {
  height: 10px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  overflow: hidden;
}

.progress-bar {
  background: linear-gradient(90deg, #10b981, #059669);
  transition: width 0.4s ease;
}

/* Error Overlay */
.error-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  padding: 20px;
}

.error-box {
  background: #0f172a;
  padding: 32px;
  border-radius: 18px;
  text-align: center;
  max-width: 420px;
  width: 100%;
  border: 1px solid var(--border-soft);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
}

.error-box h5 {
  color: #ef4444;
  font-weight: 700;
}

.error-box p {
  color: var(--text-muted);
}

/* Footer High Contrast */
footer.footer {
  margin-top: auto;
  background: #070b14;
  border-top: 1px solid var(--border-soft);
  padding: 24px 0;
  color: #94a3b8 !important;
}

footer.footer small,
footer.footer .text-muted,
footer.footer span {
  color: #94a3b8 !important;
}

footer.footer a {
  color: #cbd5e1 !important;
  transition: all 0.2s ease;
}

footer.footer a:hover {
  color: #ffffff !important;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.4);
}

/* PWA UI Components */
.pwa-install-btn {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff !important;
  border: none;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 6px 14px;
  display: none;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.35);
  transition: all 0.2s;
}

.pwa-install-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5);
  color: #ffffff !important;
}

.pwa-offline-badge {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(220, 38, 38, 0.95);
  color: #ffffff;
  padding: 10px 20px;
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
  z-index: 99999;
  display: flex;
  align-items: center;
  animation: pwaSlideUp 0.3s ease;
}

/* Responsive Breakpoints */
@media (max-width: 991px) {
  html, body {
    height: auto !important;
    overflow-y: auto !important;
  }

  section.py-5 {
    padding-bottom: calc(90px + env(safe-area-inset-bottom, 24px)) !important;
  }

  footer.footer {
    padding-bottom: calc(40px + env(safe-area-inset-bottom, 20px)) !important;
  }
}

@media (max-width: 576px) {
  .glass-card {
    padding: 24px 16px;
  }

  .drop-zone {
    padding: 30px 14px;
  }
}
