/* PDFToolz Pro - Complete Stylesheet */
:root {
  --primary: #1ABC9C;
  --primary-dark: #16A085;
  --primary-light: #E8F8F5;
  --dark: #2C3E50;
  --darker: #1a252f;
  --gray: #7f8c8d;
  --light-gray: #ecf0f1;
  --bg: #f8f9fa;
  --white: #ffffff;
  --danger: #e74c3c;
  --warning: #f39c12;
  --success: #27ae60;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
  --radius: 12px;
  --radius-sm: 8px;
  --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-mono: 'SF Mono', Monaco, monospace;
}

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--dark);
  line-height: 1.6;
  min-height: 100vh;
}

/* Header */
.header {
  background: var(--white);
  border-bottom: 1px solid var(--light-gray);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: var(--shadow);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

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

.logo-icon {
  width: 36px; height: 36px;
  background: var(--primary);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 1.1rem;
}

.nav-links {
  display: flex;
  gap: 28px;
  list-style: none;
}

.nav-links a {
  text-decoration: none;
  color: var(--gray);
  font-weight: 500;
  font-size: 0.95rem;
  transition: color 0.2s;
  position: relative;
}

.nav-links a:hover, .nav-links a.active {
  color: var(--primary-dark);
}

.nav-links a.active::after {
  content: '';
  position: absolute;
  bottom: -22px;
  left: 0; right: 0;
  height: 3px;
  background: var(--primary);
  border-radius: 2px;
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  color: var(--dark);
}

/* Hero */
.hero {
  background: linear-gradient(135deg, var(--dark) 0%, var(--darker) 100%);
  color: white;
  padding: 80px 20px;
  text-align: center;
}

.hero h1 {
  font-size: 3rem;
  font-weight: 800;
  margin-bottom: 16px;
  letter-spacing: -0.02em;
}

.hero p {
  font-size: 1.2rem;
  opacity: 0.85;
  max-width: 600px;
  margin: 0 auto 32px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(26,188,156,0.2);
  color: var(--primary);
  padding: 8px 18px;
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 600;
  border: 1px solid rgba(26,188,156,0.3);
}

/* Tool Grid */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 20px;
}

.section-title {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--dark);
}

.section-subtitle {
  color: var(--gray);
  margin-bottom: 32px;
}

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

.tool-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  border: 1px solid transparent;
}

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

.tool-icon {
  width: 52px; height: 52px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 16px;
}

.tool-card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.tool-card p {
  font-size: 0.9rem;
  color: var(--gray);
  line-height: 1.5;
  flex: 1;
}

.tool-tag {
  display: inline-block;
  margin-top: 14px;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 50px;
  background: var(--primary-light);
  color: var(--primary-dark);
  width: fit-content;
}

/* Tool Page */
.tool-page {
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 20px;
}

.tool-header {
  text-align: center;
  margin-bottom: 40px;
}

.tool-header h1 {
  font-size: 2rem;
  margin-bottom: 8px;
}

.tool-header p {
  color: var(--gray);
}

/* Upload Zone */
.upload-zone {
  border: 2px dashed var(--light-gray);
  border-radius: var(--radius);
  padding: 60px 40px;
  text-align: center;
  background: var(--white);
  transition: all 0.3s;
  cursor: pointer;
  margin-bottom: 30px;
}

.upload-zone:hover, .upload-zone.dragover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.upload-zone .icon {
  font-size: 3rem;
  margin-bottom: 16px;
  opacity: 0.5;
}

.upload-zone h3 {
  font-size: 1.2rem;
  margin-bottom: 8px;
}

.upload-zone p {
  color: var(--gray);
  font-size: 0.9rem;
}

.upload-zone input[type="file"] {
  display: none;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--light-gray);
  color: var(--dark);
}

.btn-secondary:hover {
  background: #d5dbdb;
}

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.85rem;
}

.btn-group {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 20px;
}

/* Card */
.card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}

.card-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Form Elements */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 6px;
  color: var(--dark);
}

.form-control {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--light-gray);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color 0.2s;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26,188,156,0.1);
}

select.form-control {
  cursor: pointer;
}

/* Range Slider */
.range-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.range-wrap input[type="range"] {
  flex: 1;
  -webkit-appearance: none;
  height: 6px;
  border-radius: 3px;
  background: var(--light-gray);
  outline: none;
}

.range-wrap input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
}

.range-value {
  min-width: 50px;
  text-align: center;
  font-weight: 700;
  color: var(--primary-dark);
  font-family: var(--font-mono);
}

/* File List */
.file-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.file-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  border: 1px solid var(--light-gray);
}

.file-item .file-icon {
  font-size: 1.4rem;
}

.file-item .file-info {
  flex: 1;
}

.file-item .file-name {
  font-weight: 600;
  font-size: 0.9rem;
}

.file-item .file-size {
  font-size: 0.8rem;
  color: var(--gray);
}

.file-item .file-actions {
  display: flex;
  gap: 6px;
}

.file-item .file-actions button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  color: var(--gray);
  transition: all 0.2s;
}

.file-item .file-actions button:hover {
  background: var(--light-gray);
  color: var(--dark);
}

/* Thumbnails */
.thumb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.thumb-item {
  background: var(--white);
  border: 2px solid var(--light-gray);
  border-radius: var(--radius-sm);
  padding: 8px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

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

.thumb-item.selected {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26,188,156,0.2);
}

.thumb-item img, .thumb-item canvas {
  width: 100%;
  height: 120px;
  object-fit: contain;
  border-radius: 4px;
  background: var(--bg);
}

