/* ==========================================================================
   JEET EDUCATION PDF SUITE - MODERN DESIGN SYSTEM & STYLESHEET
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
  /* Firefox Theme - Default Light Mode */
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f1f5f9;
  --bg-glass: rgba(255, 255, 255, 0.88);
  --border-color: #e2e8f0;
  --border-hover: #cbd5e1;

  --text-main: #0f172a;          /* Dark Slate Black for Light Mode */
  --text-muted: #475569;         /* Dark Muted Gray for Light Mode */
  --text-inverse: #ffffff;

  --primary: #7542e5;            /* Firefox Signature Button Violet */
  --primary-hover: #6366f1;
  --primary-light: #eef2ff;
  --primary-glow: rgba(117, 66, 229, 0.25);

  --firefox-gradient: linear-gradient(135deg, #7542e5 0%, #c026d3 40%, #ea580c 80%, #f97316 100%);
  --firefox-glow: 0 10px 30px -5px rgba(117, 66, 229, 0.35);

  --accent-cyan: #0284c7;
  --accent-teal: #0d9488;
  --accent-orange: #ea580c;
  --accent-rose: #e11d48;
  --accent-purple: #9333ea;
  --accent-amber: #d97706;
  --accent-green: #059669;

  --jeet-navy: #15002c;
  --jeet-gold: #f59e0b;

  --shadow-sm: 0 2px 6px rgba(0,0,0,0.05);
  --shadow-md: 0 8px 24px -6px rgba(0,0,0,0.08);
  --shadow-lg: 0 20px 40px -10px rgba(0,0,0,0.12);
  --shadow-glow: 0 0 35px rgba(117, 66, 229, 0.3);

  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 28px;
  --radius-full: 9999px;

  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

[data-theme="dark"] {
  /* Firefox Deep Purple Palette - Dark Mode */
  --bg-primary: #15002c;         /* Deep Firefox Midnight Purple */
  --bg-secondary: #23044b;       /* Firefox Violet Card Container */
  --bg-tertiary: #34096e;        /* Elevated Violet Panel */
  --bg-glass: rgba(35, 4, 75, 0.85);
  --border-color: rgba(167, 139, 250, 0.22);
  --border-hover: rgba(196, 181, 253, 0.55);

  --text-main: #ffffff;          /* Pure White for Dark Mode */
  --text-muted: #c4b5fd;         /* Soft Lavender Sub-text for Dark Mode */
  --text-inverse: #15002c;

  --primary-light: rgba(117, 66, 229, 0.25);
  --shadow-md: 0 10px 30px -5px rgba(0,0,0,0.4);
  --shadow-lg: 0 25px 50px -12px rgba(0,0,0,0.6);
}

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

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

h1, h2, h3, h4, h5, h6 {
  font-family: 'Outfit', sans-serif;
  color: var(--text-main);
  font-weight: 700;
  line-height: 1.25;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}
a:hover {
  color: var(--primary-hover);
}

/* Navbar */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  padding: 0.85rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background-color var(--transition-normal);
}

.brand-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}

.brand-logo {
  width: 44px;
  height: 44px;
  background: var(--firefox-gradient);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.35rem;
  box-shadow: var(--firefox-glow);
}

.brand-title {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-family: 'Outfit', sans-serif;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.5px;
}
.brand-name span {
  background: var(--firefox-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-subtitle {
  font-size: 0.75rem;
  color: var(--jeet-gold);
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  list-style: none;
}

.nav-link {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}
.nav-link:hover, .nav-link.active {
  color: var(--primary);
  background: var(--primary-light);
}

/* Nav Dropdowns & Mega Menu */
.nav-dropdown {
  position: relative;
}

.nav-dropdown-toggle {
  cursor: pointer;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 1.25rem;
  display: none;
  min-width: 260px;
  z-index: 200;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.dropdown-menu::before {
  content: '';
  position: absolute;
  top: -12px;
  left: 0;
  width: 100%;
  height: 12px;
}

.nav-dropdown:hover .dropdown-menu {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

.mega-menu {
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  width: 960px;
  max-width: 95vw;
}

.nav-dropdown:hover .mega-menu {
  transform: translateX(-50%) translateY(0);
}

.mega-dropdown-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
}

.dropdown-category-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--primary);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border-color);
}

