/**
 * YivMarkDown - Ultra-Minimal Interface
 * Copyright © 2025 Yivani (yivani.de)
 * Contact: info@yivani.de
 *
 * Ultra-minimal styling with pure black background and white text.
 * Features particle system, breathing overlay, and custom cursor.
 */

/* Reset and base styles */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Ultra-minimal base styles */
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
    Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
  background-color: #000000;
  color: #ffffff;
  line-height: 1.6;
  overflow-x: hidden;
  cursor: none;
  min-height: 100vh;
}

/* Breathing radial gradient overlay */
#breathing-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: radial-gradient(circle at center, rgba(255, 255, 255, 0.03) 0%, transparent 70%);
  pointer-events: none;
  z-index: 1;
  animation: breathe 8s ease-in-out infinite;
}

@keyframes breathe {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.6; }
}

/* Particle system container */
#particles {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  overflow: hidden;
  z-index: 2;
}

.particle {
  position: absolute;
  width: 2px;
  height: 2px;
  background: rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  animation: float linear infinite;
}

@keyframes float {
  0% {
    transform: translateY(100vh) translateX(0);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    transform: translateY(-100vh) translateX(100px);
    opacity: 0;
  }
}

/* Ultra-minimal container - scrollable */
.container {
  position: relative;
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  z-index: 10;
  padding: 5vh 1rem 2rem;
}

/* Massive display numbers with fade-in animation */
h1 {
  font-size: clamp(8rem, 20vw, 15rem);
  font-weight: 900;
  color: #ffffff;
  text-align: center;
  margin: 0;
  opacity: 0;
  transform: scale(0.8);
  animation: fadeInScale 1s ease-out 0.2s forwards;
}

h1 .dot {
  color: #ffffff;
}

/* Light weight messages with reduced opacity */
.free-badge {
  font-weight: 300;
  opacity: 0.7;
  color: #ffffff;
  text-align: center;
  margin-top: 2rem;
  font-size: clamp(1rem, 2vw, 1.2rem);
  opacity: 0;
  animation: fadeIn 1s ease-out 0.6s forwards;
}

/* Ultra-minimal buttons - centered */
.buttons {
  display: flex;
  gap: 2rem;
  margin-top: 3rem;
  justify-content: center;
  align-items: center;
}

/* Hide theme toggle for ultra-minimal aesthetic */
.theme-switch {
  display: none;
}

button {
  background: transparent;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 0.8rem 1.5rem;
  font-size: clamp(0.9rem, 1.5vw, 1rem);
  font-weight: 300;
  cursor: pointer;
  transition: all 0.3s ease-out;
  opacity: 0;
}

/* Staggered button animations */
button:nth-child(1) { animation: fadeInButton 1s ease-out 1s forwards; }
button:nth-child(2) { animation: fadeInButton 1s ease-out 1.2s forwards; }
button:nth-child(3) { animation: fadeInButton 1s ease-out 1.4s forwards; }
button:nth-child(4) { animation: fadeInButton 1s ease-out 1.6s forwards; }
button:nth-child(5) { animation: fadeInButton 1s ease-out 1.8s forwards; }

button:hover {
  opacity: 1;
  border-color: rgba(255, 255, 255, 0.8);
  transform: translateY(-2px);
}

button.active {
  opacity: 1;
  border-color: #ffffff;
}

/* Main editor area - permanent side by side layout */
main {
  position: relative;
  width: 100%;
  max-width: 1400px;
  margin: 3rem auto 0;
  background: transparent;
  z-index: 5;
  opacity: 1;
  transition: opacity 0.5s ease-out;
  pointer-events: auto;
  display: flex;
  gap: 1rem;
  min-height: 60vh;
  height: auto;
}

.editor-section,
.preview-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 60vh;
}

.section-label {
  color: rgba(255, 255, 255, 0.7);
  font-size: clamp(0.9rem, 1.5vw, 1rem);
  font-weight: 300;
  margin-bottom: 0.5rem;
  text-align: center;
  opacity: 0;
  animation: fadeIn 1s ease-out 1.8s forwards;
}

#editor,
#preview {
  flex: 1;
  min-height: 50vh;
  background: rgba(0, 0, 0, 0.9);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 1.5rem;
  font-size: clamp(1rem, 1.5vw, 1.1rem);
  overflow-y: auto;
  backdrop-filter: blur(10px);
  border-radius: 8px;
  resize: none;
  line-height: 1.6;
  word-wrap: break-word;
  white-space: pre-wrap;
}

