/* ====================================================================
   JOURNALSEARCH - MODERN & REFINED UI STYLESHEET
   Clean, Minimalist, Human-Friendly Design
   ==================================================================== */

:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-dark: #1e40af;
  --primary-light: #eff6ff;
  --primary-border: #bfdbfe;

  --success: #10b981;
  --success-hover: #059669;
  --success-light: #ecfdf5;
  --success-border: #a7f3d0;
  --success-text: #065f46;

  --warning: #f59e0b;
  --warning-light: #fffbeb;
  --warning-border: #fde68a;
  --warning-text: #92400e;

  --danger: #ef4444;
  --danger-light: #fef2f2;
  --danger-border: #fecaca;
  --danger-text: #991b1b;

  --text-main: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --text-light: #94a3b8;

  --bg-body: #f8fafc;
  --bg-card: #ffffff;
  --bg-subtle: #f1f5f9;

  --border: #e2e8f0;
  --border-hover: #cbd5e1;
  --border-focus: #3b82f6;

  --shadow-xs: 0 1px 2px 0 rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 2px 4px -1px rgba(15, 23, 42, 0.06), 0 1px 2px -1px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 12px -2px rgba(15, 23, 42, 0.08), 0 2px 6px -1px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 12px 24px -4px rgba(15, 23, 42, 0.08), 0 4px 8px -2px rgba(15, 23, 42, 0.04);
  --shadow-xl: 0 20px 32px -6px rgba(15, 23, 42, 0.12), 0 8px 16px -4px rgba(15, 23, 42, 0.06);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --radius-full: 9999px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-body);
  background-image: 
    radial-gradient(at 0% 0%, rgba(37, 99, 235, 0.03) 0px, transparent 50%),
    radial-gradient(at 100% 0%, rgba(79, 70, 229, 0.03) 0px, transparent 50%);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* NAVBAR */
.navbar {
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.03);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--text-main);
}

.brand-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  flex-shrink: 0;
}

.brand-name {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #0f172a;
}

.brand-tag {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-light);
  border: 1px solid var(--primary-border);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: nowrap;
}

.nav-btn-icon {
  flex-shrink: 0;
}

.sub-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
  transition: all 0.2s;
  cursor: pointer;
}

.sub-status-pill.trial {
  background: #fffbeb;
  color: #b45309;
  border: 1px solid #fde68a;
}

.sub-status-pill.active {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.sub-status-pill.expired {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.btn-upgrade-nav {
  background: var(--primary);
  color: #ffffff;
  border: none;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-upgrade-nav:hover {
  background: var(--primary-hover);
}

.btn-nav-action, .btn-settings-badge, .nav-user-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.8rem;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: #ffffff;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-nav-action:hover, .btn-settings-badge:hover, .nav-user-badge:hover {
  background: var(--bg-subtle);
  border-color: var(--border-hover);
  color: var(--text-main);
}

.nav-user-badge.registered {
  border-color: var(--primary-border);
  background: var(--primary-light);
  color: var(--primary-dark);
  font-weight: 700;
}

.badge-count {
  background: var(--primary);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 0.1rem 0.45rem;
  border-radius: var(--radius-full);
  line-height: 1;
}

/* MAIN WRAPPER */
.main-wrapper {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.25rem 3.5rem;
  width: 100%;
}

/* HERO */
.hero-section {
  text-align: center;
  margin-bottom: 2rem;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: #ffffff;
  border: 1px solid var(--border);
  padding: 0.35rem 0.9rem;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--primary);
  box-shadow: var(--shadow-xs);
  margin-bottom: 1rem;
}

.hero-title {
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.25;
  color: #0f172a;
  margin-bottom: 0.85rem;
}

.hero-title span {
  color: var(--primary);
}

.hero-subtitle {
  font-size: 1rem;
  color: var(--text-muted);
  max-width: 760px;
  margin: 0 auto 1.5rem;
  line-height: 1.6;
}

.hero-features-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.hero-feat-item {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.feat-bullet {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
  flex-shrink: 0;
}

/* SEARCH CARD */
.search-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  box-shadow: var(--shadow-lg);
  margin-bottom: 1.5rem;
}

.input-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
  flex-wrap: wrap;
  gap: 0.4rem;
}

