/* ==========================================================================
   YourPDF - Modern Document Suite Stylesheet
   Theme: Electric Teal (#01F9C6) & High-Tech Dark / Clean Light
   ========================================================================== */

:root {
  --primary: #01F9C6;
  --primary-hover: #00e0b1;
  --primary-active: #00c79c;
  --primary-text: #05231c;
  --primary-light: rgba(1, 249, 198, 0.12);
  --primary-border: rgba(1, 249, 198, 0.35);
  --primary-glow: 0 0 24px rgba(1, 249, 198, 0.35);

  --bg-main: #f4f6fa;
  --bg-card: #ffffff;
  --bg-card-hover: #fafbfc;
  --bg-elevated: #ffffff;
  --bg-subtle: #ebedf2;

  --text-main: #0c111d;
  --text-secondary: #3e4759;
  --text-muted: #69758c;
  --border-color: #e2e5ec;
  --border-focus: #01F9C6;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 6px 16px rgba(12, 17, 29, 0.08);
  --shadow-lg: 0 16px 36px rgba(12, 17, 29, 0.12);
  --shadow-card: 0 2px 10px rgba(12, 17, 29, 0.05);
  --shadow-hover: 0 16px 32px rgba(1, 249, 198, 0.18), 0 4px 12px rgba(12, 17, 29, 0.08);

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 26px;
  --radius-full: 9999px;

  --font-heading: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* Accent Colors */
  --c-primary: #01F9C6;
  --c-blue: #3b82f6;
  --c-green: #10b981;
  --c-orange: #f97316;
  --c-amber: #f59e0b;
  --c-purple: #a855f7;
  --c-cyan: #06b6d4;
}

[data-theme="dark"] {
  --bg-main: #090d16;
  --bg-card: #111726;
  --bg-card-hover: #172033;
  --bg-elevated: #1a243a;
  --bg-subtle: #161e30;

  --text-main: #f3f6fc;
  --text-secondary: #b6c2d9;
  --text-muted: #72819e;
  --border-color: #1e293f;
  --primary-light: rgba(1, 249, 198, 0.15);
  --primary-border: rgba(1, 249, 198, 0.45);

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 6px 20px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.6);
  --shadow-card: 0 4px 14px rgba(0, 0, 0, 0.35);
  --shadow-hover: 0 16px 36px rgba(1, 249, 198, 0.22), 0 0 12px rgba(1, 249, 198, 0.15);
}

/* Global Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Accent helper classes */
.text-primary { color: var(--primary) !important; }
.text-blue { color: var(--c-blue) !important; }
.text-green { color: var(--c-green) !important; }
.text-orange { color: var(--c-orange) !important; }
.text-amber { color: var(--c-amber) !important; }
.text-purple { color: var(--c-purple) !important; }
.text-cyan { color: var(--c-cyan) !important; }

/* Top Announcement Banner */
.top-banner {
  background: #060910;
  color: #d1d9e7;
  padding: 8px 16px;
  font-size: 0.84rem;
  font-weight: 500;
  text-align: center;
  border-bottom: 1px solid rgba(1, 249, 198, 0.15);
}

.top-banner-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

/* Navigation Bar */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(12px);
  transition: all 0.2s ease;
}

.nav-container {
  max-width: 1360px;
  margin: 0 auto;
  padding: 0 28px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-family: var(--font-heading);
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--text-main);
}

.logo-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--primary-light);
  border: 1px solid var(--primary-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-size: 1.35rem;
  transition: all 0.25s ease;
  box-shadow: 0 0 14px rgba(1, 249, 198, 0.2);
}

.logo:hover .logo-icon {
  transform: rotate(5deg) scale(1.08);
  box-shadow: var(--primary-glow);
}

.logo-text strong {
  color: var(--primary);
}

/* Nav Links & Dropdowns */
.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  color: var(--text-secondary);
  font-family: var(--font-heading);
  font-size: 0.94rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius-md);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.18s ease;
}

.nav-item:hover, .nav-item.active {
  color: var(--primary);
  background: var(--primary-light);
}

.dropdown {
  position: relative;
}

.dropdown-toggle i {
  font-size: 0.72rem;
  transition: transform 0.2s;
}

