/* PDFTool - Modern Ultra-Premium Stylesheet */
@import url('https://fonts.googleapis.com/css2?family=Caveat:wght@600&family=Dancing+Script:wght@700&family=Great+Vibes&family=Inter:wght@300;400;500;600;700;800&family=Outfit:wght@400;500;600;700;800&family=Pacifico&display=swap');

:root {
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-heading: 'Outfit', var(--font-main);
  --font-signature-1: 'Caveat', cursive;
  --font-signature-2: 'Dancing Script', cursive;
  --font-signature-3: 'Great Vibes', cursive;
  --font-signature-4: 'Pacifico', cursive;

  /* Color Palette - Light Mode */
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f1f5f9;
  --bg-glass: rgba(255, 255, 255, 0.85);
  --border-glass: rgba(226, 232, 240, 0.8);
  
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-light: #e0e7ff;
  --primary-glow: rgba(79, 70, 229, 0.25);
  
  --accent-red: #ef4444;
  --accent-red-light: #fee2e2;
  --accent-green: #10b981;
  --accent-green-light: #d1fae5;
  --accent-amber: #f59e0b;
  --accent-amber-light: #fef3c7;
  --accent-cyan: #06b6d4;
  --accent-purple: #8b5cf6;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --shadow-glow: 0 0 25px var(--primary-glow);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="dark"] {
  --bg-primary: #090d16;
  --bg-secondary: #111827;
  --bg-tertiary: #1f2937;
  --bg-glass: rgba(17, 24, 39, 0.85);
  --border-glass: rgba(255, 255, 255, 0.08);

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-light: rgba(99, 102, 241, 0.15);
  --primary-glow: rgba(99, 102, 241, 0.35);

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.6);
}

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

body {
  font-family: var(--font-main);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.5;
  transition: background-color var(--transition-normal), color var(--transition-normal);
  overflow-x: hidden;
}

/* ICTE Press Top Announcement Bar */
.top-announcement-bar {
  background: linear-gradient(90deg, #0b2545 0%, #134074 50%, #0f172a 100%);
  color: #ffffff;
  padding: 0.45rem 1.5rem;
  font-size: 0.78rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
  z-index: 101;
}

.announcement-content {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.announcement-badge {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: #ffffff;
  font-weight: 800;
  font-size: 0.68rem;
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-full);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.35);
}

.announcement-text {
  color: rgba(255, 255, 255, 0.9);
  font-weight: 500;
  flex: 1;
  min-width: 260px;
}

.announcement-link {
  color: #fbbf24;
  text-decoration: none;
  font-weight: 600;
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.announcement-link:hover {
  color: #fef08a;
  text-decoration: underline;
  transform: translateX(2px);
}

/* Header & Navbar */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-glass);
  padding: 0.75rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  transition: all var(--transition-normal);
  box-shadow: 0 4px 20px -5px rgba(0, 0, 0, 0.05);
}

.navbar::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, #1e40af 0%, #3b82f6 30%, #ef4444 60%, #f59e0b 100%);
  opacity: 0.85;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
  color: var(--text-primary);
  cursor: pointer;
  user-select: none;
  transition: transform var(--transition-fast);
}

.brand:hover {
  transform: translateY(-1px);
}

.brand-logo-wrap {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  border: 1px solid var(--border-glass);
  padding: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.brand:hover .brand-logo-wrap {
  box-shadow: 0 6px 18px rgba(30, 64, 175, 0.25);
  transform: scale(1.04);
}

.brand-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand-text-block {
  display: flex;
  flex-direction: column;
}

.brand-title-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.brand-name {
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 1.3rem;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  line-height: 1.15;
}

.brand-badge {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.18rem 0.55rem;
  border-radius: var(--radius-full);
  background: var(--primary-light);
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.badge-pulse {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-green);
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.brand-tagline {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.01em;
}

/* Ecosystem Nav Links */
.nav-links-wrap {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.nav-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.85rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.nav-item:hover {
  color: var(--primary);
  background: var(--bg-tertiary);
}

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

/* Commercial OJS Software Pill Button */
.nav-btn-software {
  background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%) !important;
  color: #000000 !important;
  font-family: var(--font-heading), var(--font-main);
  font-weight: 800 !important;
  font-size: 0.88rem !important;
  padding: 0.45rem 1.15rem !important;
  border-radius: 50px !important;
  text-decoration: none !important;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.4) !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
  margin-left: 0.25rem;
  white-space: nowrap;
}

.nav-btn-software:hover {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%) !important;
  color: #000000 !important;
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.55) !important;
}