#editor {
  resize: none;
  outline: none;
  font-family: "Monaco", "Menlo", "Ubuntu Mono", "Consolas", monospace;
  tab-size: 4;
  background: rgba(0, 0, 0, 0.9);
  transition: border-color 0.3s ease;
}

#editor:focus {
  border-color: rgba(255, 255, 255, 0.4);
}

#editor::selection {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

#preview {
  background: rgba(0, 0, 0, 0.9);
  white-space: normal;
  word-wrap: break-word;
  overflow-wrap: break-word;
  user-select: text;
}

#preview::selection {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

.hidden {
  display: none;
}

/* Fade in animations */
@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 0.7;
  }
}

@keyframes fadeInButton {
  from {
    opacity: 0;
  }
  to {
    opacity: 0.7;
  }
}

/* Ultra-minimal preview styles */
#preview h1,
#preview h2,
#preview h3,
#preview h4,
#preview h5,
#preview h6 {
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
  color: #ffffff;
  font-weight: 300;
  line-height: 1.25;
}

#preview h1 {
  font-size: 2em;
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
  padding-bottom: 0.3em;
}

#preview h2 {
  font-size: 1.5em;
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
  padding-bottom: 0.3em;
}

#preview h3 {
  font-size: 1.25em;
}

#preview h4 {
  font-size: 1em;
}

#preview h5 {
  font-size: 0.875em;
}

#preview h6 {
  font-size: 0.85em;
  color: rgba(255, 255, 255, 0.7);
}

#preview p {
  margin-bottom: 1rem;
  color: #ffffff;
  line-height: 1.7;
  max-width: none;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

#preview pre {
  background-color: rgba(255, 255, 255, 0.1);
  padding: 1rem;
  border-radius: 4px;
  overflow-x: auto;
  margin-bottom: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  white-space: pre;
  word-wrap: normal;
  overflow-wrap: normal;
  max-width: 100%;
}

#preview code {
  font-family: "Monaco", "Menlo", "Ubuntu Mono", "Consolas", monospace;
  background-color: rgba(255, 255, 255, 0.1);
  padding: 0.2em 0.4em;
  border-radius: 3px;
  font-size: 85%;
  color: #ffffff;
}

#preview pre code {
  padding: 0;
  background-color: transparent;
  font-size: 90%;
  line-height: 1.45;
  word-break: normal;
  white-space: pre;
}

#preview blockquote {
  border-left: 4px solid rgba(255, 255, 255, 0.5);
  padding: 0 1em;
  margin: 0 0 1rem;
  color: rgba(255, 255, 255, 0.8);
}

#preview blockquote > :first-child {
  margin-top: 0;
}

#preview blockquote > :last-child {
  margin-bottom: 0;
}

#preview ul,
#preview ol {
  margin-bottom: 1rem;
  padding-left: 2rem;
}

#preview li {
  margin-bottom: 0.25rem;
  color: #ffffff;
}

#preview li > ul,
#preview li > ol {
  margin-top: 0.25rem;
  margin-bottom: 0;
}

#preview dl {
  margin-bottom: 1rem;
}

#preview dt {
  font-weight: bold;
  margin-top: 0.5rem;
  color: #ffffff;
}

#preview dd {
  margin-left: 2rem;
  color: #ffffff;
}

#preview img {
  max-width: 100%;
  box-sizing: content-box;
  background-color: transparent;
}

#preview table {
  border-collapse: collapse;
  margin-bottom: 1rem;
  width: 100%;
  overflow-x: auto;
  display: block;
  white-space: nowrap;
}

#preview table.table {
  display: table;
  width: 100%;
  white-space: normal;
}

#preview th,
#preview td {
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 0.5rem 1rem;
  color: #ffffff;
}

#preview th {
  background-color: rgba(255, 255, 255, 0.1);
  font-weight: 600;
}

#preview tr:nth-child(2n) {
  background-color: rgba(255, 255, 255, 0.05);
}

#preview hr {
  height: 0.25em;
  padding: 0;
  margin: 1.5rem 0;
  background-color: rgba(255, 255, 255, 0.3);
  border: 0;
}

#preview del {
  text-decoration: line-through;
  color: rgba(255, 255, 255, 0.6);
}

#preview .footnote {
  font-size: 0.8em;
  color: rgba(255, 255, 255, 0.7);
}

#preview input[type="checkbox"] {
  margin-right: 0.5em;
}

/* Ultra-minimal help panel */
#helpPanel {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.98);
  z-index: 20;
  padding: 0;
  overflow-y: auto;
  backdrop-filter: blur(20px);
  scroll-behavior: smooth;
}

