/* ==========================================================================
   iLovePDF Style PDF Merge Studio Stylesheet
   Sumit Chauhan Branding & Responsive Layout
   ========================================================================== */

:root {
  --ilove-red: #e5322d;
  --ilove-red-hover: #cb1c17;
  --ilove-red-active: #b11612;
  --ilove-gray-bg: #f4f5f8;
  --ilove-card-bg: #ffffff;
  --ilove-border: #e2e8f0;
  --ilove-text-main: #1a1a1a;
  --ilove-text-muted: #64748b;
  --ilove-sidebar-bg: #ffffff;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-heading: 'Montserrat', sans-serif;
}

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

body.ilove-body {
  background-color: var(--ilove-gray-bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-sans);
  color: #1e293b;
  margin: 0;
  padding: 0;
}

/* ==========================================================================
   BRAND HEADER & BADGE STYLING (MATCHES ID CARD STUDIO)
   ========================================================================== */
.brand-header-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-heading);
  font-weight: 800;
  letter-spacing: -0.2px;
  margin: 0;
  line-height: 1.15;
}

.brand-header-title .brand-name {
  font-size: 1.15rem;
  font-weight: 900;
  color: #0f172a;
  letter-spacing: 0.3px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.brand-header-title .brand-sep {
  color: #cbd5e1;
  font-weight: 300;
  font-size: 1.1rem;
  margin: 0 2px;
}

.brand-header-title .tool-badge-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 9999px;
  background: rgba(225, 29, 72, 0.08);
  border: 1px solid rgba(225, 29, 72, 0.25);
  color: #be123c;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  box-shadow: 0 2px 6px rgba(225, 29, 72, 0.06);
}

@media (max-width: 768px) {
  .brand-header-title {
    gap: 4px;
  }
  .brand-header-title .brand-name {
    font-size: 0.95rem;
  }
  .brand-header-title .tool-badge-pill {
    font-size: 0.7rem;
    padding: 2px 7px;
  }
}

/* ==========================================================================
   MAIN CONTAINER
   ========================================================================== */
.ilove-tool-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
}

/* ==========================================================================
   STAGE 1: HERO & UPLOAD STAGE
   ========================================================================== */
.ilove-hero-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4rem 1.5rem 3rem 1.5rem;
  min-height: calc(100vh - 160px);
}

.ilove-hero-title {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 4.5vw, 3rem);
  font-weight: 800;
  color: #181b22;
  margin-bottom: 0.75rem;
  letter-spacing: -0.5px;
}

.ilove-hero-subtitle {
  font-size: clamp(1rem, 1.8vw, 1.25rem);
  color: #4b5563;
  max-width: 720px;
  margin-bottom: 2.5rem;
  line-height: 1.45;
  font-weight: 400;
}

/* Big Red Select Button + Cloud Stack */
.ilove-upload-cluster {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 1.25rem;
}

.ilove-main-btn {
  background-color: var(--ilove-red);
  color: #ffffff;
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 700;
  padding: 1.25rem 2.8rem;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  box-shadow: 0 10px 25px rgba(229, 50, 45, 0.35), 0 2px 6px rgba(0, 0, 0, 0.08);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.ilove-main-btn:hover {
  background-color: var(--ilove-red-hover);
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(229, 50, 45, 0.45);
}

.ilove-main-btn:active {
  background-color: var(--ilove-red-active);
  transform: translateY(0);
}

/* Cloud Circular Side Buttons */
.ilove-cloud-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ilove-cloud-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background-color: var(--ilove-red);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(229, 50, 45, 0.25);
  transition: all 0.2s ease;
}

.ilove-cloud-btn:hover {
  background-color: var(--ilove-red-hover);
  transform: scale(1.08);
}

.ilove-drop-hint {
  font-size: 0.95rem;
  color: #64748b;
  font-weight: 500;
}

/* ==========================================================================
   STAGE 2: WORKSPACE STAGE (ORDERABLE GRID & SIDEBAR)
   ========================================================================== */