.nav-btn-software:active {
  transform: translateY(0) scale(0.98);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.privacy-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--accent-green-light);
  color: #065f46;
  border: 1px solid rgba(16, 185, 129, 0.25);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

[data-theme="dark"] .privacy-pill {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border-color: rgba(52, 211, 153, 0.25);
}

.privacy-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
}

.theme-toggle-btn {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-glass);
  color: var(--text-primary);
  padding: 0.55rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.theme-toggle-btn:hover {
  background: var(--primary-light);
  color: var(--primary);
  transform: rotate(15deg);
}

/* Container */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  width: 100%;
  flex: 1;
}

/* Hero Section */
.hero-section {
  text-align: center;
  padding: 2.75rem 1rem 3.25rem;
  position: relative;
}

.hero-crest-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.45rem 1.15rem;
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 0.8rem;
  font-weight: 700;
  border-radius: var(--radius-full);
  margin-bottom: 1.5rem;
  border: 1px solid var(--border-glass);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04);
}

.hero-crest-icon {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.hero-crest-label {
  letter-spacing: 0.06em;
  background: linear-gradient(135deg, #1e40af 0%, #ef4444 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 800;
}

[data-theme="dark"] .hero-crest-label {
  background: linear-gradient(135deg, #60a5fa 0%, #f87171 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-title {
  font-family: var(--font-heading);
  font-size: 3rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 1.15rem;
  color: var(--text-primary);
}

.gradient-text {
  background: linear-gradient(135deg, #1e40af 0%, #4f46e5 50%, #dc2626 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

[data-theme="dark"] .gradient-text {
  background: linear-gradient(135deg, #60a5fa 0%, #818cf8 50%, #f87171 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

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

.hero-feature-tags {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-bottom: 2rem;
}

.feature-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.85rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
}

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

/* Search bar */
.search-container {
  max-width: 520px;
  margin: 0 auto 1rem;
  position: relative;
}

.search-input {
  width: 100%;
  padding: 0.95rem 1.25rem 0.95rem 3.25rem;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--border-glass);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 0.98rem;
  outline: none;
  box-shadow: var(--shadow-md);
  transition: all var(--transition-fast);
}

.search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-glow), var(--shadow-lg);
}

.search-icon {
  position: absolute;
  left: 1.2rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 1.1rem;
  pointer-events: none;
}

/* Tool Grid - 4 Columns Layout matching screenshot */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  margin-top: 1rem;
}

@media (max-width: 1200px) {
  .tools-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 900px) {
  .tools-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .tools-grid {
    grid-template-columns: 1fr;
  }
}

.tool-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-glass);
  border-radius: 20px;
  padding: 1.65rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-decoration: none;
  color: inherit;
  transition: all var(--transition-normal);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.03);
}

.tool-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.07);
  border-color: rgba(99, 102, 241, 0.35);
}

.tool-icon-wrapper {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.2rem;
  font-size: 1.45rem;
  background: var(--card-light, var(--primary-light));
  color: var(--card-color, var(--primary));
  transition: transform var(--transition-fast);
}

.tool-card:hover .tool-icon-wrapper {
  transform: scale(1.08);
}

.tool-card-title {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
  line-height: 1.25;
}

.tool-card-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.48;
  margin-bottom: 1.35rem;
  flex: 1;
}

.tool-card-footer {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--card-color, var(--primary));
  transition: transform var(--transition-fast);
}

.tool-card:hover .tool-card-footer {
  transform: translateX(3px);
}

