/* ============================================
   BrowserLangit - Main Stylesheet
   Penelusuran Cepat Tanpa Batas - Bebas Akses
   ============================================ */

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

/* ---- CSS Variables (Light Mode) ---- */
:root {
  --bg-primary: #f0f6ff;
  --bg-secondary: #ffffff;
  --bg-gradient: linear-gradient(135deg, #e8f4fd 0%, #f0f6ff 50%, #e1ecf7 100%);
  --bg-hero: linear-gradient(180deg, #dceefb 0%, #f0f6ff 60%, #ffffff 100%);
  --text-primary: #1a1a2e;
  --text-secondary: #4a5568;
  --text-muted: #718096;
  --accent-blue: #2563eb;
  --accent-blue-hover: #1d4ed8;
  --accent-light-blue: #60a5fa;
  --accent-cyan: #06b6d4;
  --border-color: #e2e8f0;
  --border-focus: #2563eb;
  --card-bg: #ffffff;
  --card-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
  --card-shadow-hover: 0 8px 32px rgba(0, 0, 0, 0.10);
  --input-bg: #ffffff;
  --input-border: #cbd5e1;
  --input-shadow: 0 2px 12px rgba(37, 99, 235, 0.08);
  --result-hover-bg: #f8fafc;
  --url-color: #16a34a;
  --toast-success: #16a34a;
  --toast-error: #dc2626;
  --toast-bg: #ffffff;
  --overlay-bg: rgba(0, 0, 0, 0.4);
  --scrollbar-track: #f1f5f9;
  --scrollbar-thumb: #94a3b8;
  --admin-sidebar: #f8fafc;
  --badge-bg: #eff6ff;
  --badge-text: #2563eb;
  --danger: #dc2626;
  --danger-hover: #b91c1c;
  --warning: #f59e0b;
  --transition-fast: 0.15s ease;
  --transition-normal: 0.3s ease;
  --transition-slow: 0.5s ease;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;
}

/* ---- Dark Mode ---- */
[data-theme="dark"] {
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
  --bg-hero: linear-gradient(180deg, #0f172a 0%, #1e293b 60%, #0f172a 100%);
  --text-primary: #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --accent-blue: #60a5fa;
  --accent-blue-hover: #93bbfd;
  --border-color: #334155;
  --border-focus: #60a5fa;
  --card-bg: #1e293b;
  --card-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
  --card-shadow-hover: 0 8px 32px rgba(0, 0, 0, 0.4);
  --input-bg: #1e293b;
  --input-border: #475569;
  --input-shadow: 0 2px 12px rgba(96, 165, 250, 0.1);
  --result-hover-bg: #273548;
  --url-color: #4ade80;
  --toast-bg: #1e293b;
  --overlay-bg: rgba(0, 0, 0, 0.7);
  --scrollbar-track: #1e293b;
  --scrollbar-thumb: #475569;
  --admin-sidebar: #1e293b;
  --badge-bg: #1e3a5f;
  --badge-text: #60a5fa;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-gradient);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  transition: background var(--transition-normal), color var(--transition-normal);
  overflow-x: hidden;
}

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

button {
  cursor: pointer;
  border: none;
  outline: none;
  font-family: inherit;
  transition: all var(--transition-fast);
}

input, textarea, select {
  font-family: inherit;
  outline: none;
  transition: all var(--transition-fast);
}

img {
  max-width: 100%;
  height: auto;
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
}
::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent-blue);
}

/* ============================================
   HEADER / NAVBAR
   ============================================ */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 32px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
  transition: all var(--transition-normal);
}

