/* ============================================
   ELITE 90s HACKER THEME - PROFESSIONAL EDITION
   Clean, Readable, Fucking Cool
   ============================================ */

/* CORE CSS VARIABLES */
body {
  /* Base colors - Deep terminal black */
  --background-primary: #0d1117;
  --background-secondary: #161b22;
  --background-secondary-alt: #21262d;
  --background-modifier-border: #30363d;
  --background-modifier-border-hover: #58a6ff;
  --background-modifier-border-focus: #79c0ff;
  
  /* Text colors - Perfect contrast */
  --text-normal: #e6edf3;
  --text-muted: #9198a1;
  --text-faint: #7d8590;
  --text-on-accent: #0d1117;
  
  /* Accent colors */
  --text-accent: #58a6ff;
  --text-accent-hover: #79c0ff;
  --interactive-accent: #58a6ff;
  --interactive-accent-hover: #79c0ff;
  
  /* Links */
  --link-color: #58a6ff;
  --link-color-hover: #79c0ff;
  --link-unresolved-color: #f85149;
  
  /* Code */
  --code-background: #161b22;
  --code-normal: #7ee787;
  
  /* Selection */
  --text-selection: rgba(88, 166, 255, 0.3);
  
  /* Syntax colors */
  --color-cyan: #79c0ff;
  --color-green: #7ee787;
  --color-orange: #ffa657;
  --color-pink: #ff7b72;
  --color-purple: #d2a8ff;
  --color-yellow: #f0883e;
  --color-red: #f85149;
}

/* TYPOGRAPHY - Perfect readability */
.markdown-preview-view {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-normal);
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem;
}

