/* Custom styles for Modifier-PDF / WebTools */
:root {
  --primary: #4f46e5;
  --primary-dark: #4338ca;
  --primary-light: #818cf8;
  --secondary: #0ea5e9;
  --accent: #f59e0b;
  --bg: #f8fafc;
  --bg-card: #ffffff;
  --text: #1e293b;
  --text-light: #64748b;
  --border: #e2e8f0;
  --success: #22c55e;
  --error: #ef4444;
  --radius: 12px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.site-header {
  background: white;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}
.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.logo {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary);
  text-decoration: none;
}
.logo span { color: var(--secondary); }
.nav-links { display: flex; gap: 1.5rem; align-items: center; }
.nav-links a {
  color: var(--text-light);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--primary); }

/* Language Switcher */
.lang-switch {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  background: var(--bg);
  border-radius: 8px;
  padding: 0.25rem;
  border: 1px solid var(--border);
}
.lang-btn {
  padding: 0.35rem 0.75rem;
  border: none;
  background: transparent;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-light);
  transition: all 0.2s;
}
.lang-btn.active {
  background: var(--primary);
  color: white;
}

/* Ad Banners */
.ad-banner {
  background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
  font-size: 0.85rem;
  font-weight: 500;
  min-height: 90px;
}
.ad-banner-header { min-height: 90px; margin: 0.75rem auto; max-width: 728px; width: 100%; }
.ad-banner-sidebar { min-height: 250px; }
.ad-banner-content { min-height: 90px; margin: 1.5rem 0; }

/* Hero Section */
.hero {
  background: linear-gradient(135deg, #4f46e5 0%, #0ea5e9 100%);
  color: white;
  padding: 4rem 1.5rem;
  text-align: center;
}
.hero h1 { font-size: 2.5rem; font-weight: 800; margin-bottom: 1rem; }
.hero p { font-size: 1.15rem; opacity: 0.9; max-width: 600px; margin: 0 auto; }

/* Main Content */
.main-content {
  max-width: 1280px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  flex: 1;
  width: 100%;
}

/* Tools Grid */
.section-title {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: var(--text);
}
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-bottom: 3rem;
}
.tool-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-decoration: none;
  color: inherit;
  transition: all 0.25s ease;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}
.tool-card:hover {
  border-color: var(--primary-light);
  box-shadow: 0 4px 24px rgba(79, 70, 229, 0.1);
  transform: translateY(-2px);
}
.tool-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}
.tool-icon.pdf { background: #fef2f2; color: #ef4444; }
.tool-icon.image { background: #f0fdf4; color: #22c55e; }
.tool-icon.text { background: #eff6ff; color: #3b82f6; }
.tool-icon.util { background: #fefce8; color: #f59e0b; }
.tool-card h3 { font-size: 1rem; font-weight: 600; margin-bottom: 0.35rem; }
.tool-card p { font-size: 0.875rem; color: var(--text-light); line-height: 1.5; }

/* Tool Page Layout */
.tool-page { max-width: 900px; margin: 0 auto; padding: 2rem 1.5rem; }
.tool-page h1 { font-size: 2rem; font-weight: 700; margin-bottom: 0.5rem; }
.tool-page .tool-desc { color: var(--text-light); margin-bottom: 2rem; font-size: 1.05rem; }

/* Drop Zone */
.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 3rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
  background: white;
}
.drop-zone:hover, .drop-zone.dragover {
  border-color: var(--primary);
  background: #eef2ff;
}
.drop-zone svg { width: 48px; height: 48px; color: var(--text-light); margin-bottom: 1rem; }
.drop-zone p { color: var(--text-light); }
.drop-zone .browse { color: var(--primary); font-weight: 600; cursor: pointer; }

/* File List */
.file-list { margin: 1rem 0; }
.file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: white;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 0.5rem;
}
.file-item .file-name { font-weight: 500; font-size: 0.9rem; }
.file-item .file-size { color: var(--text-light); font-size: 0.8rem; }
.file-item .remove-btn {
  background: none;
  border: none;
  color: var(--error);
  cursor: pointer;
  font-size: 1.2rem;
  padding: 0.25rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-primary:disabled { background: #a5b4fc; cursor: not-allowed; }
.btn-secondary { background: var(--bg); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--border); }
.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: #16a34a; }
.btn-group { display: flex; gap: 0.75rem; margin-top: 1.5rem; flex-wrap: wrap; }

/* Progress */
.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
  margin: 1rem 0;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: 4px;
  transition: width 0.3s ease;
}

/* Result Area */
.result-area {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-top: 1.5rem;
}

/* Options Panel */
.options-panel {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin: 1.5rem 0;
}
.option-group { margin-bottom: 1rem; }
.option-group label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}
.option-group input[type="text"],
.option-group input[type="number"],
.option-group input[type="password"],
.option-group select,
.option-group textarea {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color 0.2s;
}
.option-group input:focus,
.option-group select:focus,
.option-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}
.option-group textarea { min-height: 150px; resize: vertical; }

