/* ===================================
   IMAGE TO PDF CONVERTER — STYLE SYSTEM
   Shadcn/Radix-inspired, White Clean Design
   =================================== */

:root {
  --bg: #FFFFFF;
  --bg-secondary: #F9FAFB;
  --card: #FFFFFF;
  --primary: #18181B;
  --accent: #6366F1;
  --accent-hover: #4F46E5;
  --success: #22C55E;
  --error: #EF4444;
  --warning: #F59E0B;
  --muted: #71717A;
  --border: #E4E4E7;
  --border-hover: #A1A1AA;
  --shadow-sm: 0 1px 2px 0 rgba(0,0,0,0.05);
  --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --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);
  --radius: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --transition: 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark mode */
[data-dark="true"] {
  --bg: #09090B;
  --bg-secondary: #18181B;
  --card: #18181B;
  --primary: #FAFAFA;
  --muted: #A1A1AA;
  --border: #27272A;
  --border-hover: #3F3F46;
  --shadow-sm: 0 1px 2px 0 rgba(0,0,0,0.3);
  --shadow: 0 1px 3px rgba(0,0,0,0.4);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.4);
}

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

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background var(--transition), color var(--transition);
}

a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-hover); }
img { max-width: 100%; height: auto; }
ul { list-style: none; }

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.container--narrow {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ===== ANNOUNCEMENT BAR ===== */
.announcement-bar {
  background: var(--accent);
  color: white;
  text-align: center;
  padding: 10px 40px;
  font-size: 14px;
  position: relative;
}
.announcement-bar button {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  font-size: 16px;
  opacity: 0.8;
}
.announcement-bar button:hover { opacity: 1; }

/* ===== HEADER ===== */
.site-header {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(8px);
  background: rgba(255,255,255,0.95);
}
[data-dark="true"] .site-header { background: rgba(9,9,11,0.95); }

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 24px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--primary);
  font-weight: 700;
  font-size: 17px;
}
.logo-icon {
  width: 36px;
  height: 36px;
  background: var(--accent);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}
.logo-icon svg { width: 20px; height: 20px; }
.logo-text { color: var(--primary); }

.main-nav ul {
  display: flex;
  gap: 4px;
}
.main-nav a {
  padding: 6px 12px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  transition: all var(--transition);
}
.main-nav a:hover, .main-nav a.active {
  color: var(--primary);
  background: var(--bg-secondary);
}

.header-actions { display: flex; align-items: center; gap: 8px; }

.btn-icon {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: var(--radius);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  transition: all var(--transition);
}
.btn-icon:hover { color: var(--primary); border-color: var(--border-hover); }
.btn-icon svg { width: 16px; height: 16px; }

.mobile-menu-btn { display: none; }

.mobile-menu {
  background: var(--card);
  border-top: 1px solid var(--border);
  padding: 12px 24px 16px;
}
.mobile-menu ul { display: flex; flex-direction: column; gap: 4px; }
.mobile-menu a {
  display: block;
  padding: 10px 12px;
  border-radius: var(--radius);
  color: var(--primary);
  font-weight: 500;
  transition: background var(--transition);
}
.mobile-menu a:hover { background: var(--bg-secondary); }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  font-family: var(--font);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
  line-height: 1;
}
.btn svg { width: 16px; height: 16px; }

.btn-primary {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}
.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99,102,241,0.3);
}
.btn-primary:active { transform: translateY(0); }

.btn-outline {
  background: transparent;
  color: var(--primary);
  border-color: var(--border);
}
.btn-outline:hover {
  background: var(--bg-secondary);
  border-color: var(--border-hover);
  color: var(--primary);
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border-color: transparent;
}
.btn-ghost:hover { background: var(--bg-secondary); color: var(--primary); }

.btn-success { background: var(--success); color: white; border-color: var(--success); }
.btn-success:hover { background: #16A34A; color: white; }
.btn-danger { background: var(--error); color: white; border-color: var(--error); }
.btn-danger:hover { background: #DC2626; color: white; }

.btn-lg { padding: 14px 28px; font-size: 16px; border-radius: var(--radius-lg); }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-xl {
  padding: 18px 40px;
  font-size: 18px;
  border-radius: var(--radius-lg);
  font-weight: 600;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}
.btn-loading { position: relative; pointer-events: none; }
.btn-loading::after {
  content: '';
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin-left: 8px;
}

/* ===== CARDS ===== */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.card-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--primary);
}