/* HEADINGS - Sick terminal style */
.markdown-preview-view h1,
.markdown-preview-view h2,
.markdown-preview-view h3,
.markdown-preview-view h4,
.markdown-preview-view h5,
.markdown-preview-view h6 {
  font-weight: 600;
  line-height: 1.25;
  margin-top: 24px;
  margin-bottom: 16px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.markdown-preview-view h1 {
  font-size: 2em;
  padding-bottom: 0.3em;
  border-bottom: 2px solid var(--color-cyan);
  color: var(--color-cyan);
  margin-top: 0;
  position: relative;
  padding-left: 1.2em;
}

.markdown-preview-view h1:before {
  content: '>';
  position: absolute;
  left: 0;
  color: var(--color-cyan);
  font-weight: bold;
  animation: blink 1.5s infinite;
}

@keyframes blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

.markdown-preview-view h2 {
  font-size: 1.5em;
  padding-bottom: 0.3em;
  border-bottom: 1px solid var(--color-green);
  color: var(--color-green);
  padding-left: 0.8em;
  position: relative;
}

.markdown-preview-view h2:before {
  content: '▸';
  position: absolute;
  left: 0;
  color: var(--color-green);
}

.markdown-preview-view h3 {
  font-size: 1.25em;
  color: var(--color-purple);
  padding-left: 0.8em;
  position: relative;
}

.markdown-preview-view h3:before {
  content: '▹';
  position: absolute;
  left: 0;
  color: var(--color-purple);
}

.markdown-preview-view h4 {
  font-size: 1em;
  color: var(--color-orange);
}

.markdown-preview-view h5,
.markdown-preview-view h6 {
  font-size: 0.875em;
  color: var(--text-muted);
}

/* LINKS - Smooth and clean */
.markdown-preview-view a {
  color: var(--link-color);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.markdown-preview-view a:hover {
  color: var(--link-color-hover);
  border-bottom-color: var(--link-color-hover);
}

/* PARAGRAPHS */
.markdown-preview-view p {
  margin-top: 0;
  margin-bottom: 16px;
}

/* INLINE CODE - Sick highlight */
.markdown-preview-view code {
  background: var(--code-background);
  color: var(--color-green);
  padding: 0.2em 0.4em;
  margin: 0;
  font-size: 85%;
  border-radius: 6px;
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  border: 1px solid var(--background-modifier-border);
}

.markdown-preview-view a code {
  color: inherit;
}

/* CODE BLOCKS - Elite terminal style */
.markdown-preview-view pre {
  background: var(--code-background);
  border: 1px solid var(--background-modifier-border);
  border-radius: 8px;
  padding: 16px;
  overflow: auto;
  font-size: 85%;
  line-height: 1.45;
  margin: 16px 0;
  position: relative;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.markdown-preview-view pre:before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 32px;
  background: linear-gradient(to bottom, rgba(88, 166, 255, 0.1), transparent);
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
}

.markdown-preview-view pre code {
  background: transparent;
  border: none;
  padding: 0;
  margin: 0;
  font-size: 100%;
  color: var(--text-normal);
  display: block;
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
}

/* LISTS - Clean bullets */
.markdown-preview-view ul,
.markdown-preview-view ol {
  padding-left: 2em;
  margin-top: 0;
  margin-bottom: 16px;
}

.markdown-preview-view li {
  margin-top: 0.25em;
}

.markdown-preview-view ul {
  list-style: none;
}

.markdown-preview-view ul li {
  position: relative;
}

.markdown-preview-view ul li:before {
  content: '•';
  color: var(--color-cyan);
  position: absolute;
  left: -1.2em;
  font-size: 1.2em;
  line-height: 1.3;
}

/* BLOCKQUOTES - Professional callout */
.markdown-preview-view blockquote {
  margin: 16px 0;
  padding: 0 1em;
  color: var(--text-muted);
  border-left: 4px solid var(--color-cyan);
  background: rgba(88, 166, 255, 0.05);
  border-radius: 0 6px 6px 0;
}

.markdown-preview-view blockquote > :first-child {
  margin-top: 0;
}

.markdown-preview-view blockquote > :last-child {
  margin-bottom: 0;
}

/* TABLES - Sick grid style */
.markdown-preview-view table {
  border-spacing: 0;
  border-collapse: collapse;
  width: 100%;
  margin: 16px 0;
  overflow: hidden;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.markdown-preview-view table thead {
  background: linear-gradient(to bottom, rgba(88, 166, 255, 0.1), rgba(88, 166, 255, 0.05));
}

.markdown-preview-view table th {
  padding: 12px 16px;
  font-weight: 600;
  text-align: left;
  border-bottom: 2px solid var(--color-cyan);
  color: var(--color-cyan);
  font-size: 0.9em;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.markdown-preview-view table td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--background-modifier-border);
}

.markdown-preview-view table tr:last-child td {
  border-bottom: none;
}

.markdown-preview-view table tbody tr {
  transition: background-color 0.2s ease;
}

.markdown-preview-view table tbody tr:hover {
  background: rgba(88, 166, 255, 0.08);
}

/* HORIZONTAL RULES */
.markdown-preview-view hr {
  height: 0;
  margin: 24px 0;
  overflow: hidden;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--background-modifier-border-hover);
}

/* CHECKBOXES - Modern style */
.markdown-preview-view input[type="checkbox"] {
  appearance: none;
  width: 16px;
  height: 16px;
  border: 2px solid var(--background-modifier-border-hover);
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
  position: relative;
  vertical-align: text-bottom;
  margin-right: 8px;
  transition: all 0.2s ease;
}

.markdown-preview-view input[type="checkbox"]:hover {
  border-color: var(--color-cyan);
  background: rgba(88, 166, 255, 0.05);
}

.markdown-preview-view input[type="checkbox"]:checked {
  background: var(--color-cyan);
  border-color: var(--color-cyan);
}

.markdown-preview-view input[type="checkbox"]:checked:after {
  content: '✓';
  position: absolute;
  top: -2px;
  left: 2px;
  color: var(--background-primary);
  font-size: 12px;
  font-weight: bold;
}

.markdown-preview-view .task-list-item {
  list-style-type: none;
}

.markdown-preview-view .contains-task-list {
  padding-left: 0;
}

/* IMAGES - FIXED ZOOM FUNCTIONALITY */
.markdown-preview-view img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  border: 1px solid var(--background-modifier-border);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  display: block;
  margin: 16px auto;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.markdown-preview-view img:hover {
  border-color: var(--color-cyan);
  box-shadow: 0 8px 24px rgba(88, 166, 255, 0.3);
  transform: translateY(-2px);
}

/* IMAGE LIGHTBOX - Click to zoom */
.markdown-preview-view .image-embed {
  position: relative;
  display: block;
}

.markdown-preview-view .image-embed:active {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  z-index: 99999 !important;
  background: rgba(0, 0, 0, 0.95) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: zoom-out !important;
  border-radius: 0 !important;
  padding: 20px !important;
  box-sizing: border-box !important;
}

.markdown-preview-view .image-embed:active img {
  max-width: 95vw !important;
  max-height: 95vh !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain !important;
  border: 2px solid var(--color-cyan) !important;
  box-shadow: 0 0 40px rgba(88, 166, 255, 0.5) !important;
  cursor: zoom-out !important;
}

/* Alternative: Direct img zoom if above doesn't work */
.markdown-preview-view img:active {
  position: fixed !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  max-width: 95vw !important;
  max-height: 95vh !important;
  width: auto !important;
  height: auto !important;
  z-index: 99999 !important;
  cursor: zoom-out !important;
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.9), 0 0 40px rgba(88, 166, 255, 0.6) !important;
  border: 2px solid var(--color-cyan) !important;
}