.dropdown:hover .dropdown-toggle i {
  transform: rotate(180deg);
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 18px;
  display: none;
  z-index: 150;
  animation: fadeIn 0.15s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.dropdown:hover .dropdown-menu {
  display: flex;
}

.megamenu {
  width: 540px;
  gap: 24px;
}

.megamenu-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dropdown-header {
  font-size: 0.74rem;
  font-weight: 800;
  color: var(--text-muted);
  letter-spacing: 0.09em;
  padding: 6px 12px;
}

.megamenu a, .gridmenu a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
}

.megamenu a:hover, .gridmenu a:hover {
  background: var(--primary-light);
  color: var(--primary);
  transform: translateX(4px);
}

.gridmenu {
  width: 820px;
  display: none;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

.dropdown:hover .gridmenu {
  display: grid;
}

.gridmenu-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Nav Actions */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.2s ease;
}

.icon-btn:hover {
  color: var(--primary);
  border-color: var(--primary);
  background: var(--primary-light);
  box-shadow: 0 0 12px rgba(1, 249, 198, 0.25);
}

.mobile-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.35rem;
  color: var(--text-main);
  cursor: pointer;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  font-family: var(--font-heading);
  font-size: 0.92rem;
  font-weight: 700;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background-color: var(--primary);
  color: var(--primary-text);
  box-shadow: 0 4px 16px rgba(1, 249, 198, 0.35);
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  box-shadow: 0 6px 24px rgba(1, 249, 198, 0.5);
  transform: translateY(-2px);
}

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

.btn-outline {
  background: transparent;
  border-color: var(--border-color);
  color: var(--text-main);
}

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover {
  background: var(--bg-subtle);
  color: var(--text-main);
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.82rem;
  border-radius: var(--radius-sm);
}

.btn-huge {
  padding: 18px 40px;
  font-size: 1.15rem;
  font-weight: 800;
  border-radius: var(--radius-lg);
}

.btn-block {
  width: 100%;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}

/* Main Content Area */
#appContent {
  flex: 1;
}

/* Hero Section */
.hero {
  padding: 64px 24px 40px;
  text-align: center;
  max-width: 980px;
  margin: 0 auto;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 18px;
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid var(--primary-border);
  font-size: 0.82rem;
  font-weight: 800;
  border-radius: var(--radius-full);
  margin-bottom: 22px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  box-shadow: 0 0 16px rgba(1, 249, 198, 0.15);
}

.hero-title {
  font-family: var(--font-heading);
  font-size: 3rem;
  font-weight: 800;
  line-height: 1.15;
  color: var(--text-main);
  margin-bottom: 18px;
  letter-spacing: -0.025em;
}

.hero-subtitle {
  font-size: 1.18rem;
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 740px;
  margin: 0 auto 38px;
}

/* Search Box & Category Filters */
.search-filter-wrapper {
  max-width: 820px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.search-box {
  position: relative;
  width: 100%;
}

.search-box input {
  width: 100%;
  height: 56px;
  padding: 0 48px 0 54px;
  font-size: 1.05rem;
  font-family: var(--font-body);
  border-radius: var(--radius-xl);
  border: 2px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-main);
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.search-box input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(1, 249, 198, 0.2);
}

.search-icon {
  position: absolute;
  left: 22px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 1.15rem;
}

.clear-btn {
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  padding: 4px;
}

.clear-btn:hover {
  color: var(--primary);
}

.filter-pills {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}

.pill {
  padding: 8px 18px;
  font-family: var(--font-heading);
  font-size: 0.88rem;
  font-weight: 700;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.18s ease;
}

.pill:hover {
  border-color: var(--text-muted);
  color: var(--text-main);
}

.pill.active {
  background: var(--primary);
  color: var(--primary-text);
  border-color: var(--primary);
  box-shadow: 0 2px 12px rgba(1, 249, 198, 0.35);
}

/* Tools Grid Container */
.tools-container {
  max-width: 1360px;
  margin: 0 auto;
  padding: 20px 28px 70px;
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 24px;
}

/* Tool Card */
.tool-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 26px 24px;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  cursor: pointer;
  box-shadow: var(--shadow-card);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.tool-card:hover {
  transform: translateY(-6px);
  border-color: var(--primary-border);
  box-shadow: var(--shadow-hover);
}

.tool-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: transparent;
  transition: background 0.25s ease;
}

.tool-card:hover::before {
  background: var(--primary);
  box-shadow: var(--primary-glow);
}

.tool-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 18px;
}

.tool-icon-wrapper {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.65rem;
  background: var(--primary-light);
  border: 1px solid var(--primary-border);
  transition: transform 0.25s ease;
}