/* ===== FORM ELEMENTS ===== */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--primary);
  margin-bottom: 6px;
}
.form-label span.required { color: var(--error); margin-left: 2px; }

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--primary);
  font-family: var(--font);
  font-size: 14px;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}
.form-input::placeholder, .form-textarea::placeholder { color: var(--muted); }
.form-textarea { resize: vertical; min-height: 120px; line-height: 1.5; }
.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2371717A' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}
.form-hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.form-error { font-size: 12px; color: var(--error); margin-top: 4px; }

/* Checkbox / Radio */
.form-check {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 14px;
}
.form-check input[type="checkbox"],
.form-check input[type="radio"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
}

/* Toggle switch */
.toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 14px;
}
.toggle input { display: none; }
.toggle-track {
  width: 44px;
  height: 24px;
  background: var(--border);
  border-radius: 12px;
  position: relative;
  transition: background var(--transition);
  flex-shrink: 0;
}
.toggle input:checked + .toggle-track { background: var(--accent); }
.toggle-track::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: white;
  border-radius: 50%;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition);
}
.toggle input:checked + .toggle-track::after { transform: translateX(20px); }

/* Slider */
.form-slider {
  width: 100%;
  accent-color: var(--accent);
  cursor: pointer;
  height: 4px;
  border-radius: 2px;
}

/* ===== BADGE ===== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.badge-success { background: #DCFCE7; color: #16A34A; }
.badge-error { background: #FEE2E2; color: #DC2626; }
.badge-warning { background: #FEF9C3; color: #CA8A04; }
.badge-info { background: #DBEAFE; color: #2563EB; }
.badge-muted { background: var(--bg-secondary); color: var(--muted); }

/* ===== TABS ===== */
.tabs { border-bottom: 1px solid var(--border); display: flex; gap: 4px; }
.tab-btn {
  padding: 10px 16px;
  border: none;
  background: none;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all var(--transition);
  font-family: var(--font);
}
.tab-btn:hover { color: var(--primary); }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-panel { display: none; padding-top: 20px; }
.tab-panel.active { display: block; }

/* ===== ACCORDION ===== */
.accordion { border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.accordion-item { border-bottom: 1px solid var(--border); }
.accordion-item:last-child { border-bottom: none; }
.accordion-trigger {
  width: 100%;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 500;
  color: var(--primary);
  text-align: left;
  transition: background var(--transition);
}
.accordion-trigger:hover { background: var(--bg-secondary); }
.accordion-trigger svg { width: 16px; height: 16px; color: var(--muted); transition: transform var(--transition); flex-shrink: 0; }
.accordion-trigger[aria-expanded="true"] svg { transform: rotate(180deg); }
.accordion-content { display: none; padding: 0 20px 20px; color: var(--muted); font-size: 14px; line-height: 1.7; }
.accordion-content.open { display: block; }

/* ===== TOAST ===== */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}
.toast {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  min-width: 280px;
  max-width: 380px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  pointer-events: all;
  animation: slide-in-right 0.3s ease;
}
.toast.removing { animation: slide-out-right 0.3s ease forwards; }
.toast-icon { flex-shrink: 0; width: 20px; height: 20px; margin-top: 1px; }
.toast-icon.success { color: var(--success); }
.toast-icon.error { color: var(--error); }
.toast-icon.info { color: var(--accent); }
.toast-body { flex: 1; }
.toast-title { font-size: 14px; font-weight: 600; color: var(--primary); }
.toast-msg { font-size: 13px; color: var(--muted); margin-top: 2px; }
.toast-close { background: none; border: none; cursor: pointer; color: var(--muted); padding: 0; line-height: 1; }
.toast-close:hover { color: var(--primary); }

@keyframes slide-in-right {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
@keyframes slide-out-right {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(100%); opacity: 0; }
}

/* ===== PROGRESS BAR ===== */
.progress {
  width: 100%;
  height: 6px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  background: var(--accent);
  border-radius: 99px;
  transition: width 0.3s ease;
}

