/* === MD↓ EDITOR — TRON/ARES AESTHETIC === */
:root {
     --bg: #050508;
     --bg2: #0a0a0f;
     --red: #cc0000;
     --red-hot: #ff1a1a;
     --red-glow: #ff000066;
     --red-dim: #660000;
     --grid: #1a000020;
     --text: #e8e8e8;
     --text-dim: #888;
     --font-main: 'Orbitron', monospace;
     --font-mono: 'Share Tech Mono', monospace;
     --nav-h: 64px;
}

*,
*::before,
*::after {
     box-sizing: border-box;
     margin: 0;
     padding: 0;
}

html {
     scroll-behavior: smooth;
}

body {
     background-color: var(--bg);
     color: var(--text);
     font-family: var(--font-mono);
     min-height: 100vh;
     display: flex;
     flex-direction: column;
     overflow-x: hidden;
     position: relative;
}

/* ---- SCANLINES ---- */
.scanlines {
     pointer-events: none;
     position: fixed;
     inset: 0;
     z-index: 9999;
     background: repeating-linear-gradient(to bottom,
               transparent 0px,
               transparent 3px,
               rgba(0, 0, 0, 0.18) 3px,
               rgba(0, 0, 0, 0.18) 4px);
     animation: scanmove 10s linear infinite;
}

@keyframes scanmove {
     0% {
          background-position: 0 0;
     }

     100% {
          background-position: 0 200px;
     }
}

/* ---- GRID BG ---- */
.grid-bg {
     pointer-events: none;
     position: fixed;
     inset: 0;
     z-index: 0;
     background-image:
          linear-gradient(rgba(204, 0, 0, 0.06) 1px, transparent 1px),
          linear-gradient(90deg, rgba(204, 0, 0, 0.06) 1px, transparent 1px);
     background-size: 40px 40px;
     animation: gridpulse 4s ease-in-out infinite alternate;
}

@keyframes gridpulse {
     0% {
          opacity: 0.7;
     }

     100% {
          opacity: 1;
     }
}

/* ---- NAVBAR ---- */
.navbar {
     position: fixed;
     top: 0;
     left: 0;
     right: 0;
     height: var(--nav-h);
     z-index: 100;
     background: rgba(5, 5, 8, 0.92);
     border-bottom: 1px solid var(--red-dim);
     backdrop-filter: blur(8px);
     box-shadow: 0 0 30px var(--red-glow), 0 2px 0 var(--red);
}

.nav-inner {
     max-width: 1200px;
     margin: 0 auto;
     height: 100%;
     display: flex;
     align-items: center;
     padding: 0 24px;
     position: relative;
}

.nav-logo {
     display: flex;
     align-items: center;
     gap: 12px;
     text-decoration: none;
     transition: filter 0.2s;
}

.nav-logo:hover {
     filter: drop-shadow(0 0 8px var(--red-hot));
}

.nav-logo img {
     width: 36px;
     height: 36px;
     object-fit: contain;
     filter: drop-shadow(0 0 6px var(--red));
}

.nav-title {
     font-family: var(--font-main);
     font-weight: 900;
     font-size: 1.25rem;
     letter-spacing: 0.12em;
     color: #fff;
     text-shadow: 0 0 10px var(--red-hot), 0 0 30px var(--red);
     text-transform: uppercase;
}

.nav-title .down-arrow {
     color: var(--red-hot);
     text-shadow: 0 0 12px var(--red-hot);
}

.nav-glow-line {
     position: absolute;
     bottom: -1px;
     left: 0;
     right: 0;
     height: 1px;
     background: linear-gradient(90deg, transparent, var(--red-hot), transparent);
     animation: linepulse 3s ease-in-out infinite;
}

@keyframes linepulse {

     0%,
     100% {
          opacity: 0.4;
     }

     50% {
          opacity: 1;
     }
}

/* ---- MAIN ---- */
.main-content {
     position: relative;
     z-index: 1;
     flex: 1;
     display: flex;
     flex-direction: column;
     align-items: center;
     padding: calc(var(--nav-h) + 40px) 24px 40px;
     gap: 28px;
}

/* ---- EDITOR WRAPPER ---- */
.editor-wrapper {
     width: 100%;
     max-width: 960px;
     display: flex;
     flex-direction: column;
     border: 1px solid var(--red-dim);
     border-radius: 4px;
     background: rgba(8, 0, 0, 0.6);
     box-shadow:
          0 0 0 1px rgba(204, 0, 0, 0.15),
          0 0 40px rgba(204, 0, 0, 0.12),
          inset 0 0 60px rgba(204, 0, 0, 0.04);
     transition: box-shadow 0.3s;
}

.editor-wrapper:focus-within {
     border-color: var(--red);
     box-shadow:
          0 0 0 1px var(--red),
          0 0 60px var(--red-glow),
          inset 0 0 60px rgba(204, 0, 0, 0.08);
}

.editor-header {
     display: flex;
     justify-content: space-between;
     align-items: center;
     padding: 10px 18px;
     border-bottom: 1px solid var(--red-dim);
     background: rgba(204, 0, 0, 0.05);
}

.editor-label {
     font-family: var(--font-mono);
     font-size: 0.72rem;
     letter-spacing: 0.2em;
     color: var(--red);
     text-transform: uppercase;
}

