/* ========================================
   IntelliAsk - Viral-Worthy Design
   Demo-first. Hook in 3 seconds.
   ======================================== */

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

body {
  font-family: 'Noto Sans', sans-serif;
  color: #202124;
  background: #fff;
  margin: 0;
  padding-top: 56px;
  -webkit-font-smoothing: antialiased;
}

/* ========================================
   Fixed Top Navbar
   ======================================== */
.navbar.is-fixed-top {
  background: #fff;
  border-bottom: 1px solid #e8eaed;
  box-shadow: none;
  height: 56px;
  z-index: 1000;
}

.nav-logo {
  font-family: 'Google Sans', sans-serif;
  font-weight: 700;
  padding: 0 16px;
}

.logo-text {
  font-size: 1.15rem;
  color: #1a73e8;
  letter-spacing: -0.02em;
}

.navbar-center {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-grow: 1;
}

.nav-link {
  font-family: 'Google Sans', sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  color: #5f6368 !important;
  padding: 0 16px;
  height: 56px;
  display: flex;
  align-items: center;
  border-bottom: 3px solid transparent;
  transition: color 0.15s, border-color 0.15s;
  cursor: pointer;
}

.nav-link:hover {
  color: #202124 !important;
}

.nav-link.active {
  color: #1a73e8 !important;
  border-bottom-color: #1a73e8;
}

.navbar-end .navbar-item {
  font-size: 0.875rem;
  color: #5f6368;
  gap: 6px;
}

.navbar-burger {
  color: #5f6368;
  height: 56px;
  width: 56px;
}

/* ========================================
   HERO = DEMO (the hook)
   ======================================== */
.hero-demo {
  padding: 48px 24px 40px;
  text-align: center;
  background: #f8f9fa;
  border-bottom: 1px solid #e8eaed;
}

.hero-demo-inner {
  max-width: 720px;
  margin: 0 auto;
}

.hero-paper-title {
  font-family: 'Google Sans', sans-serif;
  font-size: 1.15rem;
  font-weight: 600;
  color: #1a73e8;
  margin: 0 0 12px;
  letter-spacing: 0.01em;
}

.hero-headline {
  font-family: 'Google Sans', sans-serif;
  font-size: 1.6rem;
  font-weight: 700;
  color: #202124;
  line-height: 1.2;
  margin: 0 0 12px;
  letter-spacing: -0.02em;
}

.hero-subline {
  font-size: 0.95rem;
  color: #5f6368;
  margin: 0 0 6px;
  line-height: 1.5;
}

.hero-caveat {
  font-size: 0.75rem;
  color: #9aa0a6;
  margin: 0 0 28px;
  line-height: 1.4;
}

/* ========================================
   Demo Card
   ======================================== */
.demo-card {
  background: #fff;
  border: 1px solid #e8eaed;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 1px 3px rgba(60,64,67,0.08), 0 4px 8px rgba(60,64,67,0.04);
}

.demo-inner {
  max-width: 100%;
}

.demo-powered-by {
  margin-top: 20px;
  font-size: 0.72rem;
  color: #9aa0a6;
  text-align: center;
}

.demo-powered-by a {
  color: #1a73e8;
  text-decoration: none;
  font-weight: 500;
}

.demo-powered-by a:hover {
  text-decoration: underline;
}

/* Upload Row */
.upload-row {
  display: flex;
  gap: 12px;
  align-items: stretch;
}

.upload-area {
  flex: 1;
  position: relative;
  border: 2px dashed #dadce0;
  border-radius: 8px;
  padding: 16px 20px;
  cursor: pointer;
  transition: all 0.15s;
  background: #fff;
  display: flex;
  align-items: center;
}

.upload-area:hover {
  border-color: #1a73e8;
}

.upload-area.drag-over {
  border-color: #1a73e8;
  background: #e8f0fe;
  border-style: solid;
}

.upload-area.file-selected {
  border-color: #34a853;
  background: #e6f4ea;
  border-style: solid;
}

.upload-area input[type="file"] {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.upload-content {
  display: flex;
  align-items: center;
  gap: 12px;
  pointer-events: none;
  width: 100%;
}

.upload-icon {
  font-size: 1.5rem;
  color: #5f6368;
  flex-shrink: 0;
  transition: color 0.15s;
}

.upload-area:hover .upload-icon {
  color: #1a73e8;
}

.upload-area.file-selected .upload-icon {
  color: #34a853;
}

.upload-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  text-align: left;
}

.upload-text #file-name {
  font-size: 0.875rem;
  color: #202124;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.upload-text .file-meta {
  font-size: 0.75rem;
  color: #80868b;
}