/* ===== HERO ===== */
.hero {
  padding: 80px 0 60px;
  text-align: center;
  background: linear-gradient(135deg, #F8F7FF 0%, #FFFFFF 60%);
}
[data-dark="true"] .hero { background: linear-gradient(135deg, #18181B 0%, #09090B 60%); }
.hero h1 {
  font-size: clamp(32px, 5vw, 52px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
  color: var(--primary);
}
.hero h1 span { color: var(--accent); }
.hero .subtitle {
  font-size: 18px;
  color: var(--muted);
  max-width: 560px;
  margin: 0 auto 32px;
  line-height: 1.6;
}
.hero-badges { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; margin-bottom: 40px; }
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 99px;
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
}
.hero-badge svg { width: 14px; height: 14px; color: var(--success); }

/* ===== UPLOAD ZONE ===== */
.upload-section { padding: 0 0 40px; }
.upload-card { position: relative; }
.sidebar-ad { display: none; }

@media (min-width: 1100px) {
  .tool-layout { display: grid; grid-template-columns: 1fr 300px; gap: 24px; align-items: start; }
  .sidebar-ad { display: block; position: sticky; top: 88px; }
}

.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-xl);
  background: var(--bg-secondary);
  padding: 60px 32px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
}
.upload-zone:hover, .upload-zone.drag-over {
  border-color: var(--accent);
  background: rgba(99,102,241,0.04);
}
.upload-zone .upload-icon {
  width: 64px;
  height: 64px;
  background: rgba(99,102,241,0.08);
  border-radius: var(--radius-xl);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  color: var(--accent);
}
.upload-zone .upload-icon svg { width: 32px; height: 32px; }
.upload-zone h3 { font-size: 18px; font-weight: 600; margin-bottom: 8px; color: var(--primary); }
.upload-zone p { font-size: 14px; color: var(--muted); }
.upload-zone .upload-hint { font-size: 12px; color: var(--muted); margin-top: 8px; }
.upload-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

/* Upload progress */
.upload-progress { margin-top: 16px; display: none; }
.upload-progress.visible { display: block; }
.upload-progress-label { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); margin-bottom: 8px; }

/* Preview Grid */
.preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  margin-top: 24px;
}
.preview-item {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: box-shadow var(--transition);
  cursor: grab;
}
.preview-item:active { cursor: grabbing; }
.preview-item:hover { box-shadow: var(--shadow-md); }
.preview-item.dragging { opacity: 0.5; }
.preview-item.drag-target { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(99,102,241,0.3); }
.preview-thumb {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
  cursor: zoom-in;
}
.preview-info {
  padding: 8px 10px;
  border-top: 1px solid var(--border);
}
.preview-name {
  font-size: 11px;
  color: var(--primary);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.preview-size { font-size: 10px; color: var(--muted); margin-top: 2px; }
.preview-actions {
  position: absolute;
  top: 6px;
  right: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  opacity: 0;
  transition: opacity var(--transition);
}
.preview-item:hover .preview-actions { opacity: 1; }
.preview-action-btn {
  width: 26px;
  height: 26px;
  background: rgba(0,0,0,0.65);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  transition: background var(--transition);
  backdrop-filter: blur(4px);
}
.preview-action-btn:hover { background: rgba(0,0,0,0.85); }
.preview-action-btn svg { width: 13px; height: 13px; }
.preview-action-btn.btn-remove { background: rgba(239,68,68,0.8); }
.preview-action-btn.btn-remove:hover { background: rgba(239,68,68,1); }

/* Rotation indicator */
.preview-item .rotate-deg {
  position: absolute;
  bottom: 34px;
  left: 6px;
  background: rgba(0,0,0,0.65);
  color: white;
  font-size: 10px;
  padding: 2px 5px;
  border-radius: 4px;
  display: none;
}
.preview-item.rotated .rotate-deg { display: block; }

/* ===== SETTINGS PANEL ===== */
.settings-panel { margin-top: 24px; }
.settings-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
  transition: all var(--transition);
}
.settings-toggle:hover { border-color: var(--border-hover); }
.settings-toggle svg { width: 16px; height: 16px; transition: transform var(--transition); }
.settings-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
.settings-toggle[aria-expanded="true"] {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.settings-body {
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  padding: 20px;
  background: var(--card);
  display: none;
}
.settings-body.open { display: block; }

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
.settings-full { grid-column: 1 / -1; }

/* Page size buttons */
.btn-group { display: flex; gap: 4px; flex-wrap: wrap; }
.btn-size {
  padding: 6px 14px;
  border: 1px solid var(--border);
  background: var(--bg);
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font);
  color: var(--primary);
}
.btn-size:hover { border-color: var(--accent); color: var(--accent); }
.btn-size.active { background: var(--accent); color: white; border-color: var(--accent); }

/* Orientation radio */
.orientation-group { display: flex; gap: 12px; }
.orientation-opt {
  flex: 1;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  transition: all var(--transition);
}
.orientation-opt:hover { border-color: var(--accent); }
.orientation-opt.active { border-color: var(--accent); background: rgba(99,102,241,0.05); color: var(--accent); }
.orientation-icon { width: 20px; }
.portrait-icon { width: 14px; height: 20px; border: 2px solid currentColor; border-radius: 2px; margin-left: 3px; }
.landscape-icon { width: 20px; height: 14px; border: 2px solid currentColor; border-radius: 2px; }