.dropdown-tool-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.dropdown-tool-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.dropdown-tool-item i {
  width: 20px;
  text-align: center;
  color: var(--primary);
  font-size: 0.95rem;
}
.dropdown-tool-item:hover {
  background: linear-gradient(135deg, #481193 0%, #30076f 100%);
  color: #ffffff;
  transform: translateX(4px);
}
.dropdown-tool-item:hover i {
  color: #ffffff;
}

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

.btn-gopro {
  background: var(--firefox-gradient);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.55rem 1.15rem;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: var(--firefox-glow);
  transition: all var(--transition-fast);
  border: none;
  cursor: pointer;
  white-space: nowrap;
}
.btn-gopro:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 12px 28px -4px rgba(168, 85, 247, 0.5);
  color: #ffffff;
}

.btn-icon {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.1rem;
  transition: all var(--transition-fast);
}
.btn-icon:hover {
  background: var(--border-hover);
  transform: translateY(-2px);
}

/* Hero Section - Firefox Top Curved Arch Banner */
.hero-section {
  position: relative;
  padding: 5.5rem 2rem 4.5rem 2rem;
  text-align: center;
  background: linear-gradient(180deg, #481193 0%, #30076f 55%, #15002c 100%);
  border-bottom-left-radius: 60px;
  border-bottom-right-radius: 60px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
  margin-bottom: 2.5rem;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(117, 66, 229, 0.12);
  color: var(--primary);
  border: 1px solid rgba(117, 66, 229, 0.3);
  padding: 0.4rem 1.1rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  box-shadow: 0 4px 15px rgba(117, 66, 229, 0.12);
  animation: pulseBadge 2s infinite ease-in-out;
}

.hero-section .hero-badge {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

@keyframes pulseBadge {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.02); opacity: 0.9; }
}

.hero-title {
  font-size: 3rem;
  font-weight: 800;
  letter-spacing: -1.2px;
  max-width: 880px;
  margin: 0 auto 1.25rem auto;
  line-height: 1.18;
  color: #ffffff !important;
}
.hero-title .gradient-text {
  background: linear-gradient(135deg, #c084fc 0%, #f472b6 40%, #fb923c 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 1.2rem;
  color: #e0e7ff !important;
  max-width: 680px;
  margin: 0 auto 2.25rem auto;
  font-weight: 400;
}

.hero-features {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
  margin-bottom: 2.75rem;
}

.feature-pill {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.12);
  padding: 0.45rem 1.1rem;
  border-radius: var(--radius-full);
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: var(--shadow-sm);
}
.feature-pill i {
  color: #34d399;
}

/* Search Bar - Firefox Styled Glow Input */
.search-container {
  max-width: 580px;
  margin: 0 auto;
  position: relative;
}

.search-input {
  width: 100%;
  padding: 1.1rem 1.35rem 1.1rem 3.5rem;
  border-radius: var(--radius-full);
  border: 2px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-main);
  font-size: 1.05rem;
  outline: none;
  box-shadow: var(--shadow-md);
  transition: all var(--transition-normal);
}
.search-input:focus {
  border-color: var(--primary);
  box-shadow: var(--shadow-glow), 0 0 0 4px rgba(99, 102, 241, 0.15);
}

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

/* Main Content & Tools Grid */
.main-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1rem 2rem 5rem 2rem;
  width: 100%;
  flex: 1;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.section-title {
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text-main);
}

.tools-category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3.5rem;
}

/* Tool Card - Firefox Rounded Violet Container */
.tool-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.85rem 1.6rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all var(--transition-bounce);
  box-shadow: var(--shadow-md);
}