.input-hint {
  font-size: 0.76rem;
  font-weight: 500;
  color: var(--text-muted);
}

.search-input-wrapper {
  margin-bottom: 1rem;
}

.search-textarea {
  width: 100%;
  padding: 0.9rem 1.1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  font-family: inherit;
  font-size: 0.98rem;
  line-height: 1.5;
  color: var(--text-main);
  resize: vertical;
  min-height: 72px;
  background: #fdfdfd;
  transition: all 0.2s ease;
}

.search-textarea:focus {
  outline: none;
  border-color: var(--primary);
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.search-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.sample-chips {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  flex: 1;
}

.sample-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  white-space: nowrap;
}

.chip-btn {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 0.32rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s;
  white-space: nowrap;
}

.chip-btn:hover {
  background: var(--primary-light);
  border-color: var(--primary-border);
  color: var(--primary);
}

.btn-search {
  background: var(--primary);
  color: #ffffff;
  border: none;
  padding: 0.75rem 1.4rem;
  border-radius: var(--radius-lg);
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
  transition: all 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
}

.btn-search:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.32);
}

.btn-search:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

/* LOADING */
.loading-box {
  display: none;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 2.5rem;
  text-align: center;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.spinner {
  width: 38px;
  height: 38px;
  border: 3.5px solid #e2e8f0;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 1rem;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.35rem;
}

.loading-desc {
  font-size: 0.84rem;
  color: var(--text-muted);
}

/* ANALYSIS CARD */
.analysis-card {
  display: none;
  background: #ffffff;
  border: 1px solid var(--primary-border);
  border-radius: var(--radius-lg);
  padding: 1.15rem 1.35rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-xs);
}

.analysis-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #f1f5f9;
  margin-bottom: 0.85rem;
  font-size: 0.9rem;
  color: var(--text-main);
  flex-wrap: wrap;
  gap: 0.5rem;
}

.analysis-badge {
  background: var(--primary-light);
  color: var(--primary-dark);
  font-size: 0.74rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--primary-border);
}

.analysis-items {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.analysis-item {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  font-size: 0.82rem;
  color: var(--text-secondary);
  flex-wrap: wrap;
}

.analysis-item strong {
  color: var(--text-main);
  white-space: nowrap;
}

.keywords-tags {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.tag {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-secondary);
}

/* TOOLBAR & FILTERS */
.toolbar-card {
  display: none;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 1.25rem 1.4rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.toolbar-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.85rem;
}

.results-summary {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

#resultsCountText {
  font-size: 1.05rem;
  font-weight: 800;
  color: #0f172a;
}

.badge-verified {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.74rem;
  font-weight: 700;
  color: #047857;
  background: #d1fae5;
  border: 1px solid #a7f3d0;
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-full);
}

.ratio-indicator {
  font-size: 0.78rem;
  color: #1e40af;
  background: var(--primary-light);
  border: 1px solid var(--primary-border);
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  display: inline-block;
}

.toolbar-exports {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.btn-export {
  background: #ffffff;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 0.42rem 0.75rem;
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s;
  white-space: nowrap;
}

.btn-export:hover {
  background: var(--bg-subtle);
  border-color: var(--border-hover);
  color: var(--text-main);
}

.filters-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 0.75rem;
  align-items: flex-end;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.filter-group label {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-muted);
}

.filter-select {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-main);
  background: #ffffff;
  cursor: pointer;
  transition: border-color 0.2s;
}

.filter-select:focus {
  outline: none;
  border-color: var(--primary);
}

/* JOURNALS LIST */
.journals-list {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

/* JOURNAL CARD (SEAMLESS, SIMPLE, MINIMALIST) */
.journal-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 1.35rem 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  position: relative;
}

