/* Akkiu Pro — Clean, not vibe-coded */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
  --bg: #0b0f19;
  --surface: #141b2d;
  --surface-2: #1e2740;
  --surface-3: #2a3655;
  --text: #e8ecf4;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent: #3b82f6;
  --accent-soft: rgba(59,130,246,0.12);
  --accent-hover: #2563eb;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --border: #1e293b;
  --border-light: #334155;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow: 0 1px 3px rgba(0,0,0,0.4);
  --shadow-lg: 0 10px 40px rgba(0,0,0,0.5);
  --max-width: 1100px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--accent-soft); color: var(--text); }

.container { max-width: var(--max-width); margin: 0 auto; padding: 0 24px; }

/* Header */
header {
  background: rgba(11,15,25,0.85);
  backdrop-filter: blur(20px) saturate(1.2);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.logo {
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo-mark {
  width: 28px; height: 28px;
  background: var(--accent);
  border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
}

nav { display: flex; align-items: center; gap: 4px; }

nav a, .nav-btn {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  transition: all 0.15s;
  border: none;
  background: none;
  cursor: pointer;
  white-space: nowrap;
}

nav a:hover, .nav-btn:hover { color: var(--text); background: var(--surface-2); }
nav a.active { color: var(--accent); background: var(--accent-soft); }

.dropdown { position: relative; }
.dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  min-width: 220px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  padding: 6px;
}
.dropdown-menu a {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
}
.dropdown-menu a:hover { background: var(--surface-2); }
.dropdown:hover .dropdown-menu { display: block; }

/* Hero */
.hero {
  padding: 72px 24px 56px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.hero h1 {
  font-size: 42px;
  font-weight: 800;
  letter-spacing: -1.2px;
  line-height: 1.1;
  margin-bottom: 16px;
}

.hero h1 span { color: var(--accent); }
.hero p {
  font-size: 17px;
  color: var(--text-secondary);
  max-width: 560px;
  margin: 0 auto 32px;
  line-height: 1.6;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(34,197,94,0.1);
  color: var(--success);
  font-size: 11px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 999px;
  margin-bottom: 20px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  border: 1px solid rgba(34,197,94,0.2);
}

/* Tool Grid */
.tools-section { padding: 48px 0 80px; }
.tools-section h2 {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

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

.tool-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: all 0.2s ease;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  position: relative;
}

.tool-card:hover {
  border-color: var(--border-light);
  background: var(--surface-2);
  transform: translateY(-2px);
}

.tool-card.external::after {
  content: '↗';
  position: absolute;
  top: 16px;
  right: 16px;
  font-size: 12px;
  color: var(--text-muted);
}

.tool-icon {
  width: 40px; height: 40px;
  background: var(--surface-3);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  margin-bottom: 14px;
}

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

.tool-card p {
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.5;
  flex: 1;
}

.tool-card .tag {
  display: inline-block;
  margin-top: 14px;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 4px 10px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Tool Page */
.tool-page { padding: 32px 0 80px; }

.tool-page-header {
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.tool-page-header h1 {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 8px;
}

.tool-page-header p {
  color: var(--text-secondary);
  font-size: 15px;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-bottom: 24px;
  padding: 4px;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.tab-btn {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: none;
  background: none;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.tab-btn:hover { color: var(--text); }
.tab-btn.active {
  background: var(--surface-3);
  color: var(--text);
  box-shadow: var(--shadow);
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* Drop Zone */
.drop-zone {
  border: 1.5px dashed var(--border-light);
  border-radius: var(--radius-lg);
  padding: 56px 24px;
  text-align: center;
  background: var(--surface);
  transition: all 0.2s;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.drop-zone:hover, .drop-zone.dragover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.drop-zone .dz-icon {
  width: 56px; height: 56px;
  background: var(--surface-2);
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
  margin: 0 auto 16px;
}

.drop-zone h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 6px;
}

.drop-zone p {
  color: var(--text-secondary);
  font-size: 13px;
}

.drop-zone input[type="file"] {
  position: absolute; inset: 0;
  opacity: 0; cursor: pointer;
  width: 100%; height: 100%;
}

/* Controls */
.controls {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-top: 20px;
}

.control-group {
  margin-bottom: 20px;
}
.control-group:last-child { margin-bottom: 0; }

.control-group label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.control-group input[type="text"],
.control-group input[type="number"],
.control-group input[type="password"],
.control-group input[type="color"],
.control-group select,
.control-group textarea {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.15s;
}

.control-group input:focus,
.control-group select:focus,
.control-group textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.control-group input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
  margin-top: 4px;
}

.control-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent-hover); }

.btn-secondary {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border-light);
}
.btn-secondary:hover { background: var(--surface-3); }

.btn-danger {
  background: rgba(239,68,68,0.1);
  color: var(--danger);
  border: 1px solid rgba(239,68,68,0.2);
}
.btn-danger:hover { background: rgba(239,68,68,0.2); }

.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-lg { padding: 14px 28px; font-size: 15px; }

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

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

.file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
}

.file-item .file-info {
  display: flex; align-items: center; gap: 12px;
  min-width: 0;
}

.file-item .file-icon {
  width: 36px; height: 36px;
  background: var(--surface-2);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.file-item .file-name {
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-item .file-meta {
  color: var(--text-muted);
  font-size: 12px;
  margin-top: 2px;
}

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

/* Preview */
.preview-area {
  margin-top: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
}

.preview-area img, .preview-area canvas {
  max-width: 100%;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
}

/* Stats */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin: 20px 0;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  text-align: center;
}

.stat-card .stat-value {
  font-size: 22px;
  font-weight: 800;
  color: var(--accent);
}

.stat-card .stat-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-top: 4px;
  font-weight: 600;
}

/* Progress */
.progress-wrap {
  margin-top: 20px;
  display: none;
}
.progress-wrap.active { display: block; }

.progress-track {
  height: 6px;
  background: var(--surface-2);
  border-radius: 999px;
  overflow: hidden;
}

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

.progress-text {
  text-align: center;
  margin-top: 10px;
  font-size: 13px;
  color: var(--text-secondary);
}

/* Result Actions */
.result-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 20px;
  flex-wrap: wrap;
}

/* Page Grid for thumbnails */
.page-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.page-thumb {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
}

.page-thumb:hover { border-color: var(--accent); }
.page-thumb.selected { border-color: var(--accent); background: var(--accent-soft); }
.page-thumb canvas, .page-thumb img {
  max-width: 100%;
  border-radius: 6px;
  background: #fff;
}
.page-thumb .page-num {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 6px;
  font-weight: 600;
}
.page-thumb .page-check {
  position: absolute;
  top: 6px; right: 6px;
  width: 20px; height: 20px;
  background: var(--accent);
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 11px;
}
.page-thumb.selected .page-check { display: flex; }

/* Checkbox grid */
.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s;
}