.ilove-workspace-stage {
  flex: 1;
  display: flex;
  min-height: calc(100vh - 120px);
  background: #f1f3f7;
  position: relative;
}

.ilove-canvas-area {
  flex: 1;
  padding: 1.5rem 2rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Workspace Top Bar (Add more & Sort) */
.workspace-top-bar {
  width: 100%;
  max-width: 980px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.ws-tool-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 700;
  color: #1e293b;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
  transition: all 0.2s ease;
}

.ws-tool-btn:hover {
  border-color: #94a3b8;
  background: #f8fafc;
  transform: translateY(-1px);
}

.ws-sort-group {
  display: flex;
  gap: 6px;
}

/* PDF Order Cards Grid */
.pdf-order-grid {
  width: 100%;
  max-width: 980px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1.25rem;
  padding-bottom: 2rem;
}

/* Individual PDF Card */
.order-card-item {
  background: #ffffff;
  border-radius: 12px;
  border: 2px solid transparent;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.06);
  padding: 10px;
  display: flex;
  flex-direction: column;
  position: relative;
  cursor: grab;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
}

.order-card-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
  border-color: #cbd5e1;
}

.order-card-item.is-dragging {
  opacity: 0.4;
  transform: scale(0.95);
  border-color: var(--ilove-red);
}

.order-card-item.drag-over-card {
  border-color: var(--ilove-red);
  box-shadow: 0 0 0 3px rgba(229, 50, 45, 0.2);
}

/* Card Number Badge */
.card-num-badge {
  position: absolute;
  top: -8px;
  left: -8px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #1e293b;
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  z-index: 5;
}

/* Thumbnail Box */
.order-card-thumb-wrap {
  width: 100%;
  aspect-ratio: 1 / 1.35;
  background: #f8fafc;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
  position: relative;
  border: 1px solid #e2e8f0;
}

.order-card-thumb-wrap img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

/* Quick Float Buttons on Card Hover */
.card-float-actions {
  position: absolute;
  top: 6px;
  right: 6px;
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.order-card-item:hover .card-float-actions {
  opacity: 1;
}

.card-icon-btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.8);
  color: #ffffff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.75rem;
  transition: background 0.2s;
}

.card-icon-btn:hover {
  background: var(--ilove-red);
}

/* Card Details */
.order-card-details {
  display: flex;
  flex-direction: column;
}

.order-card-name {
  font-size: 0.8rem;
  font-weight: 700;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}

.order-card-meta {
  font-size: 0.72rem;
  color: #64748b;
  display: flex;
  justify-content: space-between;
}

.workspace-reorder-hint {
  font-size: 0.85rem;
  color: #64748b;
  font-weight: 500;
  margin-top: 1rem;
}

/* ==========================================================================
   RIGHT ACTION SIDEBAR (Exact iLovePDF Sidebar)
   ========================================================================== */
.ilove-action-sidebar {
  width: 380px;
  background: var(--ilove-sidebar-bg);
  border-left: 1px solid #e5e7eb;
  display: flex;
  flex-direction: column;
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.04);
  z-index: 100;
}

.sidebar-header {
  padding: 2rem 1.8rem 1.25rem 1.8rem;
  border-bottom: 1px solid #f1f5f9;
}

.sidebar-title {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 800;
  color: #1e293b;
  margin-bottom: 0.4rem;
}

.sidebar-subtitle {
  font-size: 0.88rem;
  color: #64748b;
  line-height: 1.4;
}

.sidebar-form-panel {
  padding: 1.8rem;
  flex: 1;
  overflow-y: auto;
}

.ilove-input-group {
  margin-bottom: 1.5rem;
}

.ilove-input-group label {
  display: block;
  font-size: 0.84rem;
  font-weight: 700;
  color: #334155;
  margin-bottom: 0.5rem;
}

.ilove-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: var(--font-sans);
  color: #0f172a;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.ilove-input:focus {
  border-color: var(--ilove-red);
  box-shadow: 0 0 0 3px rgba(229, 50, 45, 0.15);
}

