/* ==========================================================================
   iLovePDF Style PDF Sign 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
   ========================================================================== */
.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;
}

.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);
}

.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 & INTERACTIVE SIGNING STAGE
   ========================================================================== */
.ilove-workspace-stage {
  flex: 1;
  display: flex;
  min-height: calc(100vh - 120px);
  background: #e2e8f0;
  position: relative;
}

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

/* Top Toolbar */
.sign-top-toolbar {
  width: 100%;
  max-width: 900px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 10px;
  background: #ffffff;
  padding: 8px 16px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.doc-info-pill {
  font-size: 0.88rem;
  font-weight: 700;
  color: #1e293b;
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sign-page-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.page-nav-btn {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #1e293b;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  transition: all 0.2s ease;
}

.page-nav-btn:hover:not(:disabled) {
  background: #e2e8f0;
}

.page-nav-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.page-nav-indicator {
  font-size: 0.88rem;
  font-weight: 700;
  color: #334155;
}

.sign-zoom-tools {
  display: flex;
  align-items: center;
  gap: 6px;
}

.zoom-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  font-weight: 800;
  cursor: pointer;
}

.ws-tool-btn {
  padding: 6px 12px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.ws-tool-btn:hover {
  background: #fff1f2;
  border-color: #fecdd3;
}

/* PDF Viewer Outer Container */
.pdf-viewer-outer {
  width: 100%;
  display: flex;
  justify-content: center;
  overflow: auto;
  padding: 1rem 0 2rem 0;
}

.pdf-page-container {
  position: relative;
  background: #ffffff;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
  border-radius: 4px;
  user-select: none;
  display: inline-block;
  margin: 0 auto;
}

#pdfRenderCanvas {
  display: block;
  max-width: 100%;
  height: auto;
}

/* Placed Elements Overlay */
.elements-overlay-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: auto;
}

/* Placed Signature / Item Box */
.placed-element {
  position: absolute;
  border: 2px dashed transparent;
  background: transparent;
  cursor: move;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  z-index: 10;
  box-sizing: border-box;
  transition: border-color 0.15s, background-color 0.15s;
}

.placed-element:hover:not(.is-active) {
  border-color: rgba(229, 50, 45, 0.35);
}

.placed-element.is-active {
  border: 2px dashed var(--ilove-red) !important;
  background: rgba(229, 50, 45, 0.04) !important;
}

.placed-element img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

.placed-element-text {
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
  white-space: nowrap;
  pointer-events: none;
}

/* Delete Button on Placed Item */
.elem-delete-btn {
  position: absolute;
  top: -10px;
  right: -10px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #e11d48;
  color: #ffffff;
  border: none;
  font-size: 11px;
  font-weight: 900;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  z-index: 20;
}

.placed-element.is-active .elem-delete-btn {
  display: flex !important;
}

/* Resize Handle */
.elem-resize-handle {
  position: absolute;
  bottom: -6px;
  right: -6px;
  width: 14px;
  height: 14px;
  background: var(--ilove-red);
  border: 2px solid #ffffff;
  border-radius: 2px;
  cursor: nwse-resize;
  display: none;
  z-index: 20;
}

.placed-element.is-active .elem-resize-handle {
  display: block !important;
}

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

/* ==========================================================================
   RIGHT ACTION 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: 1.8rem 1.6rem 1rem 1.6rem;
  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.85rem;
  color: #64748b;
  line-height: 1.4;
}

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

/* Create Signature Big Button */
.create-signature-big-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: #fff1f2;
  border: 2px dashed #f43f5e;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  color: #be123c;
}

.create-signature-big-btn:hover {
  background: #ffe4e6;
  border-color: #e11d48;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(225, 29, 72, 0.15);
}

.create-signature-big-btn .plus-icon {
  font-size: 1.5rem;
}