.checkbox-item:hover { border-color: var(--border-light); }
.checkbox-item input[type="checkbox"] {
  accent-color: var(--accent);
  width: 16px; height: 16px;
  cursor: pointer;
}
.checkbox-item label {
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  flex: 1;
  margin: 0;
}

/* Promo box */
.promo-box {
  background: linear-gradient(135deg, rgba(59,130,246,0.08), rgba(168,85,247,0.06));
  border: 1px solid rgba(59,130,246,0.2);
  border-radius: var(--radius);
  padding: 28px;
  margin-top: 40px;
  text-align: center;
}

.promo-box h3 {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 6px;
}

.promo-box p {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 16px;
}

/* Footer */
footer {
  border-top: 1px solid var(--border);
  padding: 32px 24px;
  text-align: center;
}

footer p {
  color: var(--text-muted);
  font-size: 13px;
}

footer a { color: var(--accent); text-decoration: none; }

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 14px 20px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  transform: translateY(120px);
  opacity: 0;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 200;
  font-size: 14px;
  font-weight: 500;
  max-width: 400px;
}

.toast.show { transform: translateY(0); opacity: 1; }
.toast.success { border-left: 3px solid var(--success); }
.toast.error { border-left: 3px solid var(--danger); }

/* Text output area */
.text-output {
  background: var(--bg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 16px;
  font-family: 'SF Mono', Monaco, monospace;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-secondary);
  max-height: 400px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Responsive */
@media (max-width: 768px) {
  .hero h1 { font-size: 30px; }
  .tools-grid { grid-template-columns: 1fr; }
  .tabs { overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; }
  .page-grid { grid-template-columns: repeat(3, 1fr); }
  .control-row { grid-template-columns: 1fr; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
}

/* Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-light); }

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