.merge-summary-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: #475569;
}

.summary-row strong {
  color: #0f172a;
  font-weight: 700;
}

.sidebar-footer {
  padding: 1.5rem 1.8rem;
  border-top: 1px solid #f1f5f9;
  background: #ffffff;
}

.ilove-action-btn {
  width: 100%;
  background: var(--ilove-red);
  color: #ffffff;
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  padding: 1.1rem 1.5rem;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  box-shadow: 0 8px 20px rgba(229, 50, 45, 0.35);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.ilove-action-btn:hover {
  background: var(--ilove-red-hover);
  transform: translateY(-2px);
  box-shadow: 0 12px 25px rgba(229, 50, 45, 0.45);
}

.ilove-action-btn:active {
  transform: translateY(0);
}

/* ==========================================================================
   STAGE 3: PROCESSING OVERLAY
   ========================================================================== */
.ilove-processing-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(8px);
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.processing-card {
  background: #ffffff;
  border-radius: 16px;
  padding: 2.5rem 2rem;
  text-align: center;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

.processing-spinner {
  width: 56px;
  height: 56px;
  border: 4px solid #f1f5f9;
  border-top-color: var(--ilove-red);
  border-radius: 50%;
  margin: 0 auto 1.5rem auto;
  animation: spin 0.8s linear infinite;
}

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

.processing-title {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 0.5rem;
}

.processing-desc {
  font-size: 0.88rem;
  color: #64748b;
  line-height: 1.4;
}

/* ==========================================================================
   STAGE 4: SUCCESS / DOWNLOAD STAGE
   ========================================================================== */
.ilove-success-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4rem 1.5rem 3rem 1.5rem;
  min-height: calc(100vh - 160px);
}

.success-icon-wrap {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: #ecfdf5;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
  box-shadow: 0 10px 25px rgba(16, 185, 129, 0.2);
}

.success-stage-title {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 4vw, 2.7rem);
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 0.5rem;
}

.success-stage-subtitle {
  font-size: 1.05rem;
  color: #64748b;
  margin-bottom: 2.25rem;
  max-width: 560px;
}

.success-action-cluster {
  margin-bottom: 2rem;
}

.ilove-download-btn {
  background: var(--ilove-red);
  color: #ffffff;
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 800;
  padding: 1.25rem 3rem;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 12px 30px rgba(229, 50, 45, 0.4);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.ilove-download-btn:hover {
  background: var(--ilove-red-hover);
  transform: translateY(-2px);
  box-shadow: 0 16px 35px rgba(229, 50, 45, 0.5);
}

.success-sub-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

.sub-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0.75rem 1.4rem;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 700;
  color: #334155;
  cursor: pointer;
  transition: all 0.2s ease;
}

.sub-action-btn:hover {
  border-color: #94a3b8;
  background: #f8fafc;
  transform: translateY(-1px);
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.ilove-footer {
  background: transparent;
  padding: 1.5rem 1rem;
  text-align: center;
  font-size: 0.85rem;
  color: #64748b;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
}

/* ==========================================================================
   RESPONSIVE LAYOUT
   ========================================================================== */
@media (max-width: 900px) {
  .ilove-workspace-stage {
    flex-direction: column;
  }
  
  .ilove-action-sidebar {
    width: 100%;
    border-left: none;
    border-top: 1px solid #e5e7eb;
  }

  .ilove-hero-title {
    font-size: 1.85rem;
  }

  .ilove-main-btn {
    font-size: 1.15rem;
    padding: 1rem 1.8rem;
  }
}


.btn-select-pdf:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.45);
}

/* =========================================================
   MERGE WORKSPACE & PDF CARDS GRID
   ========================================================= */
.merge-workspace {
  background: #ffffff;
  border-radius: 16px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  padding: 1.5rem;
}

.merge-toolbar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding-bottom: 1rem;
  border-bottom: 1px solid #f1f5f9;
  margin-bottom: 1.5rem;
}