.tool-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--firefox-gradient);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.tool-card:hover {
  transform: translateY(-8px);
  border-color: rgba(168, 85, 247, 0.5);
  box-shadow: 0 16px 36px rgba(21, 0, 44, 0.45), 0 0 25px rgba(117, 66, 229, 0.35);
  background: linear-gradient(135deg, #481193 0%, #30076f 55%, #15002c 100%) !important;
  color: #ffffff !important;
}

.tool-card:hover .tool-title-text,
.tool-card:hover .tool-name {
  color: #ffffff !important;
}

.tool-card:hover .tool-desc {
  color: rgba(255, 255, 255, 0.9) !important;
}

.tool-card:hover .tool-icon-wrapper {
  background: rgba(255, 255, 255, 0.2) !important;
  color: #ffffff !important;
  transform: scale(1.1) rotate(-4deg);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
}

.tool-card:hover .tool-tag {
  background: rgba(255, 255, 255, 0.25) !important;
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.4);
}

.tool-card:hover::before {
  opacity: 1;
}

.tool-card-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
}

.tool-name-group {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
  flex: 1;
}

.tool-title-text {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.25;
}

.tool-icon-wrapper {
  width: 50px;
  height: 50px;
  border-radius: var(--radius-md);
  background: var(--card-bg-light, rgba(117, 66, 229, 0.12));
  color: var(--card-accent, var(--primary));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
  transition: transform var(--transition-fast);
}
.tool-info {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.tool-name {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tool-tag {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.tool-tag.popular { background: rgba(245, 158, 11, 0.15); color: var(--accent-amber); }
.tool-tag.new { background: rgba(16, 185, 129, 0.15); color: var(--accent-green); }

.tool-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.45;
}

/* SEJDA STYLE PDF EDITOR TOOLBAR & PAGE CONTROLS */
#pdf-editor-container {
  width: 100% !important;
  height: 650px !important;
  max-height: 75vh !important;
  overflow: auto !important;
  display: block !important;
  padding: 1.5rem !important;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  box-sizing: border-box;
  scrollbar-width: auto !important;
  scrollbar-color: var(--primary) var(--bg-secondary) !important;
}

#pdf-editor-container::-webkit-scrollbar {
  width: 14px !important;
  height: 14px !important;
  display: block !important;
}
#pdf-editor-container::-webkit-scrollbar-track {
  background: var(--bg-secondary) !important;
  border-radius: 8px !important;
}
#pdf-editor-container::-webkit-scrollbar-thumb {
  background: var(--primary) !important;
  border-radius: 8px !important;
  border: 3px solid var(--bg-secondary) !important;
}
#pdf-editor-container::-webkit-scrollbar-thumb:hover {
  background: #481193 !important;
}

.pdf-editor-page-wrapper {
  margin: 0 auto 2rem auto !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25) !important;
  border-radius: 8px !important;
  background: #ffffff !important;
}

