/* ===================================================================
   EkaScribe Changelog — base.css
   Design tokens derived from existing site (index.html).
   Layout pattern from Linear/Cursor changelogs.
   =================================================================== */

/* --- CSS Variables (matches existing site) --- */
:root {
  --color-primary: #215fff;
  --color-primary-hover: #1e56e6;
  --font-display: 'Figtree', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --radius-box: 0.75rem;
  --radius-field: 0.5rem;
  --hero-pattern: url("data:image/svg+xml;utf8,\
<svg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'>\
  <rect width='24' height='24' fill='none'/>\
  <circle cx='2' cy='2' r='1.5' fill='%23000000' fill-opacity='0.05'/>\
</svg>");

  /* DaisyUI base color variables */
  --b1: 255 255 255;
  --b2: 249 250 251;
  --b3: 243 244 246;
  --bc: 17 24 39;
  --p: 33 95 255;
  --pf: 33 95 255;
  --pc: 255 255 255;
  --s: 34 197 94;
  --sf: 22 163 74;
  --sc: 255 255 255;
  --a: 245 158 11;
  --af: 217 119 6;
  --ac: 255 255 255;
  --e: 239 68 68;
  --ef: 220 38 38;
  --ec: 255 255 255;
  --n: 107 114 128;
  --nf: 75 85 99;
  --nc: 255 255 255;
}

body {
  font-family: var(--font-body);
  color: #111827;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.font-display {
  font-family: var(--font-display);
}

/* --- Site-wide shared styles (from index.html inline CSS) --- */

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

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

.btn-soft {
  background-color: rgba(33, 95, 255, 0.1);
  border-color: rgba(33, 95, 255, 0.2);
  color: var(--color-primary);
}

.btn-soft:hover {
  background-color: rgba(33, 95, 255, 0.15);
  border-color: rgba(33, 95, 255, 0.3);
}

.text-primary {
  color: var(--color-primary);
}

.footer-pattern {
  background-image: var(--hero-pattern), linear-gradient(135deg, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.9) 100%);
  background-size: auto, cover;
}

/* WhatsApp Badge */
.whatsapp-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: #FFFFFF;
  color: #1a1a1a;
  font-weight: 600;
  font-size: 14px;
  border-radius: 8px;
  text-decoration: none;
  border: 1.5px solid #e5e7eb;
  white-space: nowrap;
  transition: all 0.2s ease;
  line-height: 1;
  overflow: hidden;
}

.whatsapp-badge span {
  color: #1a1a1a;
  position: relative;
  z-index: 1;
}

.whatsapp-badge .fab.fa-whatsapp,
.whatsapp-badge i.fab {
  font-size: 18px;
  color: #25D366;
  position: static;
  display: inline-block;
  line-height: 1;
}

.whatsapp-badge:hover {
  background: #f0fdf4;
  border-color: #25D366;
}

.new-badge {
  background: #22c55e !important;
  color: #ffffff !important;
  font-size: 8px;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: 3px;
  line-height: 1.2;
  letter-spacing: 0.2px;
  text-transform: uppercase;
}

/* Mobile WhatsApp Badge */
.whatsapp-badge-mobile {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem 1.5rem;
  background: #FFFFFF;
  color: #1a1a1a;
  font-weight: 600;
  font-size: 1rem;
  border-radius: 8px;
  box-shadow: none;
  transition: all 0.3s ease;
  text-decoration: none;
  border: 1.5px solid #e5e7eb;
  width: 100%;
}

.whatsapp-badge-mobile i {
  font-size: 1.5rem;
  color: #25D366;
}

.whatsapp-badge-mobile span {
  color: #1a1a1a;
}

.whatsapp-badge-mobile:hover {
  background: #f0fdf4;
  border-color: #25D366;
}

/* Dropdown */
.dropdown {
  position: relative;
}

.dropdown-toggle {
  padding: 0.5rem 1rem;
  cursor: pointer;
  background: transparent;
  border: none;
  color: inherit;
}

.dropdown-toggle:hover {
  color: var(--color-primary);
}

.dropdown-hover .dropdown-content {
  visibility: hidden;
  opacity: 0;
  transition: all 0.2s ease;
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(6px);
  pointer-events: none;
}