.thumb-item .page-num {
  font-size: 0.8rem;
  color: var(--gray);
  margin-top: 6px;
  font-weight: 600;
}

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

.toast {
  background: var(--dark);
  color: white;
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideIn 0.3s ease;
  min-width: 280px;
}

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

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

/* Progress */
.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--light-gray);
  border-radius: 4px;
  overflow: hidden;
  margin: 16px 0;
}

.progress-bar .fill {
  height: 100%;
  background: var(--primary);
  border-radius: 4px;
  transition: width 0.3s ease;
  width: 0%;
}

/* Editor Specific */
.editor-workspace {
  display: flex;
  gap: 20px;
  height: calc(100vh - 180px);
  min-height: 500px;
}

.editor-sidebar {
  width: 220px;
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  overflow-y: auto;
}

.editor-main {
  flex: 1;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: auto;
  position: relative;
}

.editor-toolbar {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--light-gray);
  background: var(--bg);
  border-radius: var(--radius) var(--radius) 0 0;
  flex-wrap: wrap;
}

.toolbar-btn {
  padding: 8px 14px;
  border: 1px solid var(--light-gray);
  background: var(--white);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}

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

.page-canvas-wrap {
  padding: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 30px;
}

.page-view {
  position: relative;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  background: white;
}

.page-view canvas {
  display: block;
}

.annotation-layer {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  cursor: crosshair;
}

/* Blog */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 28px;
  margin-top: 32px;
}

.blog-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: all 0.3s;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
}

.blog-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.blog-card-img {
  height: 180px;
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
}

.blog-card-body {
  padding: 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.blog-card-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--primary-dark);
  background: var(--primary-light);
  padding: 4px 10px;
  border-radius: 50px;
  margin-bottom: 10px;
  width: fit-content;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.blog-card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 10px;
  line-height: 1.4;
}

.blog-card p {
  color: var(--gray);
  font-size: 0.9rem;
  line-height: 1.6;
  flex: 1;
}

.blog-card-meta {
  display: flex;
  gap: 16px;
  margin-top: 16px;
  font-size: 0.8rem;
  color: var(--gray);
  border-top: 1px solid var(--light-gray);
  padding-top: 14px;
}

/* Blog Post */
.blog-post {
  max-width: 800px;
  margin: 0 auto;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.blog-post-header {
  padding: 48px 48px 32px;
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--white) 100%);
}

.blog-post-tag {
  display: inline-block;
  background: var(--primary);
  color: white;
  padding: 6px 14px;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 16px;
}

.blog-post-header h1 {
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1.3;
  margin-bottom: 20px;
  color: var(--dark);
}

.blog-post-meta {
  display: flex;
  gap: 20px;
  color: var(--gray);
  font-size: 0.9rem;
}

.blog-post-body {
  padding: 40px 48px;
  font-size: 1.05rem;
  line-height: 1.8;
  color: #444;
}

.blog-post-body h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 36px 0 16px;
  color: var(--dark);
}

.blog-post-body h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 28px 0 12px;
  color: var(--dark);
}

.blog-post-body p {
  margin-bottom: 18px;
}

.blog-post-body ul, .blog-post-body ol {
  margin-bottom: 18px;
  padding-left: 24px;
}

.blog-post-body li {
  margin-bottom: 8px;
}

.blog-post-body strong {
  color: var(--dark);
}

.blog-post-body a {
  color: var(--primary-dark);
  text-decoration: none;
  font-weight: 600;
}

.blog-post-body a:hover {
  text-decoration: underline;
}

.blog-post-body img {
  max-width: 100%;
  border-radius: var(--radius-sm);
  margin: 20px 0;
}

.blog-post-body blockquote {
  border-left: 4px solid var(--primary);
  padding-left: 20px;
  margin: 24px 0;
  color: var(--gray);
  font-style: italic;
}

.blog-cta {
  background: var(--primary-light);
  border-radius: var(--radius-sm);
  padding: 28px;
  margin: 32px 0;
  text-align: center;
}

.blog-cta h3 {
  margin-bottom: 8px !important;
  margin-top: 0 !important;
}

.blog-cta p {
  margin-bottom: 16px;
  color: var(--gray);
}

/* Footer */
.footer {
  background: var(--dark);
  color: white;
  padding: 60px 20px 30px;
  margin-top: 60px;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 40px;
}

.footer-brand .logo {
  color: white;
  margin-bottom: 12px;
}

.footer-brand p {
  opacity: 0.7;
  font-size: 0.9rem;
  line-height: 1.6;
}

.footer h4 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--primary);
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: 10px;
}

.footer-links a {
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s;
}

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

.footer-bottom {
  max-width: 1200px;
  margin: 40px auto 0;
  padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,0.1);
  text-align: center;
  font-size: 0.85rem;
  opacity: 0.6;
}

/* Responsive */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .mobile-menu-btn { display: block; }
  .hero h1 { font-size: 2rem; }
  .hero p { font-size: 1rem; }
  .tools-grid { grid-template-columns: 1fr; }
  .editor-workspace { flex-direction: column; height: auto; }
  .editor-sidebar { width: 100%; }
  .blog-post-header, .blog-post-body { padding: 24px; }
  .blog-post-header h1 { font-size: 1.6rem; }
  .thumb-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Utility */
.hidden { display: none !important; }
.text-center { text-align: center; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-2 { margin-bottom: 16px; }
.w-full { width: 100%; }