.sejda-btn {
  background: var(--bg-secondary);
  border: none;
  border-right: 1px solid rgba(56, 189, 248, 0.25);
  color: #0284c7;
  font-weight: 600;
  font-size: 0.88rem;
  padding: 0.55rem 0.95rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.sejda-btn:hover, .sejda-btn.active {
  background: rgba(56, 189, 248, 0.15);
  color: #0369a1;
}
.sejda-btn-arrow {
  background: var(--bg-secondary);
  border: none;
  border-right: 1px solid rgba(56, 189, 248, 0.25);
  color: #0284c7;
  padding: 0.55rem 0.45rem;
  cursor: pointer;
}
.sejda-btn-arrow:hover {
  background: rgba(56, 189, 248, 0.15);
}
.sejda-icon-btn {
  background: var(--bg-secondary);
  border: none;
  border-right: 1px solid rgba(56, 189, 248, 0.25);
  color: #0284c7;
  padding: 0.45rem 0.7rem;
  cursor: pointer;
  font-size: 0.9rem;
}
.sejda-icon-btn:hover {
  background: rgba(56, 189, 248, 0.15);
}
.sejda-menu-item {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 0.45rem 0.75rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-main);
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.sejda-menu-item:hover {
  background: var(--primary-light);
  color: var(--primary);
}
.workspace-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.workspace-overlay.active {
  display: flex;
  opacity: 1;
}

.workspace-container {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 1100px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  animation: modalSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.modal-close-btn {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 100;
  transition: all var(--transition-fast);
}
.modal-close-btn:hover {
  background: #f43f5e;
  color: #ffffff;
  border-color: #f43f5e;
  transform: rotate(90deg) scale(1.1);
}

@keyframes modalSlideUp {
  from { transform: translateY(30px) scale(0.97); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

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

.workspace-title-group {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.workspace-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.workspace-title {
  font-size: 1.25rem;
  font-weight: 700;
}

.workspace-body {
  padding: 2rem;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Dropzone */
.dropzone {
  border: 2px dashed var(--border-hover);
  border-radius: var(--radius-lg);
  padding: 3.5rem 2rem;
  text-align: center;
  background: var(--bg-primary);
  cursor: pointer;
  transition: all var(--transition-normal);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.dropzone:hover, .dropzone.drag-over {
  border-color: var(--primary);
  background: var(--primary-light);
  transform: scale(1.005);
}

.dropzone-icon {
  width: 70px;
  height: 70px;
  border-radius: var(--radius-full);
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
}

.dropzone-text {
  font-size: 1.15rem;
  font-weight: 600;
}
.dropzone-subtext {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* File List & Thumbnails Grid */
.file-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 1.25rem;
  margin-top: 1rem;
}

.page-thumb-card {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  transition: all var(--transition-fast);
}
.page-thumb-card[draggable="true"] {
  cursor: grab;
}
.page-thumb-card[draggable="true"]:active {
  cursor: grabbing;
}
.page-thumb-card.dragging {
  opacity: 0.4;
  transform: scale(0.95);
  border: 2px dashed var(--primary);
}
.page-thumb-card.drag-over-card {
  border: 2px solid var(--accent-green);
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.4);
  transform: translateY(-4px);
}
.page-thumb-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}

.page-thumb-canvas-wrapper {
  width: 100%;
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #fff;
  border-radius: var(--radius-sm);
  position: relative;
}

.page-thumb-canvas-wrapper canvas, .page-thumb-canvas-wrapper img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.page-thumb-footer {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.page-actions {
  display: flex;
  gap: 0.25rem;
}

.btn-thumb-action {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  width: 26px;
  height: 26px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.75rem;
}
.btn-thumb-action:hover {
  background: var(--accent-rose);
  color: #fff;
  border-color: var(--accent-rose);
}

/* Tool Settings Toolbar */
.settings-panel {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  align-items: center;
}

.setting-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  flex: 1;
  min-width: 200px;
}

.setting-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.setting-input, .setting-select {
  padding: 0.6rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-main);
  font-size: 0.95rem;
  outline: none;
}
.setting-input:focus, .setting-select:focus {
  border-color: var(--primary);
}

/* Buttons */
.btn {
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: none;
  transition: all var(--transition-fast);
  outline: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  color: #fff;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.45);
}

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}
.btn-secondary:hover {
  background: var(--border-hover);
}

.btn-success {
  background: linear-gradient(135deg, var(--accent-green), #059669);
  color: #fff;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
}
.btn-success:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(16, 185, 129, 0.45);
}

.workspace-footer {
  padding: 1.25rem 1.75rem;
  border-top: 1px solid var(--border-color);
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* PDF Canvas Editor Special Styles */
.editor-toolbar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-tertiary);
  padding: 0.6rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  flex-wrap: wrap;
}

.editor-btn {
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.editor-btn.active, .editor-btn:hover {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
}

.canvas-viewport {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  background: #475569;
  padding: 2rem;
  border-radius: var(--radius-md);
  overflow-x: auto;
  max-height: 60vh;
}

.pdf-editor-page-wrapper {
  position: relative;
  box-shadow: var(--shadow-lg);
  background: #fff;
}

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

.toast {
  background: var(--bg-secondary);
  color: var(--text-main);
  border-left: 4px solid var(--primary);
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.95rem;
  animation: toastIn 0.3s ease;
}
.toast.success { border-left-color: var(--accent-green); }
.toast.error { border-left-color: var(--accent-rose); }

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

/* Business Info Footer */
.footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: 3.5rem 2rem 2rem 2rem;
  margin-top: auto;
}

.footer-content {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 2.5rem;
  margin-bottom: 2.5rem;
}

.footer-col h4 {
  font-size: 1.1rem;
  margin-bottom: 1.25rem;
  color: var(--text-main);
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.footer-links a {
  color: var(--text-muted);
  font-size: 0.9rem;
}
.footer-links a:hover {
  color: var(--primary);
}

.footer-bottom {
  max-width: 1280px;
  margin: 0 auto;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Responsive Breakpoints */
@media (max-width: 768px) {
  .navbar { padding: 0.75rem 1rem; }
  .hero-title { font-size: 2rem; }
  .hero-subtitle { font-size: 1rem; }
  .main-container { padding: 1rem; }
  .tools-category-grid { grid-template-columns: 1fr; }
  .workspace-container { max-height: 95vh; margin: 0.5rem; }
}

/* ==========================================================================
   PRE-DOWNLOAD PREVIEW SCREEN & IMAGE RESIZER / REDUCER STYLES
   ========================================================================== */

.preview-result-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  width: 100%;
  padding: 1rem 0;
  animation: fadeIn 0.3s ease;
}

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

.preview-status-header {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.preview-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-green);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 0.4rem 1.2rem;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 0.95rem;
}

.preview-viewport {
  width: 100%;
  max-width: 700px;
  max-height: 380px;
  background: var(--bg-tertiary);
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  padding: 1rem;
}

.preview-viewport img, .preview-viewport canvas {
  max-width: 100%;
  max-height: 340px;
  object-fit: contain;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  background: #fff;
}

.preview-stats-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  width: 100%;
  max-width: 700px;
  background: var(--bg-tertiary);
  padding: 1rem 1.5rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.stat-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 0.82rem;
  color: var(--text-muted);
}
.stat-pill strong {
  font-size: 1.05rem;
  color: var(--text-main);
  font-weight: 700;
}

.stat-pill.savings strong {
  color: var(--accent-green);
}

.preview-actions-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  width: 100%;
  margin-top: 0.5rem;
}