.dropdown-open .dropdown-content {
  visibility: visible;
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

.dropdown-content {
  min-width: 200px;
}

.dropdown-content li a {
  padding: 10px 16px;
  transition: all 0.2s ease;
}

.dropdown-content li a:hover {
  background-color: rgba(33, 95, 255, 0.08);
  color: var(--color-primary);
}

/* Navbar layout */
@media (min-width: 1024px) {
  .navbar-end {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    flex-wrap: nowrap;
  }

  .navbar-end .menu.menu-horizontal {
    flex-wrap: nowrap;
    gap: 0.1rem;
  }

  .navbar-end .menu.menu-horizontal > li > a {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }
}

.navbar {
  position: relative;
  z-index: 50;
}

/* Auto-hide navbar styles */
.navbar-hidden {
  transform: translateY(-100%);
  transition: transform 0.3s ease-in-out;
}

/* Mobile navbar positioning */
.drawer.lg\:hidden .navbar {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
}

/* Mobile Collapse Styles */
.collapse-content {
  padding-left: 0 !important;
}

.collapse-title {
  padding-left: 1rem !important;
}

/* Force-hide elements on mobile */
@media (max-width: 767px) {
  .mobile-hide {
    display: none !important;
  }

  .mobile-nav-btn i {
    display: none !important;
  }

  .mobile-nav-btn:focus,
  .mobile-nav-btn:focus-visible {
    outline: none !important;
    box-shadow: none !important;
  }

  .mobile-nav-btn {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
}

/* ===================================================================
   CHANGELOG-SPECIFIC STYLES
   Layout pattern: Linear / Cursor changelog
   =================================================================== */

/* --- Main container --- */
.changelog-main {
  min-height: 60vh;
  padding-top: 24px;
  padding-bottom: 64px;
  background: #ffffff;
}

@media (max-width: 767px) {
  .changelog-main {
    padding-top: 80px; /* account for fixed mobile navbar */
  }
}

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

/* --- Changelog header --- */
.changelog-header {
  padding: 48px 0 40px;
}

.changelog-label {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: #111827;
  margin: 0;
}

.changelog-description {
  font-size: 0.875rem;
  color: #374151;
  margin: 6px 0 0;
  line-height: 1.5;
}

/* --- Breadcrumb (individual entry pages) --- */
.changelog-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8125rem;
  font-weight: 500;
}

.changelog-breadcrumb-link {
  color: var(--color-primary);
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 600;
  transition: color 0.15s ease;
}

.changelog-breadcrumb-link:hover {
  color: var(--color-primary-hover);
}

.changelog-breadcrumb-sep {
  color: #d1d5db;
}

.changelog-breadcrumb-current {
  color: #6b7280;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 400px;
}

/* --- Entry grid: date left, content right (desktop) --- */
.changelog-entry {
  border-bottom: none;
}

.changelog-entry-grid {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 0 48px;
  padding: 48px 0;
}

/* --- Date column --- */
.changelog-entry-date {
  position: relative;
  text-align: center;
}

.changelog-date-text {
  margin: 0;
}

.changelog-date-text a {
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
  color: #6b7280;
  text-decoration: none;
  transition: color 0.15s ease;
}

.changelog-date-text a:hover {
  color: var(--color-primary);
}

.changelog-date-text time {
  display: block;
}

/* --- Content column --- */
.changelog-entry-content {
  min-width: 0;
}

/* --- Timeline (listing page only) --- */

/* Continuous line through date column center */
.changelog-timeline .changelog-entry-date {
  overflow: visible;
}

.changelog-timeline .changelog-entry-date::before {
  content: '';
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: -48px;
  bottom: -48px;
  width: 1px;
  background: #e5e7eb;
  pointer-events: none;
}

/* First entry: line starts below the dot */
.changelog-timeline .changelog-entry:first-child .changelog-entry-date::before {
  top: 38px;
}

/* Last entry: line ends above the date text */
.changelog-timeline .changelog-entry:last-child .changelog-entry-date::before {
  top: -48px;
  bottom: auto !important;
  height: 48px; /* only spans the gap from previous entry to this date text top */
}

/* Single entry: no line */
.changelog-timeline .changelog-entry:only-child .changelog-entry-date::before {
  display: none;
}

/* Last entry: no dot */
.changelog-timeline .changelog-entry:last-child .changelog-entry-date::after {
  display: none;
}

/* Date text covers the line behind it — creates the gap effect */
.changelog-timeline .changelog-date-text {
  position: relative;
  z-index: 2;
  background: #ffffff;
  padding: 4px 12px;
  display: inline-block;
}

/* Dot below date text, on the line */
.changelog-timeline .changelog-entry-date::after {
  content: '';
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 30px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #d1d5db;
  z-index: 3;
}

/* --- Content column --- */
.changelog-entry-content {
  min-width: 0; /* prevent overflow */
}

.changelog-entry-header {
  margin-bottom: 24px;
}

/* --- Category badges --- */
.changelog-badge {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border-radius: 4px;
  margin-bottom: 10px;
  line-height: 1.4;
}

.changelog-badge--new {
  background-color: rgba(34, 197, 94, 0.12);
  color: #16a34a;
}

.changelog-badge--improvement {
  background-color: rgba(33, 95, 255, 0.1);
  color: #215fff;
}

.changelog-badge--fix {
  background-color: rgba(245, 158, 11, 0.12);
  color: #b45309;
}

.changelog-badge--update {
  background-color: rgba(107, 114, 128, 0.12);
  color: #4b5563;
}

.changelog-badge--model {
  background-color: rgba(139, 92, 246, 0.12);
  color: #7c3aed;
}

/* --- Entry title --- */
.changelog-entry-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.3;
  margin: 0;
  color: #111827;
}