[data-theme="dark"] .navbar {
  background: rgba(15, 23, 42, 0.9);
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.navbar-brand img {
  height: 40px;
  width: auto;
}

.navbar-brand span {
  font-size: 1.3rem;
  font-weight: 700;
  background: linear-gradient(135deg, #2563eb, #06b6d4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.navbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ---- Search bar in navbar (for search results page) ---- */
.navbar-search {
  flex: 1;
  max-width: 640px;
  margin: 0 24px;
}

.navbar-search .search-input-wrap {
  height: 44px;
  border-radius: var(--radius-full);
}

.navbar-search .search-input-wrap input {
  font-size: 0.95rem;
}

/* ---- Theme Toggle ---- */
.theme-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.theme-toggle:hover {
  border-color: var(--accent-blue);
  color: var(--accent-blue);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.15);
}

.theme-toggle .icon {
  font-size: 1.1rem;
}

/* ---- Admin Link ---- */
.admin-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, #2563eb, #06b6d4);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  transition: all var(--transition-fast);
  border: none;
}

.admin-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.35);
}

/* ============================================
   HOMEPAGE
   ============================================ */
.navbar-home {
  background: transparent !important;
  border-bottom: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  box-shadow: none !important;
  padding: 16px 24px;
}
.navbar-home .navbar-spacer {
  flex: 1;
}

.top-link {
  font-size: 0.85rem;
  color: var(--text-primary);
  text-decoration: none;
}
.top-link:hover {
  text-decoration: underline;
}

.grid-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  border-radius: 50%;
  color: var(--text-secondary);
}
.grid-icon:hover {
  background-color: var(--bg-secondary);
  text-decoration: none;
}

.homepage {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 80px 20px 40px;
  background: var(--bg-hero);
}

.logo-container {
  margin-bottom: 40px;
  animation: fadeInDown 0.8s ease;
}

.logo-container img {
  max-width: 420px;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 4px 24px rgba(37, 99, 235, 0.15));
  transition: transform var(--transition-normal);
}

.logo-container img:hover {
  transform: scale(1.02);
}

/* ---- Search Box ---- */
.search-container {
  width: 100%;
  max-width: 680px;
  animation: fadeInUp 0.8s ease 0.2s both;
}

.search-input-wrap {
  display: flex;
  align-items: center;
  height: 54px;
  background: var(--input-bg);
  border: 2px solid var(--input-border);
  border-radius: var(--radius-full);
  padding: 0 8px 0 20px;
  box-shadow: var(--input-shadow);
  transition: all var(--transition-fast);
}

.search-input-wrap:focus-within {
  border-color: var(--border-focus);
  box-shadow: 0 4px 20px rgba(37, 99, 235, 0.18);
  transform: translateY(-1px);
}

.search-input-wrap .search-icon {
  display: flex;
  align-items: center;
  color: #9aa0a6;
  margin-right: 12px;
  flex-shrink: 0;
}

.search-input-wrap .search-action-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

.search-input-wrap input {
  flex: 1;
  height: 100%;
  border: none;
  background: transparent;
  font-size: 1.05rem;
  color: var(--text-primary);
  min-width: 0;
}

.search-input-wrap input::placeholder {
  color: var(--text-muted);
}

.search-btn {
  display: none;
}

.search-hint {
  text-align: center;
  margin-top: 12px;
  font-size: 0.88rem;
  color: var(--text-muted);
  animation: fadeIn 1s ease 0.5s both;
}

/* ---- Homepage Quick Links ---- */
.quick-links {
  display: flex;
  gap: 16px;
  margin-top: 36px;
  flex-wrap: wrap;
  justify-content: center;
  animation: fadeInUp 0.8s ease 0.4s both;
}

.quick-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-full);
  font-size: 0.9rem;
  font-weight: 600;
  border: 2px solid var(--border-color);
  background: var(--card-bg);
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.quick-link-btn:hover {
  border-color: var(--accent-blue);
  color: var(--accent-blue);
  box-shadow: var(--card-shadow);
  transform: translateY(-2px);
}