/* Image Resizer & Reducer Settings Grid */
.resizer-inputs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.25rem;
  width: 100%;
}

.aspect-ratio-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
}

/* Pre-Download Resizer Panel */
.predownload-resizer-panel {
  width: 100%;
  max-width: 700px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.resizer-panel-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.page-selector-pills {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.35rem;
}

.page-pill {
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
}
.page-pill.active, .page-pill:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* ==========================================================================
   SMALLPDF-STYLE DEDICATED TOOL PAGES & TWO-COLUMN WORKSPACE LAYOUT
   ========================================================================== */

.tool-workspace-page {
  min-height: calc(100vh - 80px);
  display: flex;
  flex-direction: column;
}

.workspace-page-hero {
  position: relative;
  padding: 4.5rem 2rem 3.5rem 2rem;
  text-align: center;
  background: linear-gradient(180deg, #481193 0%, #30076f 55%, #15002c 100%);
  border-bottom-left-radius: 60px;
  border-bottom-right-radius: 60px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
  margin-bottom: 2rem;
}

.workspace-page-hero .hero-badge {
  background: rgba(255, 255, 255, 0.18) !important;
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.35) !important;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2) !important;
}

.workspace-page-title {
  font-size: 2.75rem;
  font-weight: 800;
  letter-spacing: -1px;
  max-width: 880px;
  margin: 0 auto 0.85rem auto;
  line-height: 1.2;
  color: #ffffff !important;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}
.workspace-page-title i {
  color: #c084fc !important;
}
.workspace-page-title .gradient-text {
  background: linear-gradient(135deg, #c084fc 0%, #f472b6 40%, #fb923c 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.workspace-page-subtitle {
  font-size: 1.15rem;
  color: #e0e7ff !important;
  max-width: 680px;
  margin: 0 auto;
  font-weight: 400;
}

.smallpdf-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 2rem;
  max-width: 1280px;
  margin: 0 auto;
  padding: 2.5rem 2rem 5rem 2rem;
  width: 100%;
}

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

.smallpdf-preview-main {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  box-shadow: var(--shadow-md);
  min-height: 520px;
}

.smallpdf-sidebar-options {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  box-shadow: var(--shadow-md);
  height: fit-content;
  position: sticky;
  top: 100px;
}

.sidebar-section-title {
  font-size: 1.05rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-main);
}