.changelog-entry-title a {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s ease;
}

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

/* --- Image lightbox --- */
.changelog-lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.85);
  cursor: zoom-out;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.changelog-lightbox.active {
  display: flex;
}

.changelog-lightbox img {
  max-width: 95%;
  max-height: 95vh;
  border-radius: 8px;
  object-fit: contain;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.changelog-lightbox-close {
  position: absolute;
  top: 16px;
  right: 24px;
  color: #ffffff;
  font-size: 32px;
  font-weight: 300;
  cursor: pointer;
  line-height: 1;
  opacity: 0.7;
  transition: opacity 0.15s ease;
  background: none;
  border: none;
  padding: 0;
}

.changelog-lightbox-close:hover {
  opacity: 1;
}

.changelog-media-container img {
  cursor: zoom-in;
}

/* --- Cover media --- */
.changelog-figure {
  margin: 24px 0;
}

.changelog-media-container {
  border-radius: var(--radius-box);
  overflow: hidden;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
}

.changelog-media-container img {
  display: block;
  width: 100%;
  height: auto;
}

.changelog-media-container video {
  display: block;
  width: 100%;
  height: auto;
}

.changelog-figure figcaption {
  font-size: 0.8125rem;
  color: #6b7280;
  margin-top: 8px;
  text-align: center;
}

/* --- Prose: body content styling --- */
.changelog-prose {
  font-size: 0.9375rem;
  line-height: 1.7;
  color: #374151;
}

.changelog-prose p {
  margin: 0 0 16px;
}

.changelog-prose p:last-child {
  margin-bottom: 0;
}

.changelog-prose h3 {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 600;
  color: #111827;
  margin: 28px 0 12px;
  line-height: 1.4;
}

.changelog-prose h3:first-child {
  margin-top: 0;
}

.changelog-prose a {
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.15s ease;
  border-bottom: 1px solid transparent;
}

.changelog-prose a:hover {
  color: var(--color-primary-hover);
  border-bottom-color: var(--color-primary-hover);
}

.changelog-prose strong {
  font-weight: 600;
  color: #111827;
}

.changelog-prose em {
  font-style: italic;
}

.changelog-prose code {
  font-size: 0.85em;
  background: #f3f4f6;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'SF Mono', 'Fira Code', 'Fira Mono', 'Roboto Mono', monospace;
  color: #1f2937;
}

.changelog-prose ul,
.changelog-prose ol {
  margin: 12px 0 16px;
  padding-left: 24px;
}

.changelog-prose ul {
  list-style-type: disc;
}

.changelog-prose ol {
  list-style-type: decimal;
}

.changelog-prose li {
  margin-bottom: 6px;
  padding-left: 4px;
}

.changelog-prose li::marker {
  color: #9ca3af;
}

.changelog-prose blockquote {
  margin: 16px 0;
  padding: 12px 20px;
  border-left: 3px solid var(--color-primary);
  background: #f9fafb;
  border-radius: 0 var(--radius-field) var(--radius-field) 0;
  color: #4b5563;
}

.changelog-prose blockquote p {
  margin: 0;
}

/* Inline images/videos within body content */
.changelog-prose .changelog-figure {
  margin: 20px 0;
}

/* --- Collapsible sections (Linear-style accordions) --- */
.changelog-collapsible-sections {
  margin-top: 32px;
}

.changelog-collapsible {
  border-top: 1px solid #e5e7eb;
}

.changelog-collapsible:last-child {
  border-bottom: 1px solid #e5e7eb;
}

.changelog-collapsible-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.changelog-collapsible-summary::-webkit-details-marker {
  display: none;
}

.changelog-collapsible-summary::marker {
  display: none;
  content: '';
}

.changelog-collapsible-title {
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 500;
  color: #111827;
}

.changelog-collapsible-chevron {
  color: #9ca3af;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

/* Right-pointing by default, rotates down when open */
.changelog-collapsible[open] .changelog-collapsible-chevron {
  transform: rotate(90deg);
}

.changelog-collapsible-summary:hover .changelog-collapsible-title {
  color: #374151;
}

.changelog-collapsible-summary:hover .changelog-collapsible-chevron {
  color: #6b7280;
}

.changelog-collapsible-list {
  padding: 0 0 20px 24px;
  margin: 0;
  list-style-type: disc;
  font-size: 0.9375rem;
  line-height: 1.7;
  color: #374151;
}

.changelog-collapsible-list li {
  margin-bottom: 4px;
  padding-left: 4px;
}

.changelog-collapsible-list li::marker {
  color: #9ca3af;
}

/* --- Pagination (Cursor-style) --- */
.changelog-pagination {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 48px 0 0;
}

.changelog-pagination-link {
  display: flex;
  flex-direction: column;
  padding: 16px 20px;
  border: 1px solid #e5e7eb;
  border-radius: var(--radius-box);
  text-decoration: none;
  transition: all 0.15s ease;
  min-width: 140px;
  background: #ffffff;
}

.changelog-pagination-link:hover {
  border-color: var(--color-primary);
  background: rgba(33, 95, 255, 0.02);
}

.changelog-pagination-direction {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #111827;
  margin-bottom: 2px;
}

.changelog-pagination-label {
  font-size: 0.75rem;
  color: #6b7280;
}

.changelog-pagination-link--next {
  text-align: right;
}

/* --- Empty state --- */
.changelog-empty {
  text-align: center;
  padding: 80px 24px;
  color: #6b7280;
}

.changelog-empty p {
  font-size: 1rem;
  margin: 0;
}

/* ===================================================================
   RESPONSIVE: Mobile (< 768px)
   =================================================================== */
@media (max-width: 768px) {
  .changelog-header {
    padding: 32px 0 24px;
  }

  .changelog-entry-grid {
    grid-template-columns: 1fr;
    gap: 0;
    padding: 24px 0;
  }

  .changelog-entry-date {
    position: static;
    text-align: left;
    margin-bottom: 12px;
  }

  .changelog-date-text {
    position: static;
  }

  /* Hide timeline on mobile */
  .changelog-timeline .changelog-entry-date::before,
  .changelog-timeline .changelog-entry:first-child .changelog-entry-date::before,
  .changelog-timeline .changelog-entry:last-child .changelog-entry-date::before,
  .changelog-timeline .changelog-entry-date::after {
    display: none;
  }

  .changelog-timeline .changelog-entry + .changelog-entry {
    border-top: 1px solid #f3f4f6;
  }

  .changelog-breadcrumb-current {
    max-width: 200px;
  }

  .changelog-entry-title {
    font-size: 1.25rem;
  }

  .changelog-figure {
    margin: 16px 0;
  }

  .changelog-pagination {
    flex-direction: column;
    gap: 8px;
  }

  .changelog-pagination-link {
    min-width: 0;
  }

  .changelog-pagination-link--next {
    text-align: left;
  }
}