/* Scroll indicator */
#helpPanel::-webkit-scrollbar {
  width: 8px;
}

#helpPanel::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
}

#helpPanel::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

#helpPanel::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

.help-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  padding: 1.5rem 2rem;
  margin-bottom: 0;
  position: sticky;
  top: 0;
  background: rgba(0, 0, 0, 0.98);
  z-index: 10;
  backdrop-filter: blur(20px);
  border-radius: 0 0 16px 16px;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

.help-header h2 {
  color: #ffffff;
  margin: 0;
  font-weight: 400;
  font-size: clamp(1.8rem, 4vw, 2.2rem);
  letter-spacing: -0.02em;
}

#closeHelp {
  background: transparent;
  color: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  width: 48px;
  height: 48px;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  font-weight: 300;
}

#closeHelp:hover {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.05);
  transform: scale(1.1);
}

#closeHelp:active {
  transform: scale(0.95);
}

.help-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem 3rem;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
  gap: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  margin-top: 0;
}

.help-section {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: all 0.3s ease;
}

.help-section:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
}

.help-section h3 {
  margin-top: 0;
  color: #ffffff;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  margin-bottom: 1.5rem;
  font-weight: 300;
  font-size: clamp(1.2rem, 2.5vw, 1.5rem);
}

.example-container {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  margin-top: 1rem;
}

.markdown-example,
.preview-example {
  flex: 1;
  min-width: 300px;
  padding: 1.5rem;
  border-radius: 8px;
}

.markdown-example {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.markdown-example pre {
  margin: 0;
  white-space: pre-wrap;
  font-family: "Monaco", "Menlo", "Ubuntu Mono", "Consolas", monospace;
  font-size: 0.9rem;
  line-height: 1.4;
  overflow-x: auto;
  color: #ffffff;
  background: transparent;
}

.preview-example {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.preview-example h1.ex,
.preview-example h2.ex,
.preview-example h3.ex,
.preview-example h4.ex,
.preview-example h5.ex,
.preview-example h6.ex {
  margin-top: 0.25rem;
  margin-bottom: 0.25rem;
  color: #ffffff;
  font-weight: 300;
}

.preview-example h1.ex {
  font-size: 1.8em;
}

.preview-example h2.ex {
  font-size: 1.5em;
}

.preview-example h3.ex {
  font-size: 1.3em;
}

.preview-example h4.ex {
  font-size: 1.1em;
}

.preview-example h5.ex {
  font-size: 0.9em;
}

.preview-example h6.ex {
  font-size: 0.8em;
  color: rgba(255, 255, 255, 0.7);
}

.preview-example blockquote {
  border-left: 4px solid rgba(255, 255, 255, 0.5);
  padding: 0.5rem 1rem;
  margin: 0.5rem 0;
  color: rgba(255, 255, 255, 0.8);
}

.preview-example pre {
  background: rgba(255, 255, 255, 0.1);
  padding: 0.75rem;
  border-radius: 3px;
  overflow-x: auto;
  color: #ffffff;
}

.preview-example code {
  font-family: "Monaco", "Menlo", "Ubuntu Mono", "Consolas", monospace;
  font-size: 0.9rem;
  color: #ffffff;
}

.preview-example table {
  border-collapse: collapse;
  width: 100%;
  margin-bottom: 0.5rem;
}

.preview-example th,
.preview-example td {
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 0.5rem;
  color: #ffffff;
}

.preview-example th {
  background: rgba(255, 255, 255, 0.1);
}

.preview-example .task-list {
  list-style-type: none;
  padding-left: 0.5rem;
}

.preview-example .task-list-item {
  margin-bottom: 0.25rem;
  display: flex;
  align-items: center;
  color: #ffffff;
}

.preview-example input[type="checkbox"] {
  margin-right: 0.5rem;
}

.preview-example .math-example {
  font-style: italic;
  color: #ffffff;
}

.preview-example .math-block-example {
  display: flex;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  padding: 1rem;
  margin: 0.5rem 0;
  color: #ffffff;
}

.preview-example .footnote-hr {
  margin: 1rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.3);
}

.preview-example .footnote-ref {
  font-size: 0.8em;
  vertical-align: super;
  color: #ffffff;
}

.preview-example .footnote-item {
  font-size: 0.9em;
  color: rgba(255, 255, 255, 0.7);
}

.preview-example .example-img {
  max-width: 100%;
  height: auto;
  max-height: 100px;
}

.list-example {
  padding: 0.5rem;
}

.clean-list {
  margin: 0.5rem 0;
  padding-left: 1.5rem;
}

.clean-list li {
  margin-bottom: 0.25rem;
  color: #ffffff;
}

.clean-list li:last-child {
  margin-bottom: 0;
}

.clean-list ul,
.clean-list ol {
  margin: 0.25rem 0 0.5rem 0;
  padding-left: 1.5rem;
}

.preview-example p strong {
  font-weight: 600;
  color: #ffffff;
}

.preview-example p {
  margin: 0.5rem 0;
  color: #ffffff;
}

.preview-example ul,
.preview-example ol {
  margin-bottom: 1rem;
}

@media (max-width: 768px) {
  .example-container {
    flex-direction: column;
  }

  .markdown-example,
  .preview-example {
    min-width: 100%;
  }
}

/* Ultra-minimal footer */
footer {
  position: relative;
  text-align: center;
  font-size: clamp(0.8rem, 1.5vw, 1rem);
  color: rgba(255, 255, 255, 0.7);
  z-index: 15;
  opacity: 0;
  animation: fadeIn 1s ease-out 1.4s forwards;
  margin-top: 3rem;
  padding: 2rem 0;
}

footer p {
  margin: 0;
  font-weight: 300;
}

.yivani-link {
  color: #ffffff;
  text-decoration: none;
  font-weight: 300;
  transition: opacity 0.3s ease;
  opacity: 0.7;
}

.yivani-link:hover {
  opacity: 1;
  text-decoration: underline;
}

.contact-info {
  margin-left: 10px;
  font-size: 0.9em;
}

.contact-info a {
  color: #ffffff;
  text-decoration: none;
  opacity: 0.7;
  transition: opacity 0.3s ease;
}

.contact-info a:hover {
  opacity: 1;
  text-decoration: underline;
}

/* Ultra-minimal dropdown */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-content {
  display: none;
  position: absolute;
  right: 0;
  background: rgba(0, 0, 0, 0.9);
  min-width: 200px;
  backdrop-filter: blur(20px);
  z-index: 10;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 0.5rem 0;
}

.dropdown-content a {
  color: #ffffff;
  padding: 12px 16px;
  text-decoration: none;
  display: block;
  transition: all 0.3s ease;
  font-weight: 300;
  opacity: 0.7;
}

.dropdown-content a:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  opacity: 1;
}