/* Generate Button */
.generate-btn {
  padding: 14px 32px;
  font-size: 0.95rem;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  background: #1a73e8;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background 0.15s, box-shadow 0.15s, transform 0.1s;
  font-family: 'Google Sans', sans-serif;
  white-space: nowrap;
  flex-shrink: 0;
}

.generate-btn:hover:not(:disabled) {
  background: #1765cc;
  box-shadow: 0 2px 8px rgba(26,115,232,0.3);
  transform: translateY(-1px);
}

.generate-btn:active:not(:disabled) {
  background: #1557b0;
  transform: translateY(0);
}

.generate-btn:disabled,
.generate-btn.is-light {
  background: #e8eaed;
  color: #80868b;
  cursor: not-allowed;
  box-shadow: none;
}

.generate-btn.is-loading {
  background: #1a73e8;
  color: white;
}

/* ========================================
   Stats Bar (social proof)
   ======================================== */
.stats-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-top: 28px;
  padding: 0 8px;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 0 24px;
}

.stat-number {
  font-family: 'Google Sans', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: #202124;
}

.stat-highlight {
  color: #1a73e8;
}

.stat-label {
  font-size: 0.75rem;
  color: #80868b;
  text-align: center;
}

.stat-divider {
  width: 1px;
  height: 32px;
  background: #dadce0;
  flex-shrink: 0;
}

/* ========================================
   Example Output (instant gratification)
   ======================================== */
/* Resource Buttons */
.resource-buttons {
  margin-top: 24px;
  display: flex;
  gap: 10px;
  justify-content: center;
}

.resource-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: 20px;
  text-decoration: none;
  font-family: 'Google Sans', sans-serif;
  font-size: 0.84rem;
  font-weight: 500;
  color: #fff;
  background: #202124;
  transition: background 0.15s;
}

.resource-btn:hover {
  background: #3c4043;
  color: #fff;
}

.hf-icon {
  font-size: 0.95rem;
  line-height: 1;
}

/* ========================================
   Progress Display
   ======================================== */
.progress-container {
  margin-top: 16px;
}

.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px;
  background: #fff;
  border: 1px solid #e8eaed;
  border-radius: 8px;
  text-align: center;
}

.step-progress {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.step-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.step-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #e8eaed;
  color: #80868b;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.8rem;
}

.step-item.active .step-num {
  background: #1a73e8;
  color: white;
  animation: pulse 1.5s infinite;
}

.step-item.done .step-num {
  background: #34a853;
  color: white;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.step-time {
  font-size: 0.65rem;
  color: #34a853;
  margin-top: 4px;
  font-weight: 500;
}

.elapsed-time {
  color: #1a73e8;
  font-weight: 500;
}

.step-line {
  width: 32px;
  height: 2px;
  background: #e8eaed;
  margin: 0 6px;
}

.step-line.done {
  background: #34a853;
}

.loading-text strong {
  display: block;
  font-size: 0.95rem;
  color: #202124;
  margin-bottom: 4px;
}

.loading-text p {
  font-size: 0.8rem;
  color: #5f6368;
  margin: 0;
}

.upload-progress-bar {
  width: 100%;
  height: 4px;
  background: #e8eaed;
  border-radius: 2px;
  margin-top: 12px;
  overflow: hidden;
}

.upload-progress-fill {
  height: 100%;
  background: #1a73e8;
  border-radius: 2px;
  transition: width 0.3s ease;
}

/* ========================================
   Result Display
   ======================================== */
.result-container {
  margin-top: 16px;
}

.questions-list {
  display: flex;
  flex-direction: row;
  gap: 12px;
}

.questions-list > .result-success {
  flex: 1;
  min-width: 0;
}

.result-success {
  background: #fff;
  border: 1px solid #e8eaed;
  border-radius: 8px;
  padding: 16px;
  animation: fadeIn 0.3s ease;
  transition: box-shadow 0.15s;
}

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

.result-success:hover {
  box-shadow: 0 1px 3px rgba(60,64,67,0.2);
}

.result-header {
  margin-bottom: 8px;
}

.result-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #e8f0fe;
  color: #1967d2;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 500;
}

.result-question {
  font-size: 0.9rem;
  line-height: 1.6;
  color: #202124;
  white-space: pre-wrap;
}

.share-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #f1f3f4;
}

.action-btn {
  flex: 1;
  padding: 6px 12px;
  border: 1px solid #dadce0;
  background: white;
  color: #5f6368;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: all 0.15s;
}

.action-btn:hover {
  background: #f8f9fa;
  border-color: #5f6368;
}