.journal-card:hover {
  border-color: #cbd5e1;
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.journal-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.badges-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.badge-pill {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  white-space: nowrap;
}

.badge-relevance {
  background: #f0fdf4;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.badge-year {
  background: #f8fafc;
  color: #475569;
  border: 1px solid #e2e8f0;
}

.badge-origin-id {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.badge-origin-en {
  background: #eff6ff;
  color: #1e40af;
  border: 1px solid #bfdbfe;
}

.badge-oa {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.badge-citations {
  background: #fffbeb;
  color: #b45309;
  border: 1px solid #fde68a;
}

.btn-star {
  background: none;
  border: none;
  font-size: 1.3rem;
  color: #cbd5e1;
  cursor: pointer;
  padding: 0.2rem;
  line-height: 1;
  transition: all 0.2s;
}

.btn-star:hover, .btn-star.active {
  color: #f59e0b;
  transform: scale(1.15);
}

.journal-title {
  font-size: 1.08rem;
  font-weight: 800;
  line-height: 1.45;
  margin: 0;
}

.journal-title a {
  color: #0f172a;
  text-decoration: none;
  transition: color 0.18s;
}

.journal-title a:hover {
  color: var(--primary);
}

.journal-meta {
  font-size: 0.83rem;
  color: #64748b;
  line-height: 1.4;
}

.chapter-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 0.65rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.chapter-badge {
  font-size: 0.78rem;
  font-weight: 700;
  color: #1e293b;
}

.chapter-desc {
  font-size: 0.78rem;
  color: #64748b;
  line-height: 1.4;
}

.abstract-box {
  background: #fafafa;
  border: 1px solid #f1f5f9;
  border-radius: var(--radius-md);
  padding: 0.65rem 0.85rem;
  font-size: 0.82rem;
  color: #475569;
  line-height: 1.5;
}

.abstract-clamp {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.btn-toggle-abstract {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
  margin-top: 0.25rem;
}

.journal-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.65rem;
  border-top: 1px solid #f1f5f9;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.footer-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.link-btn {
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-md);
  transition: all 0.18s;
  white-space: nowrap;
}

.link-pdf {
  background: #059669;
  color: #ffffff;
  border: none;
}

.link-pdf:hover {
  background: #047857;
}

.link-doi {
  background: #f8fafc;
  color: #334155;
  border: 1px solid #cbd5e1;
}

.link-doi:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.btn-cite-action {
  background: var(--primary-light);
  border: 1px solid var(--primary-border);
  color: var(--primary-dark);
}

.btn-cite-action:hover {
  background: #dbeafe;
}

/* LOCKED / EXPIRED CARDS & FULL BLUR OVERLAY */
.journal-card.card-locked-expired {
  filter: blur(5px) grayscale(40%);
  user-select: none;
  -webkit-user-select: none;
  opacity: 0.55;
  cursor: pointer;
  transition: filter 0.3s ease, opacity 0.3s ease;
}

.journal-card.card-locked-expired a,
.journal-card.card-locked-expired button {
  pointer-events: none;
}

.locked-expired-overlay-box {
  position: relative;
  width: 100%;
  margin-bottom: 1.5rem;
}

.locked-expired-banner {
  background: #ffffff;
  border: 2px solid #3b82f6;
  border-radius: var(--radius-xl);
  padding: 1.85rem 1.5rem;
  text-align: center;
  box-shadow: 0 16px 36px -6px rgba(37, 99, 235, 0.22);
}

.locked-expired-banner h3 {
  font-size: 1.25rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 0.4rem;
}

.locked-expired-banner p {
  font-size: 0.88rem;
  color: #475569;
  max-width: 580px;
  margin: 0 auto 1.25rem;
  line-height: 1.55;
}

.locked-feature-btn {
  opacity: 0.6 !important;
  cursor: not-allowed !important;
  background: #f1f5f9 !important;
  color: #94a3b8 !important;
  border-color: #cbd5e1 !important;
}

/* MODALS */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  overflow-y: auto;
}

.modal-content {
  background: #ffffff;
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 580px;
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  animation: modalIn 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}

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

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.15rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: #f8fafc;
}