.quick-link-btn.primary {
  background: linear-gradient(135deg, #2563eb, #06b6d4);
  color: #fff;
  border: none;
}

.quick-link-btn.primary:hover {
  box-shadow: 0 6px 24px rgba(37, 99, 235, 0.35);
  transform: translateY(-2px);
}

/* ============================================
   SEARCH RESULTS PAGE
   ============================================ */
.search-page {
  padding-top: 80px;
  min-height: 100vh;
}

.results-container {
  max-width: 780px;
  margin: 0 auto;
  padding: 24px 20px 60px;
}

.results-info {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
}

.results-info strong {
  color: var(--accent-blue);
}

/* ---- Single Result Item ---- */
.result-item {
  padding: 16px 0;
  border-bottom: 1px solid var(--border-color);
  animation: fadeInUp 0.4s ease both;
  transition: all var(--transition-fast);
}

.result-item:hover {
  background: var(--result-hover-bg);
  padding-left: 16px;
  border-radius: var(--radius-md);
  margin: 0 -16px;
  padding-right: 16px;
}

.result-header-g {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.result-site-g {
  display: flex;
  align-items: center;
  gap: 12px;
}

.result-favicon-g {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--card-bg);
  object-fit: cover;
  padding: 4px;
  border: 1px solid var(--border-color);
}

.result-site-info-g {
  display: flex;
  flex-direction: column;
}

.result-sitename-g {
  font-size: 0.9rem;
  color: var(--text-primary);
}

.result-url-g {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.result-options-g {
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0 8px;
}

.result-body-g {
  display: flex;
  gap: 16px;
}
.result-body-g.has-image .result-content-g {
  flex: 1;
}

.result-title-g {
  font-size: 1.25rem;
  font-weight: 400;
  color: #1a0dab;
  cursor: pointer;
  text-decoration: none;
  display: block;
  margin-bottom: 6px;
}
.dark-mode .result-title-g {
  color: #8ab4f8;
}

.result-title-g:hover {
  text-decoration: underline;
}

.result-description-g {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.result-image-g {
  width: 104px;
  height: 104px;
  flex-shrink: 0;
  margin-top: 4px;
}
.result-image-g img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

/* ---- No Results ---- */
.no-results {
  text-align: center;
  padding: 80px 20px;
  animation: fadeIn 0.5s ease;
}

.no-results .no-results-icon {
  font-size: 4rem;
  margin-bottom: 20px;
  opacity: 0.5;
}

.no-results h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.no-results p {
  font-size: 1rem;
  color: var(--text-muted);
  max-width: 400px;
  margin: 0 auto;
}

/* ============================================
   ADMIN PANEL
   ============================================ */
.admin-page {
  padding-top: 80px;
  min-height: 100vh;
}

.admin-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 20px 60px;
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
  flex-wrap: wrap;
  gap: 16px;
}

.admin-header h1 {
  font-size: 1.8rem;
  font-weight: 800;
  background: linear-gradient(135deg, #2563eb, #06b6d4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.admin-header-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-primary {
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  color: #fff;
}
.btn-primary:hover {
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.35);
  transform: translateY(-1px);
}

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

.btn-danger {
  background: var(--danger);
  color: #fff;
}
.btn-danger:hover {
  background: var(--danger-hover);
  box-shadow: 0 4px 16px rgba(220, 38, 38, 0.35);
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.82rem;
}

.btn-icon {
  padding: 8px;
  border-radius: var(--radius-sm);
}

/* ---- Stats Cards ---- */
.admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--card-shadow);
  transition: all var(--transition-fast);
}

.stat-card:hover {
  box-shadow: var(--card-shadow-hover);
  transform: translateY(-2px);
}

.stat-card .stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.stat-card .stat-icon.blue {
  background: #eff6ff;
  color: #2563eb;
}
.stat-card .stat-icon.green {
  background: #ecfdf5;
  color: #16a34a;
}
.stat-card .stat-icon.purple {
  background: #f5f3ff;
  color: #7c3aed;
}

[data-theme="dark"] .stat-card .stat-icon.blue {
  background: #1e3a5f;
}
[data-theme="dark"] .stat-card .stat-icon.green {
  background: #14532d;
}
[data-theme="dark"] .stat-card .stat-icon.purple {
  background: #3b0764;
}

.stat-card .stat-info h3 {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
}

.stat-card .stat-info p {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ---- Keywords Table ---- */
.keywords-table-wrap {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--card-shadow);
}

.keywords-table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-color);
  background: var(--admin-sidebar);
}

.keywords-table-header h2 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.search-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  background: var(--input-bg);
}