.section-sub-title {
  font-size: 0.85rem;
  font-weight: 800;
  color: #334155;
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.quick-fields-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.field-quick-btn {
  padding: 10px 6px;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #1e293b;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.field-quick-btn:hover {
  background: #ffffff;
  border-color: #94a3b8;
  transform: translateY(-1px);
}

/* Signatures Tray */
.signatures-tray {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 220px;
  overflow-y: auto;
  padding: 2px;
}

.empty-tray-msg {
  font-size: 0.82rem;
  color: #94a3b8;
  font-style: italic;
  text-align: center;
  padding: 1rem 0;
}

.tray-signature-item {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
  transition: all 0.2s ease;
}

.tray-signature-item:hover {
  border-color: var(--ilove-red);
  background: #fffdfd;
  transform: translateY(-1px);
}

.tray-sig-img {
  max-height: 38px;
  max-width: 180px;
  object-fit: contain;
}

.tray-place-badge {
  font-size: 0.72rem;
  font-weight: 800;
  background: #e2e8f0;
  color: #475569;
  padding: 4px 8px;
  border-radius: 4px;
}

.tray-signature-item:hover .tray-place-badge {
  background: var(--ilove-red);
  color: #ffffff;
}

.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);
}

/* ==========================================================================
   SIGNATURE CREATION MODAL
   ========================================================================== */
.signature-modal-backdrop {
  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;
}

.signature-modal-card {
  background: #ffffff;
  border-radius: 16px;
  max-width: 580px;
  width: 95%;
  max-height: 90vh;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: popIn 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-header {
  padding: 1rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #f1f5f9;
  flex-shrink: 0;
}

.modal-title {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 800;
  color: #0f172a;
}

.modal-close-btn {
  background: none;
  border: none;
  font-size: 1.2rem;
  color: #94a3b8;
  cursor: pointer;
}

.modal-close-btn:hover {
  color: #0f172a;
}

.modal-tabs {
  display: flex;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  flex-shrink: 0;
}

.tab-btn {
  flex: 1;
  padding: 10px;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  font-size: 0.88rem;
  font-weight: 700;
  color: #64748b;
  cursor: pointer;
  transition: all 0.2s;
}

.tab-btn:hover {
  color: #0f172a;
}

.tab-btn.active {
  color: var(--ilove-red);
  border-bottom-color: var(--ilove-red);
  background: #ffffff;
}

.modal-body {
  padding: 1rem 1.25rem;
  flex: 1 1 auto;
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* Draw Tab */
.draw-canvas-box {
  border: 2px dashed #cbd5e1;
  border-radius: 10px;
  background: #fafafa;
  position: relative;
  overflow: hidden;
  height: 180px;
}

#signatureDrawCanvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: crosshair;
  position: relative;
  z-index: 2;
}

.canvas-watermark {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: 'Inter', sans-serif;
  font-size: 1.2rem;
  font-weight: 600;
  color: #cbd5e1;
  pointer-events: none;
  z-index: 1;
}

.modal-tools-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1rem;
}

.color-picker-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tool-label {
  font-size: 0.84rem;
  font-weight: 700;
  color: #64748b;
}

.color-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid #ffffff;
  box-shadow: 0 0 0 1px #cbd5e1;
  cursor: pointer;
  transition: transform 0.2s;
}

.color-dot.active {
  box-shadow: 0 0 0 2.5px var(--ilove-red);
  transform: scale(1.15);
}

.clear-canvas-btn {
  padding: 6px 12px;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}

.clear-canvas-btn:hover {
  background: #f1f5f9;
}

/* Type Tab */
.type-input-group label {
  display: block;
  font-size: 0.84rem;
  font-weight: 700;
  color: #334155;
  margin-bottom: 6px;
}

.type-styles-preview {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 1rem;
}