.modal-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.4rem;
  color: #64748b;
  cursor: pointer;
  line-height: 1;
  padding: 0.2rem;
  transition: color 0.18s;
}

.modal-close:hover {
  color: #0f172a;
}

.modal-body {
  padding: 1.25rem 1.5rem;
}

/* CHECKOUT MODAL */
.checkout-modal-content {
  max-width: 680px;
  border-top: 5px solid var(--primary);
}

.checkout-header {
  background: #ffffff;
  padding: 1.2rem 1.5rem;
}

.checkout-icon-badge {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.plans-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

@media (max-width: 680px) {
  .plans-grid {
    grid-template-columns: 1fr;
  }
}

.plan-card {
  background: #ffffff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  position: relative;
  transition: all 0.2s;
}

.plan-card:hover {
  border-color: #94a3b8;
  transform: translateY(-2px);
}

.plan-card.active {
  border-color: var(--primary);
  background: #f8fafc;
  box-shadow: 0 0 0 2px var(--primary);
}

.plan-card.popular {
  border-color: #3b82f6;
}

.plan-badge-highlight {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: #2563eb;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.plan-name {
  font-size: 0.95rem;
  font-weight: 800;
  color: #0f172a;
}

.plan-desc {
  font-size: 0.74rem;
  color: #64748b;
  margin: 0.25rem 0 0.65rem;
  line-height: 1.35;
  min-height: 32px;
}

.plan-price-box {
  display: flex;
  align-items: baseline;
  gap: 0.2rem;
  margin-bottom: 0.75rem;
}

.plan-currency {
  font-size: 0.8rem;
  font-weight: 700;
  color: #0f172a;
}

.plan-amount {
  font-size: 1.35rem;
  font-weight: 900;
  color: #0f172a;
  letter-spacing: -0.02em;
}

.plan-period {
  font-size: 0.72rem;
  color: #64748b;
}

.btn-plan-select {
  width: 100%;
  background: #ffffff;
  border: 1.5px solid var(--border);
  color: var(--text-secondary);
  padding: 0.45rem;
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  margin-bottom: 0.85rem;
  transition: all 0.18s;
}

.btn-plan-select.primary, .plan-card.active .btn-plan-select {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

.plan-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.74rem;
  color: var(--text-secondary);
  border-top: 1px dashed var(--border);
  padding-top: 0.65rem;
}

.order-summary-box {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0.9rem 1.15rem;
}

.btn-pay-snap {
  width: 100%;
  background: linear-gradient(135deg, #0284c7, #0369a1);
  color: #ffffff;
  border: none;
  padding: 0.95rem 1.25rem;
  border-radius: var(--radius-lg);
  font-weight: 800;
  font-size: 0.95rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.3);
  transition: all 0.2s;
}

.btn-pay-snap:hover {
  background: linear-gradient(135deg, #0369a1, #075985);
  transform: translateY(-1px);
}

.midtrans-status-strip {
  font-size: 0.75rem;
  color: #0369a1;
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.btn-simulate-sandbox {
  width: 100%;
  background: #ffffff;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 0.6rem 1rem;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
  transition: background 0.18s;
}

.btn-simulate-sandbox:hover {
  background: #f1f5f9;
  color: var(--text-main);
}

/* USER DASHBOARD MODAL */
.user-dashboard-modal {
  max-width: 680px;
}

.user-avatar-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.dash-tabs-bar {
  display: flex;
  border-bottom: 1px solid var(--border);
  background: #f8fafc;
  padding: 0 1.25rem;
  gap: 0.5rem;
}

.dash-tab-btn {
  background: none;
  border: none;
  padding: 0.75rem 0.85rem;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.18s;
}

.dash-tab-btn:hover {
  color: var(--text-main);
}

.dash-tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.dash-tab-pane {
  display: none;
}

.dash-tab-pane.active {
  display: block;
}

.dash-license-card {
  background: #eff6ff;
  border: 1.5px solid var(--primary-border);
  border-radius: var(--radius-lg);
  padding: 1.1rem;
  margin-bottom: 1.25rem;
}

.status-chip-active {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-full);
}

.dash-user-info-box {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem 1.15rem;
}

.info-row {
  display: flex;
  justify-content: space-between;
  padding: 0.35rem 0;
  border-bottom: 1px dashed #f1f5f9;
  font-size: 0.82rem;
}

.info-row:last-child {
  border-bottom: none;
}

.info-label {
  color: var(--text-muted);
}

.info-val {
  font-weight: 700;
  color: var(--text-main);
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 0.82rem;
}

.btn-re-search {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

/* AUTH MODAL */
.auth-modal-content {
  max-width: 460px;
}

.auth-modal-header {
  background: #ffffff;
  padding: 1.25rem 1.5rem;
}

.auth-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  background: #f8fafc;
}

.auth-tab-btn {
  flex: 1;
  background: none;
  border: none;
  padding: 0.75rem;
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.18s;
}

.auth-tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  background: #ffffff;
}

.auth-modal-body {
  padding: 1.35rem 1.5rem;
}

.btn-google-auth {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: var(--radius-md);
  padding: 0.65rem 1rem;
  font-size: 0.88rem;
  font-weight: 700;
  color: #1e293b;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
}

.btn-google-auth:hover {
  background: #f8fafc;
  border-color: #94a3b8;
  box-shadow: 0 3px 8px rgba(15, 23, 42, 0.08);
}

.auth-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 0.9rem 0 0.75rem;
  color: #94a3b8;
  font-size: 0.74rem;
  font-weight: 600;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid #e2e8f0;
}