.smallpdf-result-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 3rem 2rem;
  max-width: 800px;
  margin: 2rem auto;
  text-align: center;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.75rem;
  animation: fadeIn 0.4s ease;
}

.result-icon-badge {
  width: 90px;
  height: 90px;
  border-radius: var(--radius-full);
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-green);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  box-shadow: 0 0 30px rgba(16, 185, 129, 0.25);
}

/* Compact Multi-File Grid & Header Toolbar */
.pdf-files-toolbar {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.25rem;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  margin-bottom: 1.25rem;
}

.pdf-files-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 1rem;
  width: 100%;
}

.compact-pdf-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.75rem 0.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  position: relative;
  overflow: visible;
  transition: all var(--transition-fast);
}
.compact-pdf-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}

.compact-pdf-icon-wrapper {
  width: 100%;
  height: 90px;
  background: var(--primary-light);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  position: relative;
}

.compact-delete-btn {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #f43f5e;
  color: #ffffff;
  border: 2px solid #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.75rem;
  z-index: 20;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  transition: all var(--transition-fast);
}
.compact-delete-btn:hover {
  background: #e11d48;
  transform: scale(1.15);
}

.compact-add-card {
  border: 2px dashed var(--border-hover);
  background: var(--bg-primary);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  min-height: 140px;
  border-radius: var(--radius-md);
  gap: 0.5rem;
  color: var(--text-muted);
  transition: all var(--transition-fast);
}
.compact-add-card:hover {
  border-color: var(--accent-green);
  background: rgba(16, 185, 129, 0.08);
  color: var(--accent-green);
  transform: translateY(-3px);
}

/* ==========================================================================
   COMPREHENSIVE RESPONSIVE DESIGN FOR ALL SCREEN SIZES
   ========================================================================== */

/* 1. Large Laptops & Desktops (max-width: 1200px) */
@media (max-width: 1200px) {
  .navbar {
    padding: 0.85rem 1.5rem;
  }
  .nav-links {
    gap: 1rem;
  }
  .nav-link {
    font-size: 0.88rem;
    padding: 0.35rem 0.6rem;
  }
  .main-container {
    max-width: 100%;
    padding: 1rem 1.5rem 4rem 1.5rem;
  }
  .smallpdf-layout {
    grid-template-columns: 1fr 300px;
    gap: 1.5rem;
    padding: 2rem 1.5rem 4rem 1.5rem;
  }
}

/* 2. Tablets & Small Laptops (max-width: 992px) */
@media (max-width: 992px) {
  .navbar {
    padding: 0.75rem 1.25rem;
  }
  .mega-menu {
    width: 90vw;
    left: 50% !important;
    transform: translateX(-50%) translateY(10px) !important;
    position: absolute;
    max-height: 75vh;
    overflow-y: auto;
  }
  .nav-dropdown:hover .mega-menu {
    transform: translateX(-50%) translateY(0) !important;
  }
  .mega-dropdown-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
  .workspace-page-hero {
    padding: 2.25rem 1.25rem 1.5rem 1.25rem;
  }
  .workspace-page-title {
    font-size: 1.85rem;
  }
  .smallpdf-layout {
    grid-template-columns: 1fr;
    padding: 1.5rem 1rem 3.5rem 1rem;
    gap: 1.5rem;
  }
  .smallpdf-sidebar-options {
    position: static;
    width: 100%;
  }
  .tools-category-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.25rem;
  }
  .footer-content {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
  }
}