.merge-stats {
  display: flex;
  gap: 8px;
}

.badge-total-files {
  background: #dbeafe;
  color: #1e40af;
  font-weight: 700;
  font-size: 0.8rem;
  padding: 4px 12px;
  border-radius: 9999px;
}

.badge-total-pages {
  background: #f1f5f9;
  color: #475569;
  font-weight: 700;
  font-size: 0.8rem;
  padding: 4px 12px;
  border-radius: 9999px;
}

.merge-header-actions {
  display: flex;
  gap: 8px;
}

.btn-add-more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #1e293b;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-add-more:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.btn-clear-all {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc2626;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-clear-all:hover {
  background: #fee2e2;
}

/* =========================================================
   PDF CARDS GRID & ITEM CARDS
   ========================================================= */
.pdf-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 2rem;
}

.pdf-card-item {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px;
  position: relative;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  user-select: none;
}

.pdf-card-item:hover {
  border-color: #3b82f6;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.12);
  transform: translateY(-2px);
}

.pdf-card-item.dragging {
  opacity: 0.4;
  transform: scale(0.95);
  border-style: dashed;
}

.pdf-card-index {
  position: absolute;
  top: 8px;
  left: 8px;
  background: #0f172a;
  color: white;
  font-size: 0.72rem;
  font-weight: 800;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.pdf-card-thumb-box {
  width: 100%;
  height: 180px;
  background: #f8fafc;
  border: 1px solid #f1f5f9;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
  position: relative;
}

.pdf-card-thumb-box canvas, .pdf-card-thumb-box img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.pdf-card-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  margin-bottom: 8px;
}

.pdf-card-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}

.pdf-card-meta {
  font-size: 0.72rem;
  color: #64748b;
}

.pdf-card-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 8px;
  border-top: 1px solid #f1f5f9;
}

.card-action-btn {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 0.75rem;
  cursor: pointer;
  color: #475569;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  gap: 4px;
}

.card-action-btn:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.card-action-btn.btn-remove:hover {
  background: #fef2f2;
  color: #ef4444;
  border-color: #fca5a5;
}

.card-action-btn.btn-rotate:hover {
  background: #eff6ff;
  color: #2563eb;
  border-color: #93c5fd;
}

/* =========================================================
   BOTTOM MERGE & EXPORT STRIP
   ========================================================= */
.merge-bottom-strip {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.output-name-box {
  display: flex;
  align-items: center;
  gap: 8px;
}

.output-name-box label {
  font-size: 0.85rem;
  font-weight: 700;
  color: #334155;
  white-space: nowrap;
}

.output-name-box input {
  padding: 0.55rem 0.85rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 0.85rem;
  background: #ffffff;
  color: #0f172a;
  outline: none;
  font-family: var(--font-body);
  font-weight: 600;
  min-width: 220px;
}

.output-name-box input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.merge-action-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-merge-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0.65rem 1.25rem;
  border-radius: 8px;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
}

.btn-preview {
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #cbd5e1;
}

.btn-preview:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.btn-share {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  box-shadow: 0 4px 10px rgba(16, 185, 129, 0.25);
}

.btn-merge-save {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: white;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
  font-size: 0.9rem;
  padding: 0.65rem 1.5rem;
}

.btn-merge-save:hover, .btn-share:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.45);
}

.btn-print {
  background: #0f172a;
  color: white;
}

.btn-print:hover {
  background: #1e293b;
}

/* =========================================================
   MOBILE RESPONSIVENESS
   ========================================================= */