.typed-style-card {
  padding: 12px 10px;
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.typed-style-card:hover {
  border-color: #cbd5e1;
  background: #ffffff;
}

.typed-style-card.selected {
  border-color: var(--ilove-red);
  background: #fff5f5;
}

.font-preview {
  font-size: 1.4rem;
  color: #0f172a;
}

/* Upload Tab Styling */
.upload-dropzone-box {
  border: 2px dashed #cbd5e1;
  border-radius: 12px;
  padding: 2rem 1.5rem;
  text-align: center;
  background: #f8fafc;
  cursor: pointer;
  transition: all 0.2s;
}

.upload-dropzone-box:hover {
  border-color: var(--ilove-red);
  background: #fffafa;
}

.upload-icon {
  font-size: 2.2rem;
  margin-bottom: 8px;
}

/* Edit Toolbar */
.sig-edit-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.sig-tool-action-btn {
  padding: 6px 12px;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 700;
  color: #334155;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s;
}

.sig-tool-action-btn:hover {
  border-color: var(--ilove-red);
  color: var(--ilove-red);
  background: #fff5f5;
}

.sig-tool-action-btn.active {
  background: var(--ilove-red);
  color: #ffffff;
  border-color: var(--ilove-red);
}

/* Stage Container & Checkerboard Background */
.sig-crop-stage-container {
  width: 100%;
  border-radius: 10px;
  border: 1.5px solid #cbd5e1;
  overflow: hidden;
  position: relative;
  background: #ffffff;
}

.checkerboard-bg {
  width: 100%;
  min-height: 180px;
  max-height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background-color: #ffffff;
  background-image: 
    linear-gradient(45deg, #f1f5f9 25%, transparent 25%), 
    linear-gradient(-45deg, #f1f5f9 25%, transparent 25%), 
    linear-gradient(45deg, transparent 75%, #f1f5f9 75%), 
    linear-gradient(-45deg, transparent 75%, #f1f5f9 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0px;
  overflow: auto;
  padding: 8px;
}

.sig-canvas-wrapper {
  position: relative;
  display: inline-block;
  user-select: none;
  line-height: 0;
}

#sigProcessCanvas {
  max-width: 100%;
  max-height: 220px;
  display: block;
  object-fit: contain;
  margin: 0 auto;
  border-radius: 4px;
}

/* FastStone Style Crop Box Overlay */
.sig-crop-box {
  position: absolute;
  border: 2px dashed #ffffff;
  outline: 1px solid #0284c7;
  box-shadow: 0 0 0 9999px rgba(15, 23, 42, 0.65);
  cursor: move;
  z-index: 10;
  box-sizing: border-box;
}

.crop-corner {
  position: absolute;
  width: 10px;
  height: 10px;
  background: #ffffff;
  border: 2px solid #0284c7;
  border-radius: 2px;
  z-index: 20;
}

/* 8 FastStone Handles */
.crop-corner.top-left { top: -6px; left: -6px; cursor: nwse-resize; }
.crop-corner.top-mid { top: -6px; left: calc(50% - 5px); cursor: ns-resize; }
.crop-corner.top-right { top: -6px; right: -6px; cursor: nesw-resize; }
.crop-corner.mid-right { top: calc(50% - 5px); right: -6px; cursor: ew-resize; }
.crop-corner.bottom-right { bottom: -6px; right: -6px; cursor: nwse-resize; }
.crop-corner.bottom-mid { bottom: -6px; left: calc(50% - 5px); cursor: ns-resize; }
.crop-corner.bottom-left { bottom: -6px; left: -6px; cursor: nesw-resize; }
.crop-corner.mid-left { top: calc(50% - 5px); left: -6px; cursor: ew-resize; }

.crop-hint-badge {
  position: absolute;
  top: -26px;
  left: 50%;
  transform: translateX(-50%);
  background: #0284c7;
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 4px;
  white-space: nowrap;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  line-height: normal;
}

/* Controls Panel */
.sig-process-controls-panel {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px 12px;
  margin-top: 8px;
}

.sig-ink-colors {
  display: flex;
  gap: 6px;
}

.ink-color-btn {
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  background: #ffffff;
  color: #334155;
  transition: all 0.15s;
}

.ink-color-btn.active {
  box-shadow: 0 0 0 2px var(--ilove-red);
  border-color: var(--ilove-red);
}

.modal-footer {
  padding: 0.9rem 1.25rem;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  border-top: 1px solid #f1f5f9;
  background: #f8fafc;
  flex-shrink: 0;
}

.modal-cancel-btn {
  padding: 8px 16px;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 700;
  color: #475569;
  cursor: pointer;
}

.modal-apply-btn {
  padding: 8px 20px;
  background: var(--ilove-red);
  border: none;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 700;
  color: #ffffff;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(229, 50, 45, 0.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);
}

.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;
}

/* Success 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);
}

.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);
}

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