.action-btn i {
  font-size: 0.8rem;
}

.result-error {
  background: #fce8e6;
  border: 1px solid #f28b82;
  border-radius: 8px;
  padding: 24px;
  text-align: center;
}

.error-icon {
  font-size: 1.5rem;
  color: #d93025;
  margin-bottom: 8px;
}

.error-message {
  color: #c5221f;
  font-weight: 500;
  font-size: 0.9rem;
}

/* ========================================
   Page Layout: Sidebar + Content
   ======================================== */
.page-layout {
  display: flex;
  max-width: 1400px;
  margin: 0 auto;
  min-height: calc(100vh - 200px);
}

/* ========================================
   Left Sidebar TOC
   ======================================== */
.sidebar-toc {
  position: sticky;
  top: 56px;
  height: calc(100vh - 56px);
  width: 180px;
  min-width: 180px;
  padding: 32px 0 32px 24px;
  overflow-y: auto;
  border-right: 1px solid #e8eaed;
}

.toc-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.toc-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 0 20px 20px 0;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s;
}

.toc-link:hover {
  background: #f1f3f4;
}

.toc-link.active {
  background: #e8f0fe;
}

.toc-indicator {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #dadce0;
  transition: all 0.2s;
  flex-shrink: 0;
}

.toc-link.active .toc-indicator {
  width: 6px;
  height: 6px;
  background: #1a73e8;
}

.toc-text {
  font-family: 'Google Sans', sans-serif;
  font-size: 0.8rem;
  font-weight: 500;
  color: #5f6368;
  transition: color 0.15s;
}

.toc-link.active .toc-text {
  color: #1a73e8;
}

/* ========================================
   Main Content Area
   ======================================== */
.main-content {
  flex: 1;
  min-width: 0;
  padding: 0 48px 48px;
  max-width: 960px;
}

/* ========================================
   Content Sections
   ======================================== */
.content-section {
  padding: 40px 0 32px;
  border-bottom: 1px solid #e8eaed;
}

.content-section:last-of-type {
  border-bottom: none;
}

.section-header {
  margin-bottom: 20px;
}

.section-title {
  font-family: 'Google Sans', sans-serif;
  font-size: 1.5rem;
  font-weight: 500;
  color: #202124;
  margin: 0 0 8px;
}

.section-desc {
  font-size: 0.95rem;
  color: #5f6368;
  margin: 0;
  line-height: 1.5;
}

.subsection-title {
  font-family: 'Google Sans', sans-serif;
  font-size: 1.15rem;
  font-weight: 500;
  color: #202124;
  margin: 32px 0 12px;
}

/* ========================================
   Paper Info Card (moved from hero)
   ======================================== */
.paper-info-section {
  padding-top: 32px;
}

.paper-info-card {
  background: #f8f9fa;
  border: 1px solid #e8eaed;
  border-radius: 12px;
  padding: 24px 28px;
  text-align: center;
}

.paper-info-title {
  font-family: 'Google Sans', sans-serif;
  font-size: 1.25rem;
  font-weight: 500;
  color: #202124;
  line-height: 1.35;
  margin: 0 0 8px;
}

.paper-info-authors {
  font-size: 0.9rem;
  color: #5f6368;
  margin: 0 0 16px;
}

.paper-info-authors a {
  color: #1a73e8;
  text-decoration: none;
}

.paper-info-authors a:hover {
  text-decoration: underline;
}

.paper-info-links {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.hero-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 20px;
  font-size: 0.875rem;
  font-weight: 500;
  font-family: 'Google Sans', sans-serif;
  color: #fff;
  background: #202124;
  border-radius: 20px;
  text-decoration: none;
  transition: background 0.15s;
}

.hero-btn:hover {
  background: #3c4043;
  color: #fff;
}

/* ========================================
   Teaser Section
   ======================================== */
.teaser-section {
  text-align: center;
}

.teaser-img {
  width: 100%;
  max-width: 800px;
  border-radius: 8px;
  border: 1px solid #e8eaed;
}

.teaser-caption {
  font-size: 0.9rem;
  color: #5f6368;
  margin-top: 12px;
  line-height: 1.5;
}

/* ========================================
   Text Content
   ======================================== */
.text-content {
  font-size: 0.925rem;
  line-height: 1.75;
  color: #3c4043;
}

.text-content p {
  margin: 0 0 12px;
}

.text-content p:last-child {
  margin-bottom: 0;
}

.text-content ul {
  margin: 8px 0 12px 20px;
  padding: 0;
}

.text-content li {
  margin-bottom: 6px;
}

.text-content strong {
  color: #202124;
}