/* Quality slider */
.quality-wrap { display: flex; align-items: center; gap: 12px; }
.quality-wrap .quality-val { font-size: 13px; font-weight: 600; color: var(--accent); min-width: 36px; text-align: right; }

/* ===== CONVERT BUTTON AREA ===== */
.convert-action {
  margin-top: 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.convert-action .btn-xl { width: 100%; max-width: 400px; }

.convert-progress {
  width: 100%;
  max-width: 400px;
  display: none;
}
.convert-progress.visible { display: block; }

/* ===== RESULT PANEL ===== */
.result-panel {
  margin-top: 28px;
  padding: 28px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  text-align: center;
  display: none;
}
.result-panel.visible { display: block; animation: fade-in 0.4s ease; }
.result-icon {
  width: 60px;
  height: 60px;
  background: #DCFCE7;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  color: var(--success);
}
.result-icon svg { width: 28px; height: 28px; }
.result-panel h3 { font-size: 20px; font-weight: 700; margin-bottom: 6px; }
.result-panel p { color: var(--muted); font-size: 14px; margin-bottom: 24px; }
.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}
.share-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 16px;
}

/* ===== FEATURES SECTION ===== */
.features-section { padding: 80px 0; background: var(--bg-secondary); }
.features-section h2 { text-align: center; font-size: 32px; font-weight: 700; margin-bottom: 12px; }
.features-section .section-sub { text-align: center; color: var(--muted); font-size: 16px; margin-bottom: 52px; max-width: 540px; margin-left: auto; margin-right: auto; }
.features-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.feature-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 24px;
  transition: box-shadow var(--transition), transform var(--transition);
}
.feature-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.feature-icon {
  width: 44px;
  height: 44px;
  background: rgba(99,102,241,0.1);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  color: var(--accent);
}
.feature-icon svg { width: 22px; height: 22px; }
.feature-card h3 { font-size: 15px; font-weight: 600; margin-bottom: 8px; }
.feature-card p { font-size: 14px; color: var(--muted); line-height: 1.6; }

/* ===== HOW IT WORKS ===== */
.how-section { padding: 80px 0; }
.how-section h2 { text-align: center; font-size: 32px; font-weight: 700; margin-bottom: 52px; }
.steps-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 32px; }
.step-item { text-align: center; }
.step-num {
  width: 56px;
  height: 56px;
  background: var(--accent);
  color: white;
  font-size: 22px;
  font-weight: 700;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}
.step-item h3 { font-size: 16px; font-weight: 600; margin-bottom: 8px; }
.step-item p { font-size: 14px; color: var(--muted); }

/* ===== FAQ PREVIEW ===== */
.faq-preview { padding: 80px 0; background: var(--bg-secondary); }
.faq-preview h2 { text-align: center; font-size: 32px; font-weight: 700; margin-bottom: 40px; }
.faq-cta { text-align: center; margin-top: 32px; }

/* ===== PAGE LAYOUT ===== */
.page-hero {
  padding: 60px 0 40px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}
.page-hero h1 { font-size: 36px; font-weight: 700; margin-bottom: 12px; }
.page-hero p { font-size: 16px; color: var(--muted); max-width: 520px; margin: 0 auto; }
.page-content { padding: 60px 0; }
.page-content h2 { font-size: 24px; font-weight: 600; margin: 32px 0 12px; }
.page-content h3 { font-size: 18px; font-weight: 600; margin: 24px 0 10px; }
.page-content p { margin-bottom: 16px; color: var(--muted); line-height: 1.8; }
.page-content ul { margin: 12px 0 16px 20px; }
.page-content ul li { list-style: disc; margin-bottom: 6px; color: var(--muted); }

/* ===== STATS BAR ===== */
.stats-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  margin: 40px 0;
}
.stat-item {
  padding: 24px 20px;
  background: var(--card);
  text-align: center;
}
.stat-num { font-size: 32px; font-weight: 700; color: var(--accent); }
.stat-label { font-size: 13px; color: var(--muted); margin-top: 4px; }

