/* ═══════════════════════════════════════════════
   devLOGS — Dedicated Styles
   Inherits CSS variables from /styles.css
   ═══════════════════════════════════════════════ */

/* Hero / Header */
.devlog-hero {
  text-align: center;
  padding: 4rem 2rem 2rem;
  position: relative;
  overflow: hidden;
}

.devlog-hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(
    ellipse at 50% 0%,
    rgba(99, 102, 241, 0.15) 0%,
    transparent 70%
  );
  pointer-events: none;
}

.devlog-hero h1 {
  font-size: 3.5rem;
  font-weight: 800;
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--secondary-color)
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

.devlog-hero .subtitle {
  color: var(--text-light);
  font-size: 1.1rem;
  max-width: 500px;
  margin: 0 auto;
}

/* Controls Bar (filters + sort) */
.devlog-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
  margin: 1rem 0 0;
  flex-wrap: wrap;
}

/* Filter Bar */
.devlog-filters {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 0.5rem 1.25rem;
  border: 1px solid var(--border-color);
  border-radius: 100px;
  background: transparent;
  color: var(--text-light);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 500;
}

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

.filter-btn.active {
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--secondary-color)
  );
  color: white;
  border-color: transparent;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

/* Sort Button */
.sort-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1.25rem;
  border: 1px solid var(--border-color);
  border-radius: 100px;
  background: transparent;
  color: var(--text-light);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 500;
}

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

.sort-btn .sort-arrow {
  display: inline-block;
  transition: transform 0.3s ease;
  font-size: 0.85em;
}

.sort-btn.asc .sort-arrow {
  transform: rotate(180deg);
}

/* Container */
.devlog-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 2rem 4rem;
}

/* Card List */
.devlog-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Cards */
.devlog-card {
  background: var(--bg-light);
  border-radius: 16px;
  padding: 2rem;
  border: 1px solid var(--border-color);
  box-shadow:
    0 4px 6px -1px rgba(0, 0, 0, 0.07),
    0 2px 4px -1px rgba(0, 0, 0, 0.04);
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease,
    border-color 0.3s ease;
  animation: fadeInUp 0.5s ease forwards;
  opacity: 0;
}

.devlog-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(99, 102, 241, 0.3);
}

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

.devlog-card:nth-child(1) { animation-delay: 0.05s; }
.devlog-card:nth-child(2) { animation-delay: 0.1s; }
.devlog-card:nth-child(3) { animation-delay: 0.15s; }
.devlog-card:nth-child(4) { animation-delay: 0.2s; }
.devlog-card:nth-child(5) { animation-delay: 0.25s; }

/* Card Header */
.devlog-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}

.devlog-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-color);
  line-height: 1.3;
  margin: 0;
}

.devlog-date {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-top: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.devlog-date::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary-color);
}

.devlog-type {
  padding: 0.3rem 0.9rem;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: linear-gradient(
    135deg,
    rgba(99, 102, 241, 0.1),
    rgba(139, 92, 246, 0.1)
  );
  color: var(--primary-color);
  border: 1px solid rgba(99, 102, 241, 0.2);
  white-space: nowrap;
  flex-shrink: 0;
}

/* Description */
.devlog-description {
  color: var(--text-light);
  line-height: 1.7;
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

/* Toggle / Read More Button */
.devlog-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
  padding: 0.6rem 1.5rem;
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--secondary-color)
  );
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.25);
}

.devlog-toggle:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.35);
}

.devlog-toggle:active {
  transform: translateY(0);
}

.devlog-toggle .toggle-arrow {
  transition: transform 0.3s ease;
  font-size: 0.85rem;
}

/* ═══════════════════════════════════════════════
   Full-Screen Overlay
   ═══════════════════════════════════════════════ */

.devlog-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: stretch;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.devlog-overlay.open {
  pointer-events: auto;
  opacity: 1;
  visibility: visible;
}

/* Backdrop */
.overlay-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* Panel */
.overlay-panel {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  max-width: 100vw;
  background: var(--bg-color);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  transform: translateY(30px);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.devlog-overlay.open .overlay-panel {
  transform: translateY(0);
}

/* Close Button */
.overlay-close {
  position: fixed;
  top: 1.75rem;
  left: 1.75rem;
  z-index: 10001;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-light);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  cursor: pointer;
  color: var(--text-color);
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.overlay-close:hover {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: white;
  border-color: transparent;
  transform: scale(1.08);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

/* Overlay Header */
.overlay-header {
  padding: 5rem 3rem 2rem;
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
  border-bottom: 1px solid var(--border-color);
}

.overlay-title {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--text-color);
  line-height: 1.2;
  margin: 0 0 1rem;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.overlay-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.overlay-date {
  font-size: 0.9rem;
  color: var(--text-light);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.overlay-date::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--primary-color);
}

.overlay-type {
  padding: 0.3rem 0.9rem;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.1));
  color: var(--primary-color);
  border: 1px solid rgba(99, 102, 241, 0.2);
}