.option-row {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}

/* Checkbox / Toggle */
.checkbox-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.checkbox-group input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}
.checkbox-group label { font-weight: 500; font-size: 0.9rem; margin: 0; }

/* Range input */
input[type="range"] {
  width: 100%;
  accent-color: var(--primary);
}

/* Color preview */
.color-preview {
  width: 100%;
  height: 120px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-bottom: 1rem;
}

/* Page thumbnails grid */
.pages-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 1rem;
  margin: 1rem 0;
}
.page-thumb {
  position: relative;
  border: 2px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s;
}
.page-thumb.selected { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2); }
.page-thumb img { width: 100%; display: block; }
.page-thumb .page-num {
  position: absolute;
  bottom: 4px;
  right: 4px;
  background: rgba(0,0,0,0.7);
  color: white;
  font-size: 0.75rem;
  padding: 2px 6px;
  border-radius: 4px;
}

/* Sortable drag */
.page-thumb.dragging { opacity: 0.5; }
.page-thumb.drag-over { border-color: var(--accent); }

/* Password display */
.password-display {
  font-family: 'Courier New', monospace;
  font-size: 1.3rem;
  padding: 1rem;
  background: var(--bg);
  border-radius: 8px;
  text-align: center;
  word-break: break-all;
  border: 1px solid var(--border);
  margin-bottom: 1rem;
}

/* Strength indicator */
.strength-bar { display: flex; gap: 4px; margin-top: 0.5rem; }
.strength-segment {
  flex: 1;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  transition: background 0.3s;
}

/* Stats grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
}
.stat-card {
  background: var(--bg);
  border-radius: 8px;
  padding: 1rem;
  text-align: center;
}
.stat-card .stat-value { font-size: 2rem; font-weight: 700; color: var(--primary); }
.stat-card .stat-label { font-size: 0.85rem; color: var(--text-light); }

/* Footer */
.site-footer {
  background: #1e293b;
  color: #94a3b8;
  padding: 2rem 1.5rem;
  margin-top: auto;
}
.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}
.footer-inner .logo { color: white; }
.footer-inner .logo span { color: var(--secondary); }
.footer-links { display: flex; gap: 1.5rem; }
.footer-links a { color: #94a3b8; text-decoration: none; font-size: 0.9rem; }
.footer-links a:hover { color: white; }

/* Toast */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  padding: 0.85rem 1.25rem;
  border-radius: 8px;
  color: white;
  font-weight: 500;
  z-index: 100;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s ease;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast.success { background: var(--success); }
.toast.error { background: var(--error); }

/* Mobile */
@media (max-width: 768px) {
  .hero h1 { font-size: 1.75rem; }
  .hero { padding: 2.5rem 1rem; }
  .tools-grid { grid-template-columns: 1fr; }
  .header-inner { padding: 0 1rem; }
  .nav-links { gap: 0.75rem; }
  .nav-links a { font-size: 0.85rem; }
  .tool-page { padding: 1.5rem 1rem; }
  .option-row { flex-direction: column; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-inner { flex-direction: column; text-align: center; }
}
@media (max-width: 480px) {
  .hero h1 { font-size: 1.4rem; }
  .btn-group { flex-direction: column; }
  .btn { width: 100%; }
}