.editor-status {
     display: flex;
     align-items: center;
     gap: 8px;
     font-family: var(--font-mono);
     font-size: 0.7rem;
     letter-spacing: 0.2em;
     color: var(--red-hot);
}

.pulse-dot {
     width: 7px;
     height: 7px;
     border-radius: 50%;
     background: var(--red-hot);
     box-shadow: 0 0 8px var(--red-hot);
     animation: blink 1.4s ease-in-out infinite;
}

@keyframes blink {

     0%,
     100% {
          opacity: 1;
     }

     50% {
          opacity: 0.2;
     }
}

.md-textarea {
     width: 100%;
     min-height: 60vh;
     background: transparent;
     border: none;
     outline: none;
     resize: vertical;
     padding: 28px 24px;
     font-family: var(--font-mono);
     font-size: 1rem;
     line-height: 1.75;
     color: #e0e0e0;
     caret-color: var(--red-hot);
     letter-spacing: 0.02em;
}

.md-textarea::placeholder {
     color: #3a2020;
     font-style: normal;
}

.md-textarea::selection {
     background: rgba(204, 0, 0, 0.35);
     color: #fff;
}

/* Custom scrollbar */
.md-textarea::-webkit-scrollbar {
     width: 6px;
}

.md-textarea::-webkit-scrollbar-track {
     background: transparent;
}

.md-textarea::-webkit-scrollbar-thumb {
     background: var(--red-dim);
     border-radius: 3px;
}

.md-textarea::-webkit-scrollbar-thumb:hover {
     background: var(--red);
}

.editor-footer-bar {
     padding: 8px 18px;
     border-top: 1px solid var(--red-dim);
     text-align: right;
     font-size: 0.68rem;
     letter-spacing: 0.15em;
     color: var(--red-dim);
     font-family: var(--font-mono);
     background: rgba(204, 0, 0, 0.03);
}

/* ---- BUTTONS ---- */
.btn-group {
     display: flex;
     flex-wrap: wrap;
     gap: 16px;
     justify-content: center;
     width: 100%;
     max-width: 960px;
}

.btn {
     display: flex;
     align-items: center;
     justify-content: center;
     gap: 10px;
     flex: 1;
     min-width: 180px;
     max-width: 300px;
     padding: 16px 28px;
     border: 1px solid var(--red-dim);
     background: rgba(204, 0, 0, 0.07);
     color: #fff;
     font-family: var(--font-main);
     font-size: 0.82rem;
     font-weight: 600;
     letter-spacing: 0.18em;
     text-transform: uppercase;
     cursor: pointer;
     border-radius: 3px;
     position: relative;
     overflow: hidden;
     transition: all 0.2s ease;
}

.btn-icon {
     font-size: 1.1rem;
     line-height: 1;
     color: var(--red-hot);
     text-shadow: 0 0 8px var(--red-hot);
}

.btn::before {
     content: '';
     position: absolute;
     inset: 0;
     background: linear-gradient(135deg, var(--red) 0%, transparent 60%);
     opacity: 0;
     transition: opacity 0.25s;
}

.btn:hover {
     border-color: var(--red-hot);
     color: #fff;
     box-shadow: 0 0 24px var(--red-glow), inset 0 0 20px rgba(204, 0, 0, 0.1);
     text-shadow: 0 0 8px #fff;
     transform: translateY(-2px);
}

.btn:hover::before {
     opacity: 0.12;
}

.btn:active {
     transform: translateY(0px);
     box-shadow: 0 0 10px var(--red-glow);
}

/* Corner accents */
.btn::after {
     content: '';
     position: absolute;
     top: 0;
     left: 0;
     width: 8px;
     height: 8px;
     border-top: 1px solid var(--red-hot);
     border-left: 1px solid var(--red-hot);
     opacity: 0;
     transition: opacity 0.2s;
}

.btn:hover::after {
     opacity: 1;
}

.btn-export-pdf {
     border-color: #4d0000;
}

.btn-export-pdf .btn-icon {
     color: #ff4444;
}

.btn-export-html {
     border-color: #3a0000;
}

.btn-export-html .btn-icon {
     color: #ff6666;
     font-style: normal;
     font-size: 0.95rem;
}

/* ---- FOOTER ---- */
.footer {
     position: relative;
     z-index: 1;
     padding: 0 24px 24px;
}

.footer-line {
     height: 1px;
     background: linear-gradient(90deg, transparent, var(--red-dim), transparent);
     margin-bottom: 16px;
}

.footer-inner {
     display: flex;
     justify-content: center;
     align-items: center;
     gap: 12px;
     font-size: 0.72rem;
     letter-spacing: 0.15em;
     color: #444;
     font-family: var(--font-mono);
}

.footer-sep {
     color: var(--red-dim);
}

.footer-link {
     color: var(--red-dim);
     text-decoration: none;
     transition: color 0.2s, text-shadow 0.2s;
}

.footer-link:hover {
     color: var(--red-hot);
     text-shadow: 0 0 8px var(--red-hot);
}

/* ---- RESPONSIVE ---- */
@media (max-width: 600px) {
     .nav-title {
          font-size: 1rem;
     }

     .btn {
          min-width: 140px;
          font-size: 0.7rem;
          padding: 14px 16px;
     }

     .md-textarea {
          min-height: 50vh;
          font-size: 0.9rem;
     }
}