.tool-card:hover .tool-icon-wrapper {
  transform: scale(1.1) rotate(-3deg);
  box-shadow: var(--primary-glow);
}

.tool-category-badge {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background: var(--bg-subtle);
  color: var(--text-muted);
}

.tool-card-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 8px;
  transition: color 0.15s ease;
}

.tool-card:hover .tool-card-title {
  color: var(--primary);
}

.tool-card-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.55;
  flex: 1;
}

.tool-card-action {
  margin-top: 20px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.86rem;
  font-weight: 800;
  color: var(--primary);
  opacity: 0;
  transform: translateX(-8px);
  transition: all 0.2s ease;
}

.tool-card:hover .tool-card-action {
  opacity: 1;
  transform: translateX(0);
}

/* Feature/Privacy Section */
.features-section {
  background: var(--bg-card);
  border-top: 1px solid var(--border-color);
  padding: 85px 24px;
}

.section-header {
  text-align: center;
  max-width: 760px;
  margin: 0 auto 55px;
}

.section-header h2 {
  font-family: var(--font-heading);
  font-size: 2.3rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 14px;
}

.section-header p {
  font-size: 1.1rem;
  color: var(--text-secondary);
}

.features-grid {
  max-width: 1240px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 30px;
}

.feature-card {
  padding: 28px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  background: var(--bg-main);
  transition: transform 0.25s, border-color 0.25s;
}

.feature-card:hover {
  transform: translateY(-5px);
  border-color: var(--primary-border);
}

.bg-primary-subtle {
  background: var(--primary-light);
  border: 1px solid var(--primary-border);
}

.feature-icon {
  width: 54px;
  height: 54px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.45rem;
  margin-bottom: 20px;
}

.feature-card h3 {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 8px;
}

.feature-card p {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ==========================================================================
   Tool Workspace Styles
   ========================================================================== */
.tool-workspace {
  background: var(--bg-main);
  min-height: calc(100vh - 100px);
  display: flex;
  flex-direction: column;
}

.workspace-header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  padding: 18px 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.workspace-nav {
  display: flex;
  align-items: center;
  gap: 24px;
}

.btn-back {
  background: var(--bg-subtle);
  color: var(--text-main);
  border-radius: var(--radius-full);
  padding: 9px 20px;
  font-size: 0.9rem;
}

.btn-back:hover {
  background: var(--primary-light);
  color: var(--primary);
}

.workspace-title-box {
  display: flex;
  align-items: center;
  gap: 16px;
}

.tool-badge-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid var(--primary-border);
}

.workspace-title-box h2 {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-main);
}

.workspace-title-box p {
  font-size: 0.86rem;
  color: var(--text-muted);
}

.workspace-actions-top {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Workspace Body */
.workspace-body {
  flex: 1;
  position: relative;
  display: flex;
  flex-direction: column;
}

/* Dropzone */
.dropzone-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 65px 24px;
}

.dropzone {
  width: 100%;
  max-width: 660px;
  background: var(--bg-card);
  border: 3px dashed var(--border-color);
  border-radius: var(--radius-xl);
  padding: 65px 36px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  transition: all 0.25s ease;
  position: relative;
}

.dropzone.drag-over {
  border-color: var(--primary);
  background: var(--primary-light);
  transform: scale(1.02);
  box-shadow: var(--primary-glow);
}

.dropzone-art {
  font-size: 4.2rem;
  color: var(--primary);
  margin-bottom: 24px;
  animation: floatCloud 3s ease-in-out infinite;
}

@keyframes floatCloud {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.file-input-label {
  cursor: pointer;
  margin-bottom: 14px;
}

.dropzone input[type="file"] {
  display: none;
}

.dropzone-text {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.dropzone-formats {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Active Stage Layout */
.active-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.stage-content {
  display: flex;
  min-height: calc(100vh - 170px);
}

.preview-area {
  flex: 1;
  padding: 32px;
  overflow-y: auto;
  background: var(--bg-main);
}

.items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 22px;
}

/* Item Card (for file or page) */
.item-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
  cursor: grab;
}

.item-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--primary-border);
}

.item-card.dragging {
  opacity: 0.35;
  cursor: grabbing;
}

.item-thumb-wrapper {
  width: 100%;
  aspect-ratio: 1 / 1.414;
  background: var(--bg-subtle);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  margin-bottom: 12px;
}