/* ========================================
   Figures
   ======================================== */
.figure-container {
  margin-top: 20px;
  text-align: center;
}

.content-figure {
  width: 100%;
  max-width: 700px;
  border-radius: 8px;
  border: 1px solid #e8eaed;
}

/* ========================================
   Tables
   ======================================== */
.table-container {
  overflow-x: auto;
  margin: 12px 0;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.data-table th {
  text-align: left;
  padding: 10px 12px;
  background: #f8f9fa;
  color: #5f6368;
  font-weight: 600;
  font-size: 0.8rem;
  border-bottom: 2px solid #e8eaed;
  white-space: nowrap;
}

.data-table th:not(:first-child) {
  text-align: center;
}

.data-table td {
  padding: 8px 12px;
  border-bottom: 1px solid #f1f3f4;
  color: #3c4043;
}

.data-table td:not(:first-child) {
  text-align: center;
}

.data-table td strong {
  color: #1a73e8;
}

.data-table tbody tr:hover {
  background: #f8f9fa;
}

.row-highlight-red {
  background: #fce8e6 !important;
}

.row-highlight-red:hover {
  background: #f8d7da !important;
}

.row-highlight-blue {
  background: #e8f0fe !important;
}

.row-highlight-blue:hover {
  background: #d2e3fc !important;
}

.row-group-header td {
  background: #f1f3f4 !important;
  font-weight: 600;
  font-size: 0.8rem;
  color: #202124;
  padding: 6px 12px;
}

.data-table.compact {
  font-size: 0.8rem;
}

.data-table.compact td,
.data-table.compact th {
  padding: 6px 10px;
}

.table-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 12px 0;
}

.table-caption {
  font-size: 0.8rem;
  color: #5f6368;
  text-align: center;
  margin-top: 8px;
}

/* ========================================
   BibTeX
   ======================================== */
.bibtex-block {
  background: #f8f9fa;
  border: 1px solid #e8eaed;
  border-radius: 8px;
  padding: 16px 20px;
  font-size: 0.8rem;
  line-height: 1.6;
  overflow-x: auto;
}

.bibtex-block code {
  font-family: 'Roboto Mono', monospace;
  color: #3c4043;
}

/* ========================================
   Footer
   ======================================== */
.site-footer {
  padding: 24px 0;
  text-align: center;
  font-size: 0.8rem;
  color: #80868b;
}

.site-footer a {
  color: #5f6368;
  text-decoration: underline;
}

/* ========================================
   Responsive
   ======================================== */

/* Hide sidebar on tablets and below */
@media (max-width: 1024px) {
  .sidebar-toc {
    display: none;
  }

  .main-content {
    padding: 0 24px 32px;
    max-width: 100%;
  }

  .page-layout {
    display: block;
  }

  .table-split {
    grid-template-columns: 1fr;
  }
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .hero-demo {
    padding: 32px 16px 28px;
  }

  .hero-headline {
    font-size: 1.3rem;
  }

  .hero-subline {
    font-size: 0.85rem;
  }

  .demo-card {
    padding: 16px;
  }

  .upload-row {
    flex-direction: column;
  }

  .questions-list {
    flex-direction: column;
  }

  .generate-btn {
    width: 100%;
    justify-content: center;
  }

  .stats-bar {
    flex-direction: column;
    gap: 16px;
  }

  .stat-divider {
    width: 40px;
    height: 1px;
  }

  .resource-buttons {
    flex-wrap: wrap;
  }

  .main-content {
    padding: 0 16px 24px;
  }

  .content-section {
    padding: 28px 0 20px;
  }

  .section-title {
    font-size: 1.25rem;
  }

  .table-split {
    grid-template-columns: 1fr;
  }

  .navbar-center {
    display: none;
  }

  .paper-info-card {
    padding: 16px 20px;
  }

  .paper-info-title {
    font-size: 1.1rem;
  }
}

/* Navbar mobile menu */
@media (max-width: 1024px) {
  .navbar-menu.is-active {
    display: block;
    background: #fff;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    border-bottom: 1px solid #e8eaed;
  }

  .navbar-center {
    flex-direction: column;
    align-items: flex-start;
  }

  .nav-link {
    height: auto;
    padding: 12px 16px;
    border-bottom: none;
  }

  .nav-link.active {
    background: #e8f0fe;
    border-bottom: none;
    border-radius: 4px;
  }
}

/* ========================================
   Bulma Overrides
   ======================================== */
.navbar {
  min-height: 56px;
}

.navbar-item img {
  max-height: 2rem;
}

.hero {
  background: none;
}

.section {
  background: none;
}