.dropdown.active .dropdown-content {
  display: block;
}

@media (hover: hover) {
  .dropdown:hover .dropdown-content {
    display: block;
  }
}

/* Mobile responsiveness */
@media screen and (max-width: 768px) {
  .container {
    padding: 2rem 1rem;
  }

  .buttons {
    flex-direction: column;
    gap: 1rem;
    margin-top: 2rem;
  }

  button {
    padding: 1rem 2rem;
    font-size: 1rem;
    min-height: 50px;
  }

  /* Stack editor and preview vertically on mobile */
  main {
    flex-direction: column;
    gap: 1rem;
  }

  .editor-section,
  .preview-section {
    min-height: 50vh;
  }

  #editor,
  #preview {
    min-height: 50vh;
    padding: 1.5rem;
  }

  .help-content {
    padding: 1rem 0.5rem 1rem;
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .help-section {
    padding: 1rem;
    margin-bottom: 0;
  }

  .help-header {
    padding: 1rem 1rem;
    margin-bottom: 0;
  }

  .help-header h2 {
    font-size: 1.4rem;
  }

  #closeHelp {
    width: 44px;
    height: 44px;
    font-size: 22px;
  }

  .example-container {
    flex-direction: column;
  }

  .markdown-example,
  .preview-example {
    min-width: 100%;
  }
}

@media screen and (max-width: 480px) {
  h1 {
    font-size: clamp(4rem, 15vw, 8rem);
  }

  .buttons {
    gap: 0.5rem;
  }

  button {
    padding: 0.8rem 1.5rem;
    font-size: 0.9rem;
  }

  .editor-section,
  .preview-section {
    min-height: 40vh;
  }

  #editor,
  #preview {
    min-height: 40vh;
    padding: 1rem;
  }
}

/* Print styles */
@media print {
  body {
    background: white;
    color: black;
  }

  #preview {
    display: block !important;
    overflow: visible;
    height: auto;
    border: none;
    background: white;
    color: black;
  }

  #editor,
  #helpPanel,
  .container,
  footer {
    display: none !important;
  }
}