.item-thumb-wrapper canvas, .item-thumb-wrapper img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transition: transform 0.2s ease;
}

.item-thumb-placeholder {
  font-size: 3.2rem;
  color: var(--text-muted);
}

.item-badge-page {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(0, 0, 0, 0.75);
  color: #01F9C6;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
}

.item-info {
  width: 100%;
  text-align: center;
}

.item-title {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}

.item-meta {
  font-size: 0.76rem;
  color: var(--text-muted);
}

.item-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 10px;
}

.item-btn {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.8rem;
  transition: all 0.15s;
}

.item-btn:hover {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
}

.item-btn.btn-delete:hover {
  background: #fee2e2;
  color: #dc2626;
  border-color: #dc2626;
}

.item-card.is-selected {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(1, 249, 198, 0.35);
}

.item-card.is-deleted {
  opacity: 0.35;
  filter: grayscale(1);
}

/* Sidebar Options */
.options-sidebar {
  width: 370px;
  background: var(--bg-card);
  border-left: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  z-index: 10;
}

.sidebar-header {
  padding: 22px 26px;
  border-bottom: 1px solid var(--border-color);
}

.sidebar-header h3 {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-main);
}

.sidebar-content {
  flex: 1;
  padding: 26px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.sidebar-footer {
  padding: 22px 26px;
  border-top: 1px solid var(--border-color);
  background: var(--bg-card);
}

.btn-execute {
  height: 54px;
  font-size: 1.15rem;
}

/* Form Controls in Sidebar */
.option-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.option-label {
  font-family: var(--font-heading);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
}

.option-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.form-input {
  width: 100%;
  padding: 11px 15px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-main);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 0.92rem;
  transition: border-color 0.15s;
}

.form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(1, 249, 198, 0.2);
}

.form-select {
  width: 100%;
  padding: 11px 15px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-main);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 0.92rem;
  cursor: pointer;
}

.form-select:focus {
  outline: none;
  border-color: var(--primary);
}

/* Radio Cards (Compression level, etc.) */
.radio-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.radio-card {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-main);
  cursor: pointer;
  transition: all 0.18s;
}

.radio-card:hover {
  border-color: var(--text-muted);
}

.radio-card.active {
  border-color: var(--primary);
  background: var(--primary-light);
  box-shadow: 0 0 14px rgba(1, 249, 198, 0.18);
}

.radio-card input {
  margin-top: 3px;
  accent-color: var(--primary);
}

.radio-card-content h4 {
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 2px;
}

.radio-card-content p {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

/* Position Grid (Watermark / Page Numbers) */
.position-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  width: 190px;
  margin: 6px 0;
}

.pos-btn {
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-main);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text-muted);
  transition: all 0.15s;
}

.pos-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.pos-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--primary-text);
  font-weight: 700;
}

/* Processing Overlay */
.processing-overlay {
  position: fixed;
  inset: 0;
  background: rgba(9, 13, 22, 0.85);
  backdrop-filter: blur(6px);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
}

.processing-card {
  background: var(--bg-card);
  padding: 46px;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--primary-border);
  text-align: center;
  width: 90%;
  max-width: 450px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.loader-spinner {
  width: 58px;
  height: 58px;
  border: 4px solid var(--border-color);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 24px;
}

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

.processing-card h3 {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 800;
  margin-bottom: 6px;
  color: var(--text-main);
}

.processing-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 24px;
}

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

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #01F9C6, #00c79c);
  border-radius: var(--radius-full);
  transition: width 0.25s ease;
  box-shadow: 0 0 12px rgba(1, 249, 198, 0.4);
}

.progress-percent {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--primary);
}

/* Result Stage */
.result-stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 65px 24px;
}

.result-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: 50px;
  text-align: center;
  width: 100%;
  max-width: 590px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.result-icon-success {
  font-size: 4.2rem;
  color: var(--primary);
  margin-bottom: 20px;
  animation: popSuccess 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popSuccess {
  0% { transform: scale(0.4); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.result-card h2 {
  font-family: var(--font-heading);
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 8px;
}

.result-card p {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.result-stats {
  margin-bottom: 30px;
  width: 100%;
}

.stat-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 20px;
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid var(--primary-border);
  font-weight: 800;
  font-size: 0.96rem;
  border-radius: var(--radius-full);
}

.result-actions {
  margin-bottom: 32px;
}

.result-next-steps {
  width: 100%;
  padding-top: 24px;
  border-top: 1px solid var(--border-color);
  margin-bottom: 24px;
}

.result-next-steps p {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.next-step-buttons {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}

.result-footer-nav {
  display: flex;
  gap: 16px;
}

/* Modals */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(9, 13, 22, 0.85);
  backdrop-filter: blur(6px);
  z-index: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-dialog {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 550px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.2rem;
  color: var(--text-muted);
  cursor: pointer;
}

.modal-close:hover {
  color: var(--primary);
}

.modal-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-subtle);
}

.tab-btn {
  flex: 1;
  padding: 12px;
  font-family: var(--font-heading);
  font-size: 0.92rem;
  font-weight: 700;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-secondary);
  cursor: pointer;
}

.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  background: var(--bg-card);
}

