:root {
    --bg-color: #0f172a;
    --text-color: #f8fafc;
    --border-color: #334155;
    --btn-bg: rgba(255, 255, 255, 0.1);
    --btn-hover: rgba(255, 255, 255, 0.2);
    --btn-burn: rgba(239, 68, 68, 0.8);
    --font-stack: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

body, html {
    height: 100%;
    width: 100%;
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-stack);
    overflow: hidden;
}

#editor {
    width: 100%;
    height: 100vh;
    padding: 80px 40px 40px 40px;
    background-color: transparent;
    color: var(--text-color);
    border: none;
    resize: none;
    font-family: 'Fira Code', 'Courier New', Courier, monospace;
    font-size: 1.1rem;
    line-height: 1.6;
    outline: none;
}

#preview {
    width: 100%;
    height: 100vh;
    padding: 80px 40px 40px 40px;
    overflow-y: auto;
    font-size: 1.1rem;
    line-height: 1.6;
}

.hidden {
    display: none !important;
}

.action-bar {
    position: fixed;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 10px;
    z-index: 100;
}

.btn {
    background-color: var(--btn-bg);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    backdrop-filter: blur(10px);
    transition: all 0.2s ease;
    font-family: var(--font-stack);
    font-weight: 500;
}

.btn:hover {
    background-color: var(--btn-hover);
    transform: translateY(-1px);
}

.btn.burn:hover {
    background-color: var(--btn-burn);
    border-color: #f87171;
}

.loader {
    position: fixed;
    top: 20px;
    left: 20px;
    background-color: var(--btn-bg);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.loader.visible {
    opacity: 1;
}

/* Markdown specific styles */
.markdown-body h1, .markdown-body h2, .markdown-body h3 {
    margin-top: 1.5em;
    margin-bottom: 0.5em;
}
.markdown-body p { margin-bottom: 1em; }
.markdown-body code { background: rgba(255,255,255,0.1); padding: 2px 4px; border-radius: 4px; font-family: monospace; }
.markdown-body pre { background: rgba(0,0,0,0.3); padding: 16px; border-radius: 8px; overflow-x: auto; margin-bottom: 1em; }
.markdown-body a { color: #38bdf8; text-decoration: none; }
.markdown-body a:hover { text-decoration: underline; }

/* Splash Screen Styles */
#splash-screen {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: #050505;
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    transition: opacity 0.8s ease-out;
}

#splash-bg {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    perspective: 1000px;
    z-index: 1;
    pointer-events: none;
}

.splash-content {
    position: relative;
    z-index: 2;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

/* Glitch Text */
.glitch-text {
    font-size: 5rem;
    font-weight: 800;
    color: #fff;
    position: relative;
    text-transform: uppercase;
    letter-spacing: 5px;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.8), 0 0 20px rgba(0, 255, 255, 0.4);
    animation: glitch-anim 2s infinite linear alternate-reverse;
}

.glitch-text::before, .glitch-text::after {
    content: attr(data-text);
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
}

.glitch-text::before {
    left: 2px;
    text-shadow: -2px 0 #ff00c1;
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim-2 3s infinite linear alternate-reverse;
}

.glitch-text::after {
    left: -2px;
    text-shadow: -2px 0 #00fff9, 2px 2px #ff00c1;
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim-3 2.5s infinite linear alternate-reverse;
}

.glitch-subtext {
    font-size: 1.5rem;
    color: #a0aec0;
    letter-spacing: 3px;
    margin-bottom: 30px;
    position: relative;
    animation: fade-glitch 4s infinite;
}

/* Glowing Enter Button */
.glowing-btn {
    padding: 15px 40px;
    font-size: 1.5rem;
    font-weight: bold;
    color: #fff;
    background: transparent;
    border: 2px solid #00fff9;
    border-radius: 5px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 2px;
    position: relative;
    box-shadow: 0 0 15px #00fff9, inset 0 0 15px #00fff9;
    transition: all 0.3s;
    overflow: hidden;
}

.glowing-btn:hover {
    background: #00fff9;
    color: #000;
    box-shadow: 0 0 30px #00fff9, inset 0 0 20px #00fff9;
}

.glowing-btn::after {
    content: '';
    position: absolute;
    top: -50%; left: -50%; width: 200%; height: 200%;
    background: linear-gradient(transparent, rgba(255, 255, 255, 0.3), transparent);
    transform: rotate(45deg);
    animation: btn-glare 3s infinite;
}

/* Flying Notes */
.flying-note {
    position: absolute;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(0, 255, 255, 0.2);
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.1);
    color: rgba(255,255,255,0.2);
    padding: 10px;
    font-family: monospace;
    font-size: 10px;
    border-radius: 4px;
    filter: blur(2px);
    opacity: 0;
    pointer-events: none;
    animation: fly 5s linear infinite;
}

@keyframes fly {
    0% { transform: translateZ(-1000px) scale(0.1); opacity: 0; }
    20% { opacity: 0.8; }
    100% { transform: translateZ(500px) scale(3); opacity: 0; }
}

@keyframes glitch-anim {
    0% { clip: rect(21px, 9999px, 9px, 0); }
    20% { clip: rect(85px, 9999px, 83px, 0); }
    40% { clip: rect(31px, 9999px, 66px, 0); }
    60% { clip: rect(100px, 9999px, 82px, 0); }
    80% { clip: rect(61px, 9999px, 20px, 0); }
    100% { clip: rect(72px, 9999px, 4px, 0); }
}
@keyframes glitch-anim-2 {
    0% { clip: rect(65px, 9999px, 100px, 0); }
    20% { clip: rect(20px, 9999px, 11px, 0); }
    40% { clip: rect(93px, 9999px, 64px, 0); }
    60% { clip: rect(54px, 9999px, 5px, 0); }
    80% { clip: rect(11px, 9999px, 80px, 0); }
    100% { clip: rect(80px, 9999px, 32px, 0); }
}
@keyframes glitch-anim-3 {
    0% { clip: rect(10px, 9999px, 40px, 0); }
    20% { clip: rect(90px, 9999px, 21px, 0); }
    40% { clip: rect(53px, 9999px, 84px, 0); }
    60% { clip: rect(14px, 9999px, 15px, 0); }
    80% { clip: rect(71px, 9999px, 60px, 0); }
    100% { clip: rect(20px, 9999px, 92px, 0); }
}
@keyframes fade-glitch {
    0%, 100% { opacity: 1; text-shadow: 0 0 5px rgba(0, 255, 255, 0.5); }
    50% { opacity: 0.6; text-shadow: none; }
    55% { transform: translate(1px, 1px); }
    56% { transform: translate(-1px, -1px); }
    57% { transform: translate(0, 0); }
}
@keyframes btn-glare {
    0% { left: -100%; top: -100%; }
    100% { left: 200%; top: 200%; }
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .glitch-text {
        font-size: 3rem;
        letter-spacing: 2px;
    }
    .glitch-subtext {
        font-size: 1.2rem;
    }
    #editor, #preview {
        padding: 80px 20px 20px 20px;
        font-size: 1rem;
    }
    .action-bar {
        top: 15px;
        right: 15px;
        gap: 5px;
    }
    .btn {
        padding: 6px 12px;
        font-size: 0.9rem;
    }
    .loader {
        top: 15px;
        left: 15px;
    }
}