.auth-divider span {
  padding: 0 0.65rem;
}

.auth-form-layout {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.auth-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
}

.form-control-input {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.86rem;
  color: var(--text-main);
  background: #ffffff;
  transition: border-color 0.18s;
}

.form-control-input:focus {
  outline: none;
  border-color: var(--primary);
}

.auth-submit-btn {
  width: 100%;
  padding: 0.75rem;
  border-radius: var(--radius-md);
  font-size: 0.92rem;
  margin-top: 0.35rem;
}

.auth-alert {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  padding: 0.75rem;
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
}

/* PDF PREVIEW MODAL */
.pdf-modal-content {
  max-width: 1000px;
  width: 95%;
  height: 90vh;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.pdf-header {
  padding: 0.85rem 1.25rem;
  flex-shrink: 0;
}

.pdf-header-info {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  max-width: 65%;
  overflow: hidden;
}

.pdf-icon-box {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.pdf-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
}

.pdf-subtitle {
  font-size: 0.74rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pdf-header-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
}

.btn-download-pdf {
  padding: 0.4rem 0.85rem;
  font-size: 0.82rem;
}

.pdf-body {
  flex: 1;
  padding: 0;
  position: relative;
  background: #334155;
  display: flex;
  flex-direction: column;
}

.pdf-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.85);
  color: #fff;
  z-index: 10;
}

.pdf-iframe {
  width: 100%;
  height: 100%;
  border: none;
  flex: 1;
  background: #525659;
}

.pdf-fallback {
  display: none;
  padding: 1.25rem;
  background: #ffffff;
  text-align: center;
  border-top: 1px solid var(--border);
}

/* CITATION MODAL */
.cite-tabs {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 0.85rem;
  flex-wrap: wrap;
}

.cite-tab {
  background: #ffffff;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s;
}

.cite-tab.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

.cite-box {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-bottom: 1rem;
}

.cite-text {
  font-family: inherit;
  font-size: 0.86rem;
  color: var(--text-main);
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.55;
}

.cite-actions {
  display: flex;
  justify-content: flex-end;
}

/* BOOKMARKS */
.bookmark-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  max-height: 55vh;
  overflow-y: auto;
  margin-bottom: 1rem;
}

.bookmark-item {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.75rem 0.95rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.bookmark-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border);
  padding-top: 0.85rem;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* SETTINGS SECTION */