/* Backdrop for zoomed images */
body:has(.markdown-preview-view img:active):before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.95);
  z-index: 99998;
  pointer-events: none;
}

/* EMPHASIS */
.markdown-preview-view strong {
  font-weight: 600;
  color: var(--color-orange);
}

.markdown-preview-view em {
  font-style: italic;
  color: var(--color-purple);
}

.markdown-preview-view strong em,
.markdown-preview-view em strong {
  color: var(--color-pink);
}

/* STRIKETHROUGH */
.markdown-preview-view del {
  text-decoration: line-through;
  color: var(--text-faint);
}

/* HIGHLIGHTS */
.markdown-preview-view mark {
  background: rgba(255, 166, 87, 0.25);
  color: var(--color-orange);
  padding: 2px 4px;
  border-radius: 3px;
}

/* FOOTNOTES */
.markdown-preview-view .footnotes {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--background-modifier-border);
  font-size: 0.875em;
  color: var(--text-muted);
}

.markdown-preview-view .footnotes ol {
  padding-left: 1.5em;
}

/* TAGS */
.markdown-preview-view .tag {
  display: inline-block;
  padding: 2px 8px;
  font-size: 0.85em;
  font-weight: 500;
  line-height: 1.5;
  border-radius: 6px;
  background: rgba(88, 166, 255, 0.1);
  border: 1px solid rgba(88, 166, 255, 0.2);
  color: var(--color-cyan);
  text-decoration: none;
  transition: all 0.2s ease;
}

.markdown-preview-view .tag:hover {
  background: rgba(88, 166, 255, 0.15);
  border-color: var(--color-cyan);
  transform: translateY(-1px);
}

/* SCROLLBAR - Minimal and smooth */
::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

::-webkit-scrollbar-track {
  background: var(--background-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--background-modifier-border-hover);
  border-radius: 6px;
  border: 3px solid var(--background-primary);
  transition: background 0.2s ease;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-cyan);
}

/* SELECTION */
::selection {
  background: var(--text-selection);
  color: var(--text-normal);
}

/* RESPONSIVE DESIGN */
@media (max-width: 768px) {
  .markdown-preview-view {
    padding: 1rem;
    font-size: 14px;
  }
  
  .markdown-preview-view h1 {
    font-size: 1.75em;
  }
  
  .markdown-preview-view h2 {
    font-size: 1.4em;
  }
  
  .markdown-preview-view h3 {
    font-size: 1.15em;
  }
  
  .markdown-preview-view table {
    font-size: 0.9em;
  }
  
  .markdown-preview-view table th,
  .markdown-preview-view table td {
    padding: 8px 12px;
  }
}

/* PRINT STYLES */
@media print {
  body {
    background: white;
    color: black;
  }
  
  .markdown-preview-view {
    max-width: 100%;
  }
  
  .markdown-preview-view a {
    color: #0366d6;
    text-decoration: underline;
  }
  
  .markdown-preview-view pre {
    border: 1px solid #ddd;
    page-break-inside: avoid;
  }
  
  .markdown-preview-view img {
    max-width: 100% !important;
  }
}

.published-container {
  --footer-display: none;
}