/* 3. Mobile Devices & Small Tablets (max-width: 768px) */
@media (max-width: 768px) {
  .navbar {
    padding: 0.65rem 0.85rem;
    flex-wrap: wrap;
    gap: 0.6rem;
    justify-content: space-between;
  }
  .brand-container {
    gap: 0.5rem;
  }
  .brand-name {
    font-size: 1.05rem;
  }
  .brand-subtitle {
    font-size: 0.65rem;
  }
  .nav-links {
    width: 100%;
    overflow-x: auto;
    white-space: nowrap;
    flex-wrap: nowrap;
    gap: 0.5rem;
    padding: 0.4rem 0;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    border-top: 1px solid var(--border-color);
    margin-top: 0.2rem;
  }
  .nav-links::-webkit-scrollbar {
    display: none;
  }
  .nav-link {
    font-size: 0.82rem;
    padding: 0.35rem 0.6rem;
    flex-shrink: 0;
  }
  .dropdown-menu {
    position: fixed;
    top: 65px;
    left: 4% !important;
    right: 4% !important;
    width: 92% !important;
    max-width: 92vw !important;
    transform: none !important;
    max-height: 70vh;
    overflow-y: auto;
    border-radius: var(--radius-lg);
    z-index: 9999;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.4);
  }
  .mega-menu {
    left: 4% !important;
    width: 92% !important;
    transform: none !important;
  }
  .mega-dropdown-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  .hero-section {
    padding: 2.5rem 1rem;
  }
  .hero-title {
    font-size: 1.75rem;
    line-height: 1.25;
  }
  .hero-subtitle {
    font-size: 0.95rem;
  }
  .hero-search-container {
    width: 100%;
  }
  .search-input {
    font-size: 0.9rem;
    padding: 0.85rem 1rem 0.85rem 2.8rem;
  }
  .main-container {
    padding: 1rem 0.85rem 3rem 0.85rem;
  }
  .tools-category-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  .tool-card {
    padding: 1.25rem 1rem;
  }
  .workspace-page-hero {
    padding: 1.75rem 1rem 1.25rem 1rem;
  }
  .workspace-page-title {
    font-size: 1.45rem;
    flex-wrap: wrap;
    text-align: center;
    justify-content: center;
  }
  .workspace-page-subtitle {
    font-size: 0.9rem;
  }
  .smallpdf-layout {
    padding: 1rem 0.5rem 2.5rem 0.5rem;
    gap: 1.25rem;
  }
  .smallpdf-preview-main {
    padding: 1rem 0.75rem;
    min-height: auto;
  }
  .smallpdf-sidebar-options {
    padding: 1.25rem 1rem;
  }
  #pdf-editor-container {
    height: 450px !important;
    padding: 0.5rem !important;
  }
  .predownload-resizer-panel {
    padding: 1rem;
  }
  .resizer-inputs-grid {
    grid-template-columns: 1fr;
  }
  .preview-viewport {
    max-height: 260px;
    padding: 0.5rem;
  }
  .preview-stats-bar {
    flex-direction: column;
    gap: 0.6rem;
    padding: 0.75rem;
  }
  .preview-actions-bar {
    flex-direction: column;
    width: 100%;
    gap: 0.65rem;
  }
  .preview-actions-bar button,
  .preview-actions-bar a {
    width: 100%;
    justify-content: center;
    text-align: center;
  }
  .pdf-files-toolbar {
    flex-direction: column;
    gap: 0.75rem;
    align-items: stretch;
    text-align: center;
    padding: 0.75rem;
  }
  .pdf-files-grid {
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 0.75rem;
  }
  .footer {
    padding: 2.5rem 1rem 1.5rem 1rem;
  }
  .footer-content {
    grid-template-columns: 1fr;
    gap: 1.75rem;
    text-align: center;
  }
  .footer-col h4 {
    justify-content: center;
  }
  .footer-bottom {
    flex-direction: column;
    text-align: center;
    gap: 0.75rem;
  }
  .smallpdf-result-card {
    padding: 1.75rem 1rem;
    margin: 1rem 0.5rem;
    max-width: 100%;
  }
  .result-icon-badge {
    width: 70px;
    height: 70px;
    font-size: 2.2rem;
  }
}

/* 4. Small Mobile Screen (max-width: 480px) */
@media (max-width: 480px) {
  .hero-title {
    font-size: 1.45rem;
  }
  .brand-title .brand-name {
    font-size: 0.95rem;
  }
  .brand-subtitle {
    display: none;
  }
  .workspace-page-title {
    font-size: 1.3rem;
  }
  .btn-primary, .btn-secondary {
    padding: 0.6rem 1rem;
    font-size: 0.88rem;
  }
  .page-selector-pills {
    padding-bottom: 0.5rem;
  }
  .modal-dialog {
    width: 95vw;
    padding: 1.25rem;
  }
}