.modal-body {
  padding: 24px;
}

#sigCanvas {
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-md);
  background: #ffffff;
  display: block;
  margin: 0 auto;
  cursor: crosshair;
}

.sig-canvas-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
}

.color-palette {
  display: flex;
  gap: 8px;
}

.color-dot {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform 0.15s;
}

.color-dot.active {
  border-color: #ffffff;
  box-shadow: 0 0 0 2px var(--primary);
  transform: scale(1.15);
}

.sig-font-previews {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
  max-height: 200px;
  overflow-y: auto;
}

.sig-font-item {
  padding: 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 1.5rem;
  transition: all 0.15s;
}

.sig-font-item.active {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: #111726;
  border: 1px solid var(--border-color);
  color: #fff;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.92rem;
  animation: slideToast 0.3s ease;
  min-width: 290px;
}

@keyframes slideToast {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.toast.toast-error {
  border-color: #ef4444;
  color: #fca5a5;
}

.toast.toast-success {
  border-color: var(--primary);
  color: var(--primary);
}

/* Footer */
.footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border-color);
  padding: 65px 24px 32px;
  margin-top: auto;
}

.footer-container {
  max-width: 1360px;
  margin: 0 auto;
}

.footer-top {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 45px;
}

.footer-brand p {
  margin-top: 16px;
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.6;
  max-width: 390px;
}

.footer-links-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-links-group h4 {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.footer-links-group a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.15s;
}

.footer-links-group a:hover {
  color: var(--primary);
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 26px;
  border-top: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.85rem;
}

.footer-badges {
  display: flex;
  gap: 20px;
}

.footer-badges span {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Responsive Rules */
@media (max-width: 1024px) {
  .nav-links { display: none; }
  .mobile-toggle { display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: var(--radius-md); border: 1px solid var(--border-color); background: var(--bg-card); color: var(--text-main); font-size: 1.25rem; }
  .stage-content { flex-direction: column; }
  .options-sidebar { width: 100%; border-left: none; border-top: 1px solid var(--border-color); }
  .footer-top { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  .hero-title { font-size: 2.1rem; }
  .hero-subtitle { font-size: 1rem; }
  .workspace-header { flex-direction: column; align-items: flex-start; gap: 14px; padding: 14px 20px; }
  .workspace-nav { flex-direction: column; align-items: flex-start; gap: 12px; }
  .footer-top { grid-template-columns: 1fr; gap: 28px; }
  .footer-bottom { flex-direction: column; gap: 14px; text-align: center; }
  .tools-grid { grid-template-columns: 1fr; }
  .btn-huge { width: 100%; padding: 15px 24px; font-size: 1.05rem; }
  .dropzone { padding: 40px 18px; }
  .dropzone-art { font-size: 3.2rem; }
  .filter-pills { overflow-x: auto; flex-wrap: nowrap; justify-content: flex-start; padding-bottom: 6px; -webkit-overflow-scrolling: touch; width: 100%; }
  .filter-pills .pill { flex-shrink: 0; }
  .search-box input { height: 50px; font-size: 0.98rem; }
}

/* ==========================================================================
   Mobile Navigation Drawer & Backdrop
   ========================================================================== */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(9, 13, 22, 0.75);
  backdrop-filter: blur(6px);
  z-index: 998;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.drawer-backdrop.active {
  opacity: 1;
  visibility: visible;
}

.mobile-drawer {
  position: fixed;
  top: 0;
  right: -320px;
  width: 300px;
  max-width: 85vw;
  height: 100vh;
  background: var(--bg-card);
  border-left: 1px solid var(--border-color);
  box-shadow: -8px 0 30px rgba(0, 0, 0, 0.4);
  z-index: 999;
  display: flex;
  flex-direction: column;
  transition: right 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  overflow-y: auto;
}

.mobile-drawer.active {
  right: 0;
}

.drawer-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.drawer-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.4rem;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: var(--radius-sm);
}

.drawer-close:hover {
  color: var(--primary);
}

.drawer-nav {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.drawer-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: var(--text-main);
  text-decoration: none;
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  transition: all 0.15s ease;
  min-height: 48px;
}

.drawer-item:hover, .drawer-item.active {
  background: var(--primary-light);
  color: var(--primary);
}

.drawer-section-title {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  padding: 12px 16px 4px;
}

.drawer-footer {
  padding: 20px 24px;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ==========================================================================
   Content Pages (About, Privacy, Terms, Contact, FAQ)
   ========================================================================== */
.content-page-wrapper {
  max-width: 1040px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}

.breadcrumb-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.breadcrumb-nav a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.15s;
}

.breadcrumb-nav a:hover {
  color: var(--primary);
}

.content-hero-box {
  margin-bottom: 44px;
  padding-bottom: 30px;
  border-bottom: 1px solid var(--border-color);
}

.content-page-title {
  font-family: var(--font-heading);
  font-size: 2.6rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.2;
  margin-bottom: 12px;
  letter-spacing: -0.02em;
}

.content-page-lead {
  font-size: 1.15rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.prose {
  color: var(--text-secondary);
  font-size: 1.02rem;
  line-height: 1.75;
}

.prose h2 {
  font-family: var(--font-heading);
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--text-main);
  margin: 36px 0 16px;
  letter-spacing: -0.01em;
}

.prose h3 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 28px 0 12px;
}