/* ===== REVIEWS ===== */
.review-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 20px;
}
.review-stars { display: flex; gap: 2px; margin-bottom: 10px; }
.star { color: #F59E0B; font-size: 16px; }
.star.empty { color: var(--border); }
.review-comment { font-size: 14px; color: var(--muted); line-height: 1.7; margin-bottom: 14px; }
.review-author { display: flex; align-items: center; gap: 10px; }
.review-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
}
.review-name { font-size: 14px; font-weight: 600; }
.review-date { font-size: 12px; color: var(--muted); }

/* Rating distribution */
.rating-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.rating-bar .label { font-size: 13px; width: 40px; text-align: right; color: var(--muted); }
.rating-bar .bar-track { flex: 1; height: 8px; background: var(--border); border-radius: 99px; overflow: hidden; }
.rating-bar .bar-fill { height: 100%; background: #F59E0B; border-radius: 99px; }
.rating-bar .count { font-size: 13px; color: var(--muted); width: 24px; }

/* ===== CONTACT FORM ===== */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
@media (max-width: 768px) { .contact-grid { grid-template-columns: 1fr; } }
.contact-info h3 { font-size: 18px; font-weight: 600; margin-bottom: 16px; }
.contact-item { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 20px; }
.contact-item-icon { width: 36px; height: 36px; background: rgba(99,102,241,0.1); border-radius: var(--radius); display: flex; align-items: center; justify-content: center; color: var(--accent); flex-shrink: 0; }
.contact-item-icon svg { width: 18px; height: 18px; }
.contact-item-label { font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.contact-item-val { font-size: 14px; font-weight: 500; }

/* ===== PAGINATION ===== */
.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 32px; }
.page-btn {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: var(--radius);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  transition: all var(--transition);
}
.page-btn:hover { border-color: var(--accent); color: var(--accent); }
.page-btn.active { background: var(--accent); border-color: var(--accent); color: white; }

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(4px);
  animation: fade-in 0.2s ease;
}
.modal {
  background: var(--card);
  border-radius: var(--radius-xl);
  max-width: 520px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: scale-in 0.2s ease;
}
.modal-header {
  padding: 20px 24px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-title { font-size: 16px; font-weight: 600; }
.modal-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  line-height: 1;
}
.modal-body { padding: 20px 24px 24px; }

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

/* ===== IMAGE LIGHTBOX ===== */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.9);
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fade-in 0.2s ease;
}
.lightbox img { max-width: 90vw; max-height: 90vh; object-fit: contain; border-radius: var(--radius); }
.lightbox-close {
  position: fixed;
  top: 20px;
  right: 20px;
  background: rgba(255,255,255,0.1);
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  cursor: pointer;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

/* ===== ADMIN SIDEBAR LAYOUT ===== */
.admin-layout { display: flex; min-height: 100vh; }
.admin-sidebar {
  width: 240px;
  background: var(--primary);
  color: white;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 200;
  display: flex;
  flex-direction: column;
}
[data-dark="true"] .admin-sidebar { background: #18181B; border-right: 1px solid var(--border); }
.admin-sidebar-logo {
  padding: 20px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  font-weight: 700;
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.admin-sidebar-logo svg { width: 20px; height: 20px; }
.admin-nav { padding: 12px 0; flex: 1; }
.admin-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  color: rgba(255,255,255,0.65);
  font-size: 14px;
  font-weight: 500;
  transition: all var(--transition);
  cursor: pointer;
  text-decoration: none;
  border-left: 3px solid transparent;
}
.admin-nav-item:hover { color: white; background: rgba(255,255,255,0.08); }
.admin-nav-item.active { color: white; background: rgba(99,102,241,0.2); border-left-color: var(--accent); }
.admin-nav-item svg { width: 16px; height: 16px; flex-shrink: 0; }
.admin-nav-section { padding: 8px 20px 4px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.8px; color: rgba(255,255,255,0.35); margin-top: 8px; }
.admin-sub-item { padding-left: 46px !important; }
.admin-main { margin-left: 240px; flex: 1; }
.admin-topbar {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 0 28px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}
.admin-topbar-title { font-size: 16px; font-weight: 600; }
.admin-content { padding: 28px; }

/* Admin stats grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 20px;
}
.stat-card .stat-label { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px; }
.stat-card .stat-value { font-size: 28px; font-weight: 700; }
.stat-card .stat-change { font-size: 12px; margin-top: 4px; }
.stat-card .stat-icon { float: right; width: 40px; height: 40px; border-radius: var(--radius-lg); display: flex; align-items: center; justify-content: center; }
.stat-card .stat-icon svg { width: 20px; height: 20px; }

/* Admin table */
.admin-table-wrap { overflow-x: auto; border-radius: var(--radius-lg); border: 1px solid var(--border); }
.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.admin-table th {
  padding: 12px 16px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
}
.admin-table td { padding: 12px 16px; border-bottom: 1px solid var(--border); color: var(--primary); }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: var(--bg-secondary); }

/* Admin login */
.admin-login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary);
  padding: 20px;
}
.admin-login-card { width: 100%; max-width: 380px; }