.overlay-description {
  color: var(--text-light);
  font-size: 1.05rem;
  line-height: 1.6;
  margin: 0;
}

/* Overlay Body (content) */
.overlay-body {
  padding: 2.5rem 3rem 4rem;
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
  line-height: 1.9;
  font-size: 1.05rem;
  color: var(--text-color);
  flex: 1;
}

/* ── Images ── */
.overlay-body img {
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  margin: 1rem 0;
  display: block;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* ── Links / Anchors ── */
.overlay-body a {
  color: var(--primary-color);
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
  font-weight: 500;
  transition: color 0.2s, text-decoration-color 0.2s;
}

.overlay-body a:hover {
  color: var(--secondary-color);
  text-decoration-color: var(--secondary-color);
}

.overlay-body a:visited {
  color: var(--primary-color);
  opacity: 0.85;
}

/* ── Headings inside content ── */
.overlay-body h1,
.overlay-body h2,
.overlay-body h3,
.overlay-body h4,
.overlay-body h5,
.overlay-body h6 {
  color: var(--text-color);
  font-weight: 700;
  line-height: 1.3;
  margin: 1.5rem 0 0.75rem;
}

.overlay-body h1 { font-size: 1.8rem; }
.overlay-body h2 { font-size: 1.5rem; }
.overlay-body h3 { font-size: 1.25rem; }
.overlay-body h4 { font-size: 1.1rem; }
.overlay-body h5 { font-size: 1rem; }
.overlay-body h6 { font-size: 0.9rem; color: var(--text-light); }

/* ── Paragraphs ── */
.overlay-body p {
  margin: 0.75rem 0;
}

/* ── Horizontal Rule ── */
.overlay-body hr {
  border: none;
  height: 1px;
  background: linear-gradient(
    to right,
    transparent,
    var(--border-color),
    var(--primary-color),
    var(--border-color),
    transparent
  );
  margin: 2rem 0;
}

/* ── Lists ── */
.overlay-body ul,
.overlay-body ol {
  padding-left: 1.5rem;
  margin: 0.75rem 0;
}

.overlay-body li {
  margin: 0.35rem 0;
  padding-left: 0.25rem;
}

.overlay-body ul li::marker {
  color: var(--primary-color);
}

.overlay-body ol li::marker {
  color: var(--primary-color);
  font-weight: 600;
}

/* ── Blockquote ── */
.overlay-body blockquote {
  border-left: 3px solid var(--primary-color);
  margin: 1rem 0;
  padding: 0.75rem 1.25rem;
  background: rgba(99, 102, 241, 0.04);
  border-radius: 0 8px 8px 0;
  font-style: italic;
  color: var(--text-light);
}

.overlay-body blockquote p {
  margin: 0;
}

/* ── Inline code ── */
.overlay-body code {
  background: rgba(99, 102, 241, 0.08);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.9em;
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', 'JetBrains Mono', monospace;
  border: 1px solid rgba(99, 102, 241, 0.12);
}

/* ── Code blocks ── */
.overlay-body pre {
  background: var(--bg-light);
  padding: 1.25rem;
  border-radius: 10px;
  overflow-x: auto;
  border: 1px solid var(--border-color);
  margin: 1rem 0;
  line-height: 1.55;
}

.overlay-body pre code {
  background: none;
  padding: 0;
  border: none;
  font-size: 0.88em;
}

/* ── Tables ── */
.overlay-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.95em;
}

.overlay-body th,
.overlay-body td {
  padding: 0.6rem 0.9rem;
  border: 1px solid var(--border-color);
  text-align: left;
}

.overlay-body th {
  background: rgba(99, 102, 241, 0.06);
  font-weight: 600;
  color: var(--text-color);
}

.overlay-body tr:nth-child(even) {
  background: rgba(99, 102, 241, 0.02);
}

/* ── Keyboard shortcut ── */
.overlay-body kbd {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  font-size: 0.85em;
  font-family: 'SF Mono', 'Fira Code', monospace;
  color: var(--text-color);
  background: var(--bg-light);
  border: 1px solid var(--border-color);
  border-bottom-width: 2px;
  border-radius: 4px;
}

/* ── Mark / highlight ── */
.overlay-body mark {
  background: rgba(99, 102, 241, 0.15);
  color: inherit;
  padding: 0.05rem 0.25rem;
  border-radius: 3px;
}