.search-filter input {
  border: none;
  background: transparent;
  font-size: 0.85rem;
  color: var(--text-primary);
  width: 180px;
}

.search-filter input::placeholder {
  color: var(--text-muted);
}

.keywords-table {
  width: 100%;
  border-collapse: collapse;
}

.keywords-table th {
  text-align: left;
  padding: 14px 24px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border-color);
  background: var(--admin-sidebar);
}

.keywords-table td {
  padding: 14px 24px;
  font-size: 0.92rem;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

.keywords-table tr:hover td {
  background: var(--result-hover-bg);
}

.keywords-table tr:last-child td {
  border-bottom: none;
}

.keyword-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  background: var(--badge-bg);
  color: var(--badge-text);
  font-size: 0.85rem;
  font-weight: 600;
}

.result-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  background: var(--badge-bg);
  color: var(--badge-text);
  font-size: 0.82rem;
  font-weight: 700;
}

.actions-cell {
  display: flex;
  gap: 8px;
}

.empty-table {
  text-align: center;
  padding: 60px 24px;
  color: var(--text-muted);
}

.empty-table .empty-icon {
  font-size: 3rem;
  margin-bottom: 12px;
  opacity: 0.4;
}

.empty-table p {
  font-size: 0.95rem;
}

/* ============================================
   MODAL
   ============================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  background: var(--overlay-bg);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  padding: 20px;
  animation: fadeIn 0.2s ease;
}

.modal-overlay.active {
  display: flex;
}

.modal {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 640px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.2);
  animation: slideUp 0.3s ease;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  background: var(--card-bg);
  z-index: 1;
}

.modal-header h2 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
}

.modal-close {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--text-muted);
  font-size: 1.3rem;
  cursor: pointer;
  border: none;
  transition: all var(--transition-fast);
}

.modal-close:hover {
  background: var(--result-hover-bg);
  color: var(--text-primary);
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  position: sticky;
  bottom: 0;
  background: var(--card-bg);
}

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

.form-group label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.form-group label .required {
  color: var(--danger);
}

.form-control {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--input-border);
  border-radius: var(--radius-md);
  background: var(--input-bg);
  color: var(--text-primary);
  font-size: 0.95rem;
  transition: all var(--transition-fast);
}

.form-control:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-control::placeholder {
  color: var(--text-muted);
}

textarea.form-control {
  min-height: 80px;
  resize: vertical;
}

.form-help {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 6px;
}

/* ---- Result Items in Form ---- */
.result-form-items {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.result-form-item {
  background: var(--admin-sidebar);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  position: relative;
  animation: fadeIn 0.3s ease;
}

.result-form-item .result-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.result-form-item .result-item-header span {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent-blue);
}

.result-form-item .remove-result-btn {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--danger);
  font-size: 1rem;
  cursor: pointer;
  border: none;
  transition: all var(--transition-fast);
}

.result-form-item .remove-result-btn:hover {
  background: rgba(220, 38, 38, 0.1);
}

.result-form-item .form-group {
  margin-bottom: 12px;
}

.result-form-item .form-group:last-child {
  margin-bottom: 0;
}

.add-result-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px;
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.add-result-btn:hover {
  border-color: var(--accent-blue);
  color: var(--accent-blue);
  background: var(--badge-bg);
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */
.toast-container {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  background: var(--toast-bg);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  border-left: 4px solid var(--toast-success);
  animation: slideInRight 0.3s ease;
  min-width: 300px;
  max-width: 450px;
}

.toast.error {
  border-left-color: var(--toast-error);
}

.toast.success {
  border-left-color: var(--toast-success);
}

.toast .toast-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
}

.toast .toast-message {
  font-size: 0.9rem;
  color: var(--text-primary);
  flex: 1;
}

.toast .toast-close {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.9rem;
  cursor: pointer;
  border: none;
  flex-shrink: 0;
}

.toast-exit {
  animation: slideOutRight 0.3s ease forwards;
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
  border-top: 1px solid var(--border-color);
  background: var(--admin-sidebar);
  padding: 20px 32px;
  transition: all var(--transition-normal);
}