/* ===== COOKIE BANNER ===== */
.cookie-banner {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9000;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  max-width: 460px;
  width: calc(100% - 40px);
  animation: slide-up 0.4s ease;
}
.cookie-inner { padding: 16px 20px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.cookie-inner p { font-size: 14px; color: var(--muted); flex: 1; min-width: 200px; margin: 0; }
.cookie-inner p a { color: var(--accent); }
.cookie-actions { display: flex; gap: 8px; }

@keyframes slide-up {
  from { transform: translateX(-50%) translateY(100%); opacity: 0; }
  to { transform: translateX(-50%) translateY(0); opacity: 1; }
}

/* ===== FOOTER ===== */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-secondary);
  margin-top: auto;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr repeat(3, 1fr);
  gap: 40px;
  padding: 56px 0 40px;
}
.footer-brand .logo { margin-bottom: 12px; }
.footer-tagline { font-size: 14px; color: var(--muted); margin: 0 0 20px; line-height: 1.6; }
.social-links { display: flex; gap: 10px; }
.social-links a {
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  transition: all var(--transition);
}
.social-links a:hover { color: var(--accent); border-color: var(--accent); }
.social-links svg { width: 16px; height: 16px; }
.footer-links-col h4 { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 16px; color: var(--primary); }
.footer-links-col ul { display: flex; flex-direction: column; gap: 8px; }
.footer-links-col a { font-size: 14px; color: var(--muted); transition: color var(--transition); }
.footer-links-col a:hover { color: var(--accent); }
.footer-bottom {
  padding: 20px 0;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--muted);
  gap: 16px;
}
.powered-by a { color: var(--muted); }

/* ===== SPINNER ===== */
@keyframes spin { to { transform: rotate(360deg); } }
.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .admin-sidebar { transform: translateX(-100%); transition: transform 0.3s ease; }
  .admin-sidebar.open { transform: translateX(0); }
  .admin-main { margin-left: 0; }
  .admin-sidebar-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 199; display: none; }
  .admin-sidebar-overlay.visible { display: block; }
}

@media (max-width: 768px) {
  .main-nav { display: none; }
  .mobile-menu-btn { display: flex; }
  .hero { padding: 50px 0 40px; }
  .hero h1 { font-size: 28px; }
  .features-section, .how-section, .faq-preview { padding: 50px 0; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 28px; padding: 40px 0 28px; }
  .footer-bottom { flex-direction: column; text-align: center; }
  .result-actions { flex-direction: column; align-items: center; }
  .admin-content { padding: 16px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
  .container { padding: 0 16px; }
  .footer-grid { grid-template-columns: 1fr; }
  .preview-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
  .stats-grid { grid-template-columns: 1fr; }
  .btn-group { gap: 6px; }
}

/* ===== UTILITY ===== */
.text-center { text-align: center; }
.text-muted { color: var(--muted); }
.text-accent { color: var(--accent); }
.text-success { color: var(--success); }
.text-danger { color: var(--error); }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.w-full { width: 100%; }
.hidden { display: none !important; }
.section-title { font-size: 28px; font-weight: 700; margin-bottom: 8px; }
.section-sub { color: var(--muted); font-size: 15px; }
.divider { border: none; border-top: 1px solid var(--border); margin: 24px 0; }
.alert {
  padding: 14px 16px;
  border-radius: var(--radius-lg);
  font-size: 14px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.alert svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 1px; }
.alert-info { background: #EFF6FF; color: #1D4ED8; border: 1px solid #BFDBFE; }
.alert-success { background: #F0FDF4; color: #166534; border: 1px solid #BBF7D0; }
.alert-error { background: #FEF2F2; color: #991B1B; border: 1px solid #FECACA; }
[data-dark="true"] .alert-info { background: rgba(29,78,216,0.15); border-color: rgba(29,78,216,0.3); }
[data-dark="true"] .alert-success { background: rgba(22,101,52,0.15); border-color: rgba(22,101,52,0.3); }
[data-dark="true"] .alert-error { background: rgba(153,27,27,0.15); border-color: rgba(153,27,27,0.3); }