/* Tool Colors */
.tool-merge { --card-color: #ef4444; --card-light: #fee2e2; }
.tool-split { --card-color: #f97316; --card-light: #ffedd5; }
.tool-remove { --card-color: #e11d48; --card-light: #ffe4e6; }
.tool-compress { --card-color: #10b981; --card-light: #d1fae5; }
.tool-edit { --card-color: #06b6d4; --card-light: #cffafe; }
.tool-sign { --card-color: #8b5cf6; --card-light: #ede9fe; }
.tool-watermark { --card-color: #3b82f6; --card-light: #dbeafe; }
.tool-word { --card-color: #2563eb; --card-light: #eff6ff; }
.tool-compress-word { --card-color: #059669; --card-light: #d1fae5; }
.tool-protect { --card-color: #d97706; --card-light: #fef3c7; }
.tool-unlock { --card-color: #0284c7; --card-light: #e0f2fe; }
.tool-rotate { --card-color: #4f46e5; --card-light: #e0e7ff; }
.tool-pagenumber { --card-color: #7c3aed; --card-light: #ede9fe; }
.tool-pdf-to-img { --card-color: #db2777; --card-light: #fce7f3; }
.tool-img-to-pdf { --card-color: #ea580c; --card-light: #ffedd5; }
.tool-extract-text { --card-color: #475569; --card-light: #f1f5f9; }

[data-theme="dark"] .tool-merge { --card-light: rgba(239, 68, 68, 0.15); }
[data-theme="dark"] .tool-split { --card-light: rgba(249, 115, 22, 0.15); }
[data-theme="dark"] .tool-remove { --card-light: rgba(225, 29, 72, 0.15); }
[data-theme="dark"] .tool-compress { --card-light: rgba(16, 185, 129, 0.15); }
[data-theme="dark"] .tool-edit { --card-light: rgba(6, 182, 212, 0.15); }
[data-theme="dark"] .tool-sign { --card-light: rgba(139, 92, 246, 0.15); }
[data-theme="dark"] .tool-watermark { --card-light: rgba(59, 130, 246, 0.15); }
[data-theme="dark"] .tool-word { --card-light: rgba(37, 99, 235, 0.15); }
[data-theme="dark"] .tool-compress-word { --card-light: rgba(5, 150, 105, 0.15); }
[data-theme="dark"] .tool-protect { --card-light: rgba(217, 119, 6, 0.15); }
[data-theme="dark"] .tool-unlock { --card-light: rgba(2, 132, 199, 0.15); }
[data-theme="dark"] .tool-rotate { --card-light: rgba(79, 70, 229, 0.15); }
[data-theme="dark"] .tool-pagenumber { --card-light: rgba(124, 58, 237, 0.15); }
[data-theme="dark"] .tool-pdf-to-img { --card-light: rgba(219, 39, 119, 0.15); }
[data-theme="dark"] .tool-img-to-pdf { --card-light: rgba(234, 88, 12, 0.15); }
[data-theme="dark"] .tool-extract-text { --card-light: rgba(71, 85, 105, 0.15); }

/* Workspace Screen (Active Tool View) */
.tool-workspace {
  display: none;
  animation: fadeIn 0.3s ease;
}

.tool-workspace.active {
  display: block;
}

.workspace-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.75rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-glass);
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-glass);
  color: var(--text-primary);
  padding: 0.6rem 1.15rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.back-btn:hover {
  background: var(--bg-tertiary);
  transform: translateX(-2px);
}

.workspace-title-group {
  text-align: center;
}

.workspace-title {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 700;
}

.workspace-subtitle {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* Upload Drop Zone */
.dropzone {
  background: var(--bg-secondary);
  border: 2px dashed var(--border-glass);
  border-radius: var(--radius-xl);
  padding: 3.5rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.dropzone:hover, .dropzone.dragover {
  border-color: var(--primary);
  background: var(--primary-light);
  transform: scale(1.008);
}

.dropzone-icon {
  width: 68px;
  height: 68px;
  border-radius: var(--radius-lg);
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.25rem;
}

.dropzone-title {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.dropzone-hint {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

.btn-upload {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--primary);
  color: white;
  padding: 0.75rem 1.75rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 14px var(--primary-glow);
  transition: all var(--transition-fast);
}

.btn-upload:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--primary-glow);
}

/* Process Workspace / Layout */
.workspace-content {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 1.75rem;
  margin-top: 1.5rem;
}

@media (max-width: 960px) {
  .workspace-content {
    grid-template-columns: 1fr;
  }
}

.workspace-preview-panel {
  background: var(--bg-secondary);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  min-height: 450px;
  display: flex;
  flex-direction: column;
}

.workspace-options-panel {
  background: var(--bg-secondary);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.panel-title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

/* File list in Merge Tool */
.file-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 480px;
  overflow-y: auto;
  padding-right: 0.5rem;
}

.file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

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

.file-item-info {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  overflow: hidden;
}

.file-item-icon {
  color: #ef4444;
  flex-shrink: 0;
}

.file-item-name {
  font-size: 0.95rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 320px;
}

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

.file-item-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.btn-icon {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 0.4rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.btn-icon:hover {
  background: var(--bg-glass);
  color: var(--text-primary);
}

.btn-icon.delete:hover {
  background: var(--accent-red-light);
  color: var(--accent-red);
}

/* Page Thumbnails Grid (Split / Remove) */
.page-thumbnails-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 1rem;
  max-height: 520px;
  overflow-y: auto;
  padding: 0.5rem;
}

.page-thumb-card {
  background: var(--bg-tertiary);
  border: 2px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  position: relative;
  transition: all var(--transition-fast);
  user-select: none;
}

.page-thumb-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}

.page-thumb-card.selected {
  border-color: var(--primary);
  background: var(--primary-light);
}

.page-thumb-card.to-delete {
  border-color: var(--accent-red);
  background: var(--accent-red-light);
  opacity: 0.65;
}

.page-thumb-card.to-delete .page-canvas {
  filter: grayscale(80%);
}

.page-thumb-card.to-delete::after {
  content: '✕ REMOVE';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-15deg);
  background: var(--accent-red);
  color: white;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 10px rgba(220, 38, 38, 0.4);
}

.page-canvas {
  max-width: 100%;
  height: auto;
  box-shadow: var(--shadow-sm);
  border-radius: 4px;
  background: white;
}

.page-number-tag {
  font-size: 0.75rem;
  font-weight: 700;
  margin-top: 0.4rem;
  color: var(--text-secondary);
}

/* Primary Action Buttons */
.btn-primary-action {
  width: 100%;
  padding: 0.85rem 1.5rem;
  background: linear-gradient(135deg, var(--primary) 0%, #4338ca 100%);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  box-shadow: 0 4px 14px var(--primary-glow);
  transition: all var(--transition-fast);
}

.btn-primary-action:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--primary-glow);
}

.btn-primary-action:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Form Controls & Option Groups */
.option-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.option-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.input-text, .input-select {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-glass);
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
  transition: border-color var(--transition-fast);
}

.input-text:focus, .input-select:focus {
  border-color: var(--primary);
}

.quick-btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.btn-chip {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-glass);
  color: var(--text-secondary);
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

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

/* Compression Levels Selector */
.compression-cards {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.compression-card {
  border: 2px solid var(--border-glass);
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

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

.compression-card.active {
  border-color: var(--primary);
  background: var(--primary-light);
}

.compression-card-title {
  font-weight: 700;
  font-size: 0.95rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.compression-card-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 0.2rem;
}

/* Sign PDF - Signature Pad & Modals */
.signature-preview-box {
  border: 2px dashed var(--border-glass);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  text-align: center;
  min-height: 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  background: var(--bg-tertiary);
}

.signature-img-preview {
  max-height: 90px;
  max-width: 100%;
  object-fit: contain;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-backdrop.active {
  display: flex;
  animation: fadeIn 0.2s ease;
}

.modal-dialog {
  background: var(--bg-secondary);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 580px;
  box-shadow: var(--shadow-xl);
  overflow: hidden;
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-glass);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-glass);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* Tabs */
.tabs {
  display: flex;
  border-bottom: 1px solid var(--border-glass);
  margin-bottom: 1.25rem;
}

.tab-btn {
  flex: 1;
  padding: 0.75rem;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

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

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

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

.signature-canvas-container {
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  background: #ffffff;
  position: relative;
  touch-action: none;
}

#signature-canvas {
  width: 100%;
  height: 200px;
  display: block;
  cursor: crosshair;
}

/* Interactive PDF Viewer for Sign & Edit */
.canvas-editor-wrapper {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: auto;
  max-height: 650px;
  background: #475569;
  padding: 1.5rem;
  border-radius: var(--radius-md);
  user-select: none;
}

.pdf-page-container {
  position: relative;
  box-shadow: 0 10px 25px rgba(0,0,0,0.3);
  background: white;
  margin: 0 auto;
}

.pdf-annotation-layer {
  position: absolute;
  inset: 0;
  pointer-events: auto;
}

/* Floating Draggable Signature Element */
.placed-element {
  position: absolute;
  cursor: move;
  border: 2px dashed var(--primary);
  user-select: none;
  touch-action: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.placed-element .remove-handle {
  position: absolute;
  top: -10px;
  right: -10px;
  background: var(--accent-red);
  color: white;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

.placed-element .resize-handle {
  position: absolute;
  bottom: -6px;
  right: -6px;
  background: var(--primary);
  border: 2px solid white;
  border-radius: 50%;
  width: 14px;
  height: 14px;
  cursor: nwse-resize;
}

/* Editor Toolbar */
.editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.75rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
  align-items: center;
}

.tool-btn {
  padding: 0.5rem 0.85rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.85rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

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

/* Progress & Result Box */
.process-overlay {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 3rem 1rem;
  text-align: center;
}

.process-overlay.active {
  display: flex;
}

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

.progress-bar-container {
  width: 100%;
  max-width: 380px;
  height: 8px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-top: 0.5rem;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary) 0%, #8b5cf6 100%);
  width: 0%;
  transition: width 0.25s ease;
}

.result-card {
  display: none;
  background: var(--bg-secondary);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xl);
  padding: 2.5rem;
  text-align: center;
  max-width: 550px;
  margin: 2rem auto;
  box-shadow: var(--shadow-lg);
  animation: scaleUp 0.3s ease;
}

.result-card.active {
  display: block;
}

.result-icon {
  width: 72px;
  height: 72px;
  background: var(--accent-green-light);
  color: var(--accent-green);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.25rem;
  font-size: 2rem;
}

.result-title {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.result-desc {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
}

.result-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-glass);
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xl);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9rem;
  font-weight: 500;
  animation: slideInRight 0.25s ease;
}

.toast.success { border-left: 4px solid var(--accent-green); }
.toast.error { border-left: 4px solid var(--accent-red); }
.toast.info { border-left: 4px solid var(--primary); }

/* Footer */
.footer {
  margin-top: auto;
  border-top: 1px solid var(--border-glass);
  padding: 3.5rem 1.5rem 2rem;
  background: var(--bg-secondary);
  font-size: 0.88rem;
  color: var(--text-secondary);
  position: relative;
}

.footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #1e40af 0%, #3b82f6 30%, #ef4444 60%, #f59e0b 100%);
  opacity: 0.9;
}

.footer-top-brand {
  max-width: 1200px;
  margin: 0 auto 2.5rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border-glass);
}

.footer-brand-logo {
  width: 60px;
  height: 60px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 4px 10px rgba(30, 64, 175, 0.15));
}

.footer-brand-text {
  text-align: left;
}

.footer-title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: 0.04em;
  margin-bottom: 0.35rem;
}

.footer-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  max-width: 800px;
  line-height: 1.5;
  margin: 0;
}

.footer-links-grid {
  max-width: 1200px;
  margin: 0 auto 2.5rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2rem;
  text-align: left;
}

.footer-col h5 {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 1rem;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-bottom: 0;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.85rem;
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.footer-links a:hover {
  color: var(--primary);
  transform: translateX(4px);
}

.footer-bottom {
  max-width: 1200px;
  margin: 0 auto;
  padding-top: 1.75rem;
  border-top: 1px solid var(--border-glass);
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-muted);
}

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

/* Mobile Responsiveness for Header & Footer */
@media (max-width: 900px) {
  .navbar {
    padding: 0.75rem 1rem;
    flex-wrap: wrap;
  }
  .nav-links-wrap {
    order: 3;
    width: 100%;
    overflow-x: auto;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-glass);
    justify-content: flex-start;
  }
  .hero-title {
    font-size: 2.2rem;
  }
  .footer-top-brand {
    flex-direction: column;
    text-align: center;
  }
  .footer-brand-text {
    text-align: center;
  }
}

@media (max-width: 600px) {
  .top-announcement-bar {
    display: none;
  }
  .privacy-pill {
    display: none;
  }
  .hero-title {
    font-size: 1.85rem;
  }
  .hero-subtitle {
    font-size: 0.95rem;
  }
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes scaleUp {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(50px); }
  to { opacity: 1; transform: translateX(0); }
}

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