.settings-section-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem;
  margin-bottom: 1rem;
  background: #ffffff;
}

.settings-section-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}

/* FOOTER */
.footer {
  margin-top: auto;
  padding: 2rem 1.25rem;
  border-top: 1px solid var(--border);
  background: #ffffff;
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* TOAST NOTIFICATION */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  background: #0f172a;
  color: #ffffff;
  padding: 0.75rem 1.15rem;
  border-radius: var(--radius-md);
  font-size: 0.84rem;
  font-weight: 600;
  box-shadow: var(--shadow-xl);
  pointer-events: auto;
  animation: toastIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

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

/* GATING BANNER */
.locked-teaser-container {
  margin-top: 1rem;
}

.locked-gate-banner {
  background: linear-gradient(135deg, #1e293b, #0f172a);
  color: #ffffff;
  padding: 1.75rem;
  border-radius: var(--radius-xl);
  text-align: center;
  box-shadow: var(--shadow-lg);
}

.locked-gate-title {
  font-size: 1.15rem;
  font-weight: 800;
  margin-bottom: 0.4rem;
}

.locked-gate-desc {
  font-size: 0.86rem;
  color: #94a3b8;
  max-width: 600px;
  margin: 0 auto 1.25rem;
  line-height: 1.55;
}

.btn-unlock-gate {
  background: var(--primary);
  color: #ffffff;
  border: none;
  padding: 0.8rem 1.6rem;
  border-radius: var(--radius-lg);
  font-size: 0.92rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

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

.locked-blur-preview {
  filter: blur(4px);
  user-select: none;
  pointer-events: none;
  opacity: 0.65;
}

/* RESPONSIVE */
@media (max-width: 768px) {
  .hero-title {
    font-size: 1.65rem;
  }
  .nav-container {
    padding: 0.65rem 1rem;
  }
  .brand-name {
    font-size: 1rem;
  }
  .brand-tag {
    display: none;
  }
  .search-card {
    padding: 1.15rem;
  }
  .toolbar-top {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Google One Tap Floating Widget (Top Right Corner) */
.g-onetap-widget {
  position: fixed;
  top: 18px;
  right: 20px;
  z-index: 10000;
  animation: slideInOneTap 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slideInOneTap {
  from {
    opacity: 0;
    transform: translateY(-15px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.g-onetap-card {
  width: 360px;
  max-width: calc(100vw - 40px);
  background: #202124;
  color: #e8eaed;
  border-radius: 12px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.45), 0 2px 6px rgba(0, 0, 0, 0.25);
  padding: 0.9rem 1.1rem 1rem;
  border: 1px solid #3c4043;
  font-family: Roboto, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

.g-onetap-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
}

.g-onetap-title {
  font-size: 0.82rem;
  font-weight: 500;
  color: #e8eaed;
}

.g-onetap-close {
  background: none;
  border: none;
  color: #9aa0a6;
  font-size: 1.35rem;
  cursor: pointer;
  line-height: 1;
  padding: 0.1rem 0.3rem;
  border-radius: 50%;
  transition: all 0.2s;
}

.g-onetap-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.g-onetap-account-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.65rem;
  border-radius: 8px;
  background: #303134;
  cursor: pointer;
  margin-bottom: 0.85rem;
  transition: background 0.15s;
}

.g-onetap-account-row:hover {
  background: #3c4043;
}

.g-onetap-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #1a73e8;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  flex-shrink: 0;
}

.g-onetap-account-info {
  flex: 1;
  min-width: 0;
}

.g-onetap-name {
  font-weight: 600;
  font-size: 0.88rem;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.g-onetap-email {
  font-size: 0.76rem;
  color: #bdc1c6;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.g-onetap-btn-continue {
  width: 100%;
  background: #1a73e8;
  color: #ffffff;
  border: none;
  border-radius: 6px;
  padding: 0.65rem 1rem;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.g-onetap-btn-continue:hover {
  background: #1557b0;
}