@media (max-width: 768px) {
  .merge-hero {
    padding: 1.5rem 1rem 2.8rem 1rem;
  }
  .hero-badge {
    font-size: 0.68rem;
    padding: 3px 10px;
    margin-bottom: 8px;
  }
  .hero-title {
    font-size: 1.65rem;
    margin-bottom: 6px;
    line-height: 1.2;
  }
  .hero-subtitle {
    font-size: 0.82rem;
    line-height: 1.4;
  }
  .merge-container {
    margin-top: -1.8rem;
    padding: 0 10px;
  }
  .merge-upload-card {
    padding: 1.75rem 1rem;
    border-radius: 12px;
  }
  .upload-icon-circle {
    width: 56px;
    height: 56px;
    margin-bottom: 0.85rem;
  }
  .upload-icon-circle svg {
    width: 30px;
    height: 30px;
  }
  .merge-upload-card h3 {
    font-size: 1.1rem !important;
  }
  .merge-upload-card p {
    font-size: 0.78rem !important;
    margin-bottom: 12px !important;
  }
  .btn-select-pdf {
    padding: 0.7rem 1.5rem;
    font-size: 0.88rem;
  }
  .merge-workspace {
    padding: 1rem 0.75rem;
  }
  .merge-toolbar-header {
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
  }
  .pdf-cards-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 1.25rem;
  }
  .pdf-card-item {
    padding: 8px;
  }
  .pdf-card-thumb-box {
    height: 125px;
    margin-bottom: 6px;
  }
  .pdf-card-title {
    font-size: 0.76rem;
  }
  .pdf-card-meta {
    font-size: 0.66rem;
  }
  .card-action-btn {
    padding: 4px 6px;
    font-size: 0.7rem;
  }
  .card-reorder-buttons {
    display: flex;
    gap: 3px;
  }
  .merge-bottom-strip {
    flex-direction: column;
    align-items: stretch;
    padding: 0.85rem;
    gap: 0.75rem;
  }
  .output-name-box {
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
  }
  .output-name-box label {
    font-size: 0.78rem;
  }
  .output-name-box input {
    width: 100%;
    min-width: 0;
    padding: 0.5rem 0.7rem;
    font-size: 0.82rem;
  }
  .merge-action-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }
  .btn-merge-action {
    padding: 0.55rem 0.5rem;
    font-size: 0.78rem;
    justify-content: center;
  }
  .btn-merge-save {
    grid-column: span 2;
    padding: 0.7rem;
    font-size: 0.85rem;
  }
}

/* Mobile Bottom Navigation (Always Visible with Safe Padding) */
@media (max-width: 992px) {
  body {
    padding-bottom: 95px !important;
  }

  .mobile-bottom-nav {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    z-index: 999999 !important;
  }

  .mobile-bottom-nav-inner {
    display: flex !important;
    justify-content: flex-start !important;
    align-items: center !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    scroll-behavior: smooth !important;
    max-width: 100% !important;
    margin: 0 auto !important;
    padding: 3px 6px !important;
    gap: 4px !important;
  }

  .mobile-bottom-nav-inner::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
  }

  .mobile-bottom-item {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    text-decoration: none !important;
    color: #475569 !important;
    font-size: 0.66rem !important;
    font-weight: 700 !important;
    padding: 4px 6px !important;
    border-radius: 10px !important;
    min-width: 62px !important;
    flex-shrink: 0 !important;
    cursor: pointer !important;
    -webkit-tap-highlight-color: transparent !important;
    pointer-events: auto !important;
    white-space: nowrap !important;
  }
}

/* ==========================================================================
   PDF MERGE — UNIVERSAL PC SCREEN AUTO-FIT ENGINE
   ========================================================================== */
html, body {
  width: 100% !important;
  max-width: 100vw !important;
  overflow-x: clip !important;
}

.merge-card,
.container {
  width: 100% !important;
  max-width: min(1200px, 94vw) !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

@media (max-width: 768px) {
  .merge-card {
    padding: 1.25rem 1rem !important;
    margin: 10px auto 6rem auto !important;
    width: 95% !important;
  }

  .file-queue-item {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 6px !important;
  }

  .merge-actions {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    gap: 8px !important;
  }

  .btn-merge-action {
    width: 100% !important;
    justify-content: center !important;
    padding: 0.75rem 1rem !important;
  }
}