/* ── Subscript & Superscript ── */
.overlay-body sub,
.overlay-body sup {
  font-size: 0.75em;
  line-height: 0;
}

/* ── Strikethrough & underline ── */
.overlay-body s,
.overlay-body del {
  text-decoration: line-through;
  opacity: 0.7;
}

.overlay-body u,
.overlay-body ins {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ── Details / Summary (collapsible) ── */
.overlay-body details {
  margin: 0.75rem 0;
  padding: 0.5rem 1rem;
  background: var(--bg-light);
  border: 1px solid var(--border-color);
  border-radius: 8px;
}

.overlay-body summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--primary-color);
  padding: 0.25rem 0;
}

.overlay-body details[open] summary {
  margin-bottom: 0.5rem;
}

/* ── Break ── */
.overlay-body br {
  display: block;
  content: "";
  margin-top: 0.5rem;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 3rem 0 1rem;
  gap: 1rem;
}

.pagination button {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-light);
  color: var(--text-color);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 1.1rem;
}

.pagination button:hover:not(:disabled) {
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--secondary-color)
  );
  color: white;
  border-color: transparent;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.pagination button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.pagination .page-info {
  color: var(--text-light);
  font-size: 0.9rem;
  font-weight: 500;
}

/* Loading */
.devlog-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6rem 2rem;
  gap: 1.5rem;
}

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 3px solid var(--border-color);
  border-top: 3px solid var(--primary-color);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.loading-text {
  color: var(--text-light);
  font-size: 1rem;
  animation: pulse 1.5s ease-in-out infinite;
}

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

/* Error */
.devlog-error {
  background: rgba(239, 68, 68, 0.08);
  color: #ef4444;
  padding: 1.5rem;
  border-radius: 12px;
  border: 1px solid rgba(239, 68, 68, 0.2);
  margin: 2rem 0;
  text-align: center;
  font-weight: 500;
}

/* Empty */
.devlog-empty {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-light);
}

.devlog-empty svg {
  width: 64px;
  height: 64px;
  margin-bottom: 1rem;
  opacity: 0.5;
}

/* Censor */
.censor-text {
  letter-spacing: 0;
  user-select: none;
}

/* Glitch */
.glitch-container {
  display: inline;
  position: relative;
}

.glitch-char {
  display: inline-block;
  position: relative;
  animation: glitchJitter var(--glitch-speed, 0.3s) infinite;
}

@keyframes glitchJitter {
  0%,
  100% {
    transform: translate(0, 0);
    text-shadow:
      1px 0 rgba(255, 0, 0, 0.4),
      -1px 0 rgba(0, 0, 255, 0.4);
  }
  25% {
    transform: translate(-1px, 1px);
    text-shadow:
      -1px 0 rgba(255, 0, 0, 0.6),
      1px 0 rgba(0, 255, 0, 0.4);
  }
  50% {
    transform: translate(1px, -1px);
    text-shadow:
      2px 0 rgba(0, 0, 255, 0.6),
      -2px 0 rgba(255, 0, 0, 0.4);
  }
  75% {
    transform: translate(-1px, 0);
    text-shadow:
      -1px 0 rgba(0, 255, 0, 0.6),
      1px 0 rgba(0, 0, 255, 0.4);
  }
}

/* Responsive */
@media (max-width: 768px) {
  .devlog-hero h1 {
    font-size: 2.5rem;
  }
  .devlog-container {
    padding: 0 1rem 3rem;
  }
  .devlog-card {
    padding: 1.25rem;
  }
  .devlog-header {
    flex-direction: column;
    gap: 0.5rem;
  }
  .devlog-filters {
    gap: 0.5rem;
  }
  .filter-btn {
    padding: 0.4rem 1rem;
    font-size: 0.8rem;
  }

  /* Overlay responsive */
  .overlay-header {
    padding: nilrem 1.5rem 1.5rem;
  }
  .overlay-title {
    font-size: 1.75rem;
  }
  .overlay-body {
    padding: 1.5rem 1.5rem 3rem;
    font-size: 1rem;
  }
  .overlay-close {
    top: 0.75rem;
    left: 0.75rem;
    width: 40px;
    height: 40px;
  }
}

@media (max-width: 480px) {
  .devlog-hero h1 {
    font-size: 2rem;
  }
  .devlog-hero .subtitle {
    font-size: 0.95rem;
  }
  .overlay-title {
    font-size: 1.4rem;
  }
  .overlay-header {
    padding: nilrem 1rem 1rem;
  }
  .overlay-body {
    padding: 1rem 1rem 2rem;
    font-size: 0.95rem;
  }
}