.prose p {
  margin-bottom: 20px;
}

.prose ul, .prose ol {
  margin: 0 0 24px 24px;
}

.prose li {
  margin-bottom: 8px;
}

.prose strong {
  color: var(--text-main);
}

.callout-box {
  background: var(--bg-card);
  border: 1px solid var(--primary-border);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  margin: 28px 0;
  box-shadow: 0 4px 14px rgba(1, 249, 198, 0.08);
}

.callout-box h4 {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* FAQ Accordion */
.faq-accordion-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 32px;
}

.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: all 0.2s ease;
}

.faq-item:hover {
  border-color: var(--primary-border);
}

.faq-question-btn {
  width: 100%;
  padding: 20px 24px;
  background: none;
  border: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  text-align: left;
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  gap: 16px;
}

.faq-question-btn i {
  color: var(--primary);
  font-size: 0.9rem;
  transition: transform 0.25s ease;
}

.faq-item.active .faq-question-btn i {
  transform: rotate(180deg);
}

.faq-answer-box {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s cubic-bezier(0, 1, 0, 1);
  padding: 0 24px;
}

.faq-item.active .faq-answer-box {
  max-height: 1000px;
  padding-bottom: 22px;
}

.faq-answer-box p {
  color: var(--text-secondary);
  line-height: 1.65;
  font-size: 0.95rem;
  margin: 0;
}

/* Contact Grid & Form */
.contact-layout-grid {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 40px;
  margin-top: 30px;
}

@media (max-width: 768px) {
  .contact-layout-grid { grid-template-columns: 1fr; }
}

.contact-info-panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.contact-card-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.contact-card-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--primary-light);
  border: 1px solid var(--primary-border);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.contact-card-text h4 {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
}

.contact-card-text p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin: 0;
}

.contact-form-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-card);
}

.contact-form-panel h3 {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 20px;
}

/* ==========================================================================
   Offline Blocker Overlay (Enforce Active Server Connection)
   ========================================================================== */
.offline-overlay {
  position: fixed;
  inset: 0;
  background: rgba(9, 13, 22, 0.96);
  backdrop-filter: blur(10px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.offline-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7);
  padding: 48px 36px;
  text-align: center;
  max-width: 500px;
  width: 100%;
  animation: popSuccess 0.3s ease;
}

.offline-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #ef4444;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  margin: 0 auto 22px;
}

.offline-card h2 {
  font-family: var(--font-heading);
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 12px;
}

.offline-card p {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 22px;
}

.offline-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 700;
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  margin-bottom: 26px;
}

.offline-status .status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ef4444;
  animation: pulseRed 1.5s infinite;
}

@keyframes pulseRed {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.4); opacity: 0.4; }
  100% { transform: scale(1); opacity: 1; }
}