.footer-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1100px;
  margin: 0 auto;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-copyright {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  gap: 20px;
}

.footer-links a {
  font-size: 0.82rem;
  color: var(--text-muted);
  transition: color var(--transition-fast);
}

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

/* ============================================
   CONFIRM DIALOG
   ============================================ */
.confirm-dialog {
  text-align: center;
  padding: 12px 0;
}

.confirm-dialog .confirm-icon {
  font-size: 3rem;
  margin-bottom: 16px;
}

.confirm-dialog h3 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.confirm-dialog p {
  font-size: 0.95rem;
  color: var(--text-muted);
}

/* ============================================
   IMPORT/EXPORT
   ============================================ */
.export-textarea {
  width: 100%;
  min-height: 200px;
  padding: 16px;
  border: 1.5px solid var(--input-border);
  border-radius: var(--radius-md);
  background: var(--input-bg);
  color: var(--text-primary);
  font-family: 'Courier New', monospace;
  font-size: 0.85rem;
  resize: vertical;
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(40px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

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

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

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ---- Staggered animation delay for result items ---- */
.result-item:nth-child(1) { animation-delay: 0s; }
.result-item:nth-child(2) { animation-delay: 0.05s; }
.result-item:nth-child(3) { animation-delay: 0.1s; }
.result-item:nth-child(4) { animation-delay: 0.15s; }
.result-item:nth-child(5) { animation-delay: 0.2s; }
.result-item:nth-child(6) { animation-delay: 0.25s; }
.result-item:nth-child(7) { animation-delay: 0.3s; }
.result-item:nth-child(8) { animation-delay: 0.35s; }
.result-item:nth-child(9) { animation-delay: 0.4s; }
.result-item:nth-child(10) { animation-delay: 0.45s; }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
  .navbar {
    padding: 12px 16px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    grid-template-areas: 
      ". logo actions"
      "search search search";
    row-gap: 16px;
  }

  .navbar-brand {
    grid-area: logo;
    justify-self: center;
  }

  .navbar-brand span {
    display: none;
  }
  
  .navbar-brand img {
    height: 36px;
  }

  .navbar-actions {
    grid-area: actions;
    justify-self: end;
  }

  .navbar-search {
    grid-area: search;
    margin: 0;
    max-width: 100%;
  }
  
  .navbar-search .search-input-wrap .search-icon {
    display: none;
  }
  
  .navbar-search .search-input-wrap input {
    padding-left: 16px;
    font-size: 16px;
  }

  .admin-link span {
    display: none;
  }

  .theme-toggle {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 50%;
    justify-content: center;
  }

  .theme-toggle span:not(.icon) {
    display: none;
  }
  
  .theme-toggle .icon {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .homepage {
    padding: 60px 16px 40px;
  }

  .logo-container img {
    max-width: 280px;
  }

  .search-input-wrap {
    height: 48px;
  }

  .search-btn {
    padding: 8px 18px;
    font-size: 0.88rem;
  }

  .quick-links {
    gap: 10px;
  }

  .quick-link-btn {
    padding: 10px 18px;
    font-size: 0.82rem;
  }

  .admin-header h1 {
    font-size: 1.4rem;
  }

  .admin-stats {
    grid-template-columns: 1fr;
  }

  .keywords-table-header {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }

  .search-filter input {
    width: 100%;
  }

  .keywords-table {
    display: block;
    overflow-x: auto;
  }

  .modal {
    max-height: 92vh;
    border-radius: var(--radius-md);
  }

  .footer-content {
    flex-direction: column;
    text-align: center;
  }

  .toast {
    min-width: unset;
    max-width: calc(100vw - 40px);
  }

  .result-item:hover {
    padding-left: 12px;
    margin: 0 -12px;
    padding-right: 12px;
  }
}

@media (max-width: 480px) {
  .admin-header-actions {
    width: 100%;
  }

  .admin-header-actions .btn {
    flex: 1;
    justify-content: center;
  }

  .actions-cell {
    flex-direction: column;
    gap: 4px;
  }
}
