/* Cyberpunk Markdown Editor - CYBER.MD */

:root {
    /* Cyberpunk Color Palette */
    --neon-cyan: #00ffff;
    --neon-pink: #ff00ff;
    --neon-green: #00ff41;
    --neon-orange: #ff9500;
    --electric-blue: #0080ff;
    --dark-bg: #0a0a0f;
    --darker-bg: #050508;
    --console-bg: #0f0f1a;
    --border-glow: #00ffff;
    --text-primary: #e0e0e0;
    --text-secondary: #a0a0a0;
    --text-accent: #00ffff;
    --error-red: #ff0040;
    --warning-yellow: #ffff00;
    
    /* Fonts */
    --font-mono: 'Fira Code', 'Courier New', monospace;
    --font-display: 'Orbitron', 'Helvetica', sans-serif;
    
    /* Effects */
    --glow-intensity: 0 0 10px;
    --text-shadow: 0 0 5px;
}

/* Enhanced Features Styles */

/* Theme Modal Styles */
.theme-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(5px);
}

.theme-modal-content {
    background: linear-gradient(135deg, var(--terminal-bg) 0%, rgba(0, 255, 65, 0.05) 100%);
    border: 2px solid var(--neon-green);
    border-radius: 12px;
    padding: 30px;
    max-width: 600px;
    width: 90%;
    box-shadow: 0 0 40px var(--neon-green);
    position: relative;
}

.theme-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--neon-green);
}

.theme-modal-header h3 {
    color: var(--neon-green);
    font-family: 'Orbitron', monospace;
    font-size: 1.2rem;
    margin: 0;
    text-shadow: 0 0 10px var(--neon-green);
}

.theme-close-btn {
    background: none;
    border: none;
    color: var(--neon-green);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.theme-close-btn:hover {
    background: rgba(0, 255, 65, 0.2);
    transform: scale(1.1);
}

.theme-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.theme-option {
    display: flex;
    align-items: center;
    padding: 15px;
    border: 1px solid rgba(0, 255, 65, 0.3);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(0, 255, 65, 0.05);
}

.theme-option:hover {
    border-color: var(--neon-green);
    background: rgba(0, 255, 65, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 255, 65, 0.2);
}

.theme-option.active {
    border-color: var(--neon-green);
    background: rgba(0, 255, 65, 0.15);
    box-shadow: 0 0 15px rgba(0, 255, 65, 0.3);
}

.theme-preview {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 15px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    flex-shrink: 0;
}

.theme-info {
    flex: 1;
}

.theme-name {
    color: var(--text-color);
    font-weight: bold;
    margin-bottom: 5px;
    font-family: 'Orbitron', monospace;
}

.theme-colors {
    display: flex;
    gap: 5px;
}

.color-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Notification Styles */
.cyber-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    background: linear-gradient(135deg, var(--terminal-bg) 0%, rgba(0, 255, 65, 0.1) 100%);
    border: 1px solid var(--neon-green);
    border-radius: 8px;
    color: var(--text-color);
    font-family: 'Fira Code', monospace;
    font-size: 0.9rem;
    z-index: 9999;
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    max-width: 300px;
}

.cyber-notification.show {
    transform: translateX(0);
    opacity: 1;
}

.cyber-notification.success {
    border-color: var(--neon-green);
    box-shadow: 0 0 15px rgba(0, 255, 65, 0.3);
}

.cyber-notification.warning {
    border-color: #ff9500;
    box-shadow: 0 0 15px rgba(255, 149, 0, 0.3);
}

.cyber-notification.error {
    border-color: #ff0040;
    box-shadow: 0 0 15px rgba(255, 0, 64, 0.3);
}

/* Full Screen Mode Styles */
.fullscreen-mode {
    overflow: hidden;
}

.fullscreen-mode .terminal-container {
    border-radius: 0;
    margin: 0;
    height: 100vh;
    max-height: none;
}

.fullscreen-mode .terminal-header {
    border-radius: 0;
}

.fullscreen-mode .bg-effects {
    opacity: 0.8;
}

/* Cyberpunk Markdown Editor Styles */
body {
    font-family: var(--font-mono);
    background: var(--dark-bg);
    color: var(--text-primary);
    overflow: hidden !important; /* Force no scrollbars */
    height: 100vh;
    position: relative;
    margin: 0;
    padding: 0;
}

html {
    overflow: hidden !important; /* Ensure no scrollbars on html element either */
    height: 100%;
    margin: 0;
    padding: 0;
}

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

/* Terminal Container - initially hidden during loading */
.terminal-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background: linear-gradient(135deg, var(--dark-bg) 0%, var(--darker-bg) 100%);
    position: relative;
    z-index: 1;
    opacity: 0;
    transition: opacity 0.5s ease-in;
}

.terminal-container.loaded {
    opacity: 1;
}

/* Header Styling */
.terminal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 20px;
    background: linear-gradient(90deg, var(--console-bg) 0%, rgba(0, 255, 255, 0.1) 50%, var(--console-bg) 100%);
    border-bottom: 2px solid var(--neon-cyan);
    box-shadow: var(--glow-intensity) var(--neon-cyan);
    backdrop-filter: blur(10px);
}

.logo {
    display: flex;
    flex-direction: column;
}

.logo-text {
    font-family: var(--font-display);
    font-weight: 900;
    font-size: 1.4rem;
    color: var(--neon-cyan);
    text-shadow: var(--text-shadow) var(--neon-cyan);
    letter-spacing: 2px;
}

.logo-subtitle {
    font-size: 0.7rem;
    color: var(--text-secondary);
    letter-spacing: 1px;
    margin-top: -2px;
}

.status-bar {
    display: flex;
    gap: 20px;
    font-size: 0.8rem;
}

.status-item {
    display: flex;
    gap: 5px;
}

.status-label {
    color: var(--text-secondary);
}

.status-value {
    color: var(--neon-green);
    font-weight: bold;
    text-shadow: var(--text-shadow) var(--neon-green);
}

.system-controls {
    display: flex;
    gap: 10px;
}

/* Mobile menu button - hidden on desktop */
.mobile-menu-btn {
    display: none;
    background: linear-gradient(135deg, var(--terminal-bg) 0%, rgba(0, 255, 255, 0.1) 100%);
    border: 1px solid var(--neon-cyan);
    color: var(--neon-cyan);
    padding: 8px 12px;
    font-family: 'Fira Code', monospace;
    font-size: 0.8rem;
    font-weight: bold;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.3s ease;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 36px;
}

.mobile-menu-btn:hover {
    background: rgba(0, 255, 255, 0.2);
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.3);
}

.control-btn {
    background: linear-gradient(135deg, var(--terminal-bg) 0%, rgba(0, 255, 65, 0.1) 100%);
    border: 1px solid var(--neon-green);
    color: var(--neon-green);
    padding: 8px 12px;
    font-family: 'Fira Code', monospace;
    font-size: 0.8rem;
    font-weight: bold;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-left: 8px;
    position: relative;
    overflow: hidden;
}

.control-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 255, 65, 0.2), transparent);
    transition: left 0.5s ease;
}

.control-btn:hover::before {
    left: 100%;
}

.control-btn:hover {
    background: rgba(0, 255, 65, 0.2);
    box-shadow: 0 0 15px rgba(0, 255, 65, 0.3);
    transform: translateY(-1px);
}

.control-btn:active {
    transform: translateY(0);
    box-shadow: 0 0 10px rgba(0, 255, 65, 0.2);
}

/* Main Content */
.terminal-main {
    flex: 1;
    overflow: hidden;
    min-height: 0; /* Allow flexbox to work properly */
}

.split-container {
    display: flex;
    height: 100%;
    min-height: 0; /* Allow flex items to shrink properly */
}

/* Panes */
.editor-pane,
.preview-pane {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: rgba(15, 15, 26, 0.8);
    backdrop-filter: blur(5px);
    height: 100%; /* Ensure both panes have full height */
    min-height: 0; /* Allow flex items to shrink */
    align-items: stretch; /* Stretch child elements to fill width */
}

.pane-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: linear-gradient(90deg, rgba(0, 255, 255, 0.1) 0%, transparent 100%);
    border-bottom: 1px solid var(--neon-cyan);
    position: relative;
    flex-shrink: 0; /* Prevent header from shrinking */
    min-height: 40px; /* Ensure consistent header height */
    height: 40px; /* Fixed height for both headers */
    box-sizing: border-box; /* Include padding and border in height */
    margin: 0; /* Remove any margins */
}

.pane-title {
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--neon-cyan);
    font-size: 0.9rem;
    letter-spacing: 2px;
    text-shadow: var(--text-shadow) var(--neon-cyan);
}

.pane-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cursor-blink {
    color: var(--neon-green);
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

.status-indicator {
    width: 8px;
    height: 8px;
    background: var(--neon-green);
    border-radius: 50%;
    box-shadow: var(--glow-intensity) var(--neon-green);
    animation: pulse 2s infinite;
}

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

.scan-line {
    width: 20px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--neon-cyan), transparent);
    animation: scan 3s linear infinite;
}

@keyframes scan {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Editor */
.editor-container {
    flex: 1;
    display: flex;
    position: relative;
    overflow: hidden;
    height: 100%; /* Ensure full height */
    min-height: 0; /* Allow proper flex behavior */
    align-items: stretch; /* Stretch child elements to full height */
}

.line-numbers {
    background: rgba(0, 0, 0, 0.3);
    color: var(--text-secondary);
    padding: 20px 10px;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    line-height: 1.6;
    min-width: 50px;
    width: 50px; /* Fixed width to prevent layout shifts */
    text-align: right;
    border-right: 1px solid rgba(0, 255, 255, 0.3);
    user-select: none;
    overflow-y: auto; /* Allow scrolling for line numbers */
    box-sizing: border-box; /* Include padding in calculations */
    flex-shrink: 0; /* Prevent shrinking */
    align-self: stretch; /* Ensure it stretches to full container height */
}

.markdown-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.9rem;
    line-height: 1.6;
    padding: 20px;
    resize: none;
    outline: none;
    overflow-y: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
    box-sizing: border-box; /* Include padding in height calculation */
    margin: 0; /* Remove any default margins */
    border: 0; /* Ensure no borders */
    align-self: stretch; /* Ensure it stretches to full container height */
}

.markdown-input::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

.markdown-input:focus {
    box-shadow: inset 0 0 20px rgba(0, 255, 255, 0.1);
}

/* Ensure perfect height alignment between panes */
.editor-pane > *,
.preview-pane > * {
    margin: 0;
    border: 0;
}

/* Force exact height calculations */
.editor-container,
.preview-container {
    min-height: calc(100% - 40px); /* Account for header height */
    max-height: calc(100% - 40px);
}

/* Ensure consistent internal spacing */
.editor-container > *,
.preview-container > * {
    vertical-align: top;
}

/* Remove any default textarea styling that might affect height */
textarea.markdown-input {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    border-radius: 0;
    line-height: 1.6; /* Match preview line height ratio */
}

/* Divider */
.divider {
    width: 4px;
    background: linear-gradient(180deg, var(--neon-cyan), var(--neon-pink), var(--neon-cyan));
    position: relative;
    cursor: col-resize;
    display: flex;
    align-items: center;
    justify-content: center;
}

.divider-handle {
    color: var(--neon-cyan);
    font-size: 1.2rem;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    text-shadow: var(--text-shadow) var(--neon-cyan);
    background: var(--dark-bg);
    padding: 10px 2px;
    border-radius: 4px;
}

.divider:hover {
    background: linear-gradient(180deg, var(--neon-pink), var(--neon-cyan), var(--neon-pink));
    box-shadow: var(--glow-intensity) var(--neon-cyan);
}

/* Preview */
.preview-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    box-sizing: border-box; /* Include padding in height calculation */
    align-self: stretch; /* Ensure it stretches to full container height */
    display: flex;
    flex-direction: column;
}

.preview-content {
    color: var(--text-primary);
    line-height: 1.6; /* Match markdown input line height for perfect alignment */
    flex: 1; /* Allow content to grow and fill available space */
    min-height: 0; /* Allow content to shrink if needed */
}

.preview-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-secondary);
    text-align: center;
}

.loading-animation {
    margin-bottom: 20px;
}

.matrix-rain {
    width: 100px;
    height: 100px;
    background: linear-gradient(180deg, 
        transparent 0%,
        var(--neon-green) 50%,
        transparent 100%);
    animation: matrix-fall 2s linear infinite;
    opacity: 0.6;
}

@keyframes matrix-fall {
    0% { transform: translateY(-100px); opacity: 0; }
    50% { opacity: 1; }
    100% { transform: translateY(100px); opacity: 0; }
}

/* Preview Content Styling */
.preview-content h1,
.preview-content h2,
.preview-content h3,
.preview-content h4,
.preview-content h5,
.preview-content h6 {
    color: var(--neon-cyan);
    font-family: var(--font-display);
    text-shadow: var(--text-shadow) var(--neon-cyan);
    margin: 1.5rem 0 1rem 0;
    border-bottom: 2px solid rgba(0, 255, 255, 0.3);
    padding-bottom: 0.5rem;
}

.preview-content h1 { font-size: 2rem; }
.preview-content h2 { font-size: 1.6rem; }
.preview-content h3 { font-size: 1.3rem; }

.preview-content p {
    margin: 1rem 0;
}

.preview-content strong {
    color: var(--neon-pink);
    text-shadow: var(--text-shadow) var(--neon-pink);
}

.preview-content em {
    color: var(--neon-orange);
    text-shadow: var(--text-shadow) var(--neon-orange);
}

.preview-content code {
    background: rgba(0, 255, 255, 0.1);
    color: var(--neon-green);
    padding: 2px 6px;
    border-radius: 3px;
    font-family: var(--font-mono);
    text-shadow: var(--text-shadow) var(--neon-green);
}

.preview-content pre {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--neon-cyan);
    border-radius: 8px;
    padding: 20px;
    margin: 1rem 0;
    overflow-x: auto;
    box-shadow: var(--glow-intensity) rgba(0, 255, 255, 0.3);
}

.preview-content pre code {
    background: none;
    padding: 0;
    border-radius: 0;
}

.preview-content blockquote {
    border-left: 4px solid var(--neon-pink);
    margin: 1rem 0;
    padding: 1rem 1.5rem;
    background: rgba(255, 0, 255, 0.05);
    color: var(--neon-pink);
    font-style: italic;
}

.preview-content ul,
.preview-content ol {
    margin: 1rem 0;
    padding-left: 2rem;
}

.preview-content li {
    margin: 0.5rem 0;
    color: var(--text-primary);
}

.preview-content li::marker {
    color: var(--neon-green);
}

.preview-content a {
    color: var(--electric-blue);
    text-decoration: none;
    text-shadow: var(--text-shadow) var(--electric-blue);
    transition: all 0.3s ease;
}

.preview-content a:hover {
    color: var(--neon-cyan);
    text-shadow: var(--text-shadow) var(--neon-cyan);
    text-decoration: underline;
}

.preview-content table {
    border-collapse: collapse;
    width: 100%;
    margin: 1rem 0;
    border: 1px solid var(--neon-cyan);
}

.preview-content th,
.preview-content td {
    border: 1px solid rgba(0, 255, 255, 0.3);
    padding: 0.75rem;
    text-align: left;
}

.preview-content th {
    background: rgba(0, 255, 255, 0.1);
    color: var(--neon-cyan);
    font-weight: bold;
}

/* Footer */
.terminal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 20px;
    background: var(--console-bg);
    border-top: 2px solid var(--neon-cyan);
    font-size: 0.7rem;
    color: var(--text-secondary);
}

.system-info,
.version-info {
    letter-spacing: 1px;
}

#session-time {
    color: var(--neon-green);
    font-weight: bold;
}

/* Background Effects */
.bg-effects {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.scan-lines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 255, 255, 0.03) 2px,
        rgba(0, 255, 255, 0.03) 4px
    );
    animation: scan-lines 0.1s linear infinite;
}

@keyframes scan-lines {
    0% { transform: translateY(0); }
    100% { transform: translateY(4px); }
}

.grid-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(0, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: grid-flicker 3s ease-in-out infinite alternate;
}

@keyframes grid-flicker {
    0% { opacity: 0.5; }
    100% { opacity: 0.8; }
}

/* Scrollbars */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--darker-bg);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--neon-cyan), var(--neon-pink));
    border-radius: 4px;
    box-shadow: var(--glow-intensity) var(--neon-cyan);
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--neon-pink), var(--neon-cyan));
}

/* Loading Screen Styles */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--dark-bg) 0%, var(--darker-bg) 100%);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity 1s ease-out;
    overflow: hidden; /* Prevent any scrollbars on loading screen */
}

.loading-screen.fade-out {
    opacity: 0;
    pointer-events: none;
}

.loading-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loading-matrix {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.3;
    z-index: 1;
}

.loading-content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 800px;
    width: 95%;
    padding: 20px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-sizing: border-box;
}

.loading-header {
    margin-bottom: 20px;
}

.cyber-logo {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 900;
    letter-spacing: 6px;
    margin-bottom: 10px;
    text-transform: uppercase;
}

.logo-cyber {
    color: var(--neon-cyan);
    text-shadow: 
        0 0 10px var(--neon-cyan),
        0 0 20px var(--neon-cyan),
        0 0 40px var(--neon-cyan);
    animation: cyber-glow 2s ease-in-out infinite alternate;
}

.logo-dot {
    color: var(--neon-pink);
    text-shadow: 
        0 0 10px var(--neon-pink),
        0 0 20px var(--neon-pink);
    animation: dot-pulse 1s ease-in-out infinite;
}

.logo-md {
    color: var(--neon-green);
    text-shadow: 
        0 0 10px var(--neon-green),
        0 0 20px var(--neon-green),
        0 0 40px var(--neon-green);
    animation: md-flicker 3s ease-in-out infinite;
}

@keyframes cyber-glow {
    0% { text-shadow: 0 0 10px var(--neon-cyan), 0 0 20px var(--neon-cyan), 0 0 40px var(--neon-cyan); }
    100% { text-shadow: 0 0 15px var(--neon-cyan), 0 0 30px var(--neon-cyan), 0 0 60px var(--neon-cyan); }
}

@keyframes dot-pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.8; }
}

@keyframes md-flicker {
    0%, 90%, 100% { opacity: 1; }
    92%, 94%, 96%, 98% { opacity: 0.8; }
    93%, 95%, 97% { opacity: 1; }
}

.loading-subtitle {
    font-family: var(--font-mono);
    font-size: 1.2rem;
    color: var(--text-secondary);
    letter-spacing: 4px;
    text-transform: uppercase;
    margin-bottom: 30px;
    animation: subtitle-scan 4s linear infinite;
}

@keyframes subtitle-scan {
    0%, 100% { color: var(--text-secondary); }
    50% { color: var(--neon-cyan); text-shadow: 0 0 10px var(--neon-cyan); }
}

.system-info-panel {
    background: rgba(0, 255, 255, 0.05);
    border: 1px solid var(--neon-cyan);
    border-radius: 8px;
    padding: 15px;
    margin: 15px 0;
    backdrop-filter: blur(10px);
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.2);
}

.info-line {
    display: flex;
    justify-content: space-between;
    margin: 10px 0;
    font-family: var(--font-mono);
    font-size: 0.9rem;
}

.info-label {
    color: var(--text-secondary);
    text-transform: uppercase;
}

.info-value {
    color: var(--neon-green);
    font-weight: bold;
    text-shadow: 0 0 5px var(--neon-green);
}

.status-initializing {
    animation: status-blink 1s linear infinite;
}

@keyframes status-blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0.3; }
}

.loading-progress-section {
    margin: 20px 0;
}

.progress-container {
    position: relative;
    margin-bottom: 15px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(0, 255, 255, 0.1);
    border: 1px solid var(--neon-cyan);
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, 
        var(--neon-cyan) 0%, 
        var(--neon-pink) 50%, 
        var(--neon-green) 100%);
    width: 0%;
    transition: width 0.3s ease;
    position: relative;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.5);
}

.progress-glow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.3) 50%, 
        transparent 100%);
    animation: progress-shine 2s linear infinite;
}

@keyframes progress-shine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress-percentage {
    font-family: var(--font-mono);
    font-size: 1.1rem;
    color: var(--neon-cyan);
    font-weight: bold;
    text-align: center;
    margin-top: 10px;
    text-shadow: 0 0 10px var(--neon-cyan);
}

.init-logs {
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid var(--neon-green);
    border-radius: 8px;
    padding: 15px;
    margin: 15px 0;
    height: auto;
    min-height: 180px;
    max-height: 200px;
    overflow: hidden;
    position: relative;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    width: 100%;
    box-sizing: border-box;
}

.log-header {
    font-family: var(--font-mono);
    color: var(--neon-green);
    font-size: 0.9rem;
    font-weight: bold;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid var(--neon-green);
    padding-bottom: 5px;
    white-space: nowrap;
    overflow: visible;
    text-overflow: clip;
    flex-shrink: 0;
    min-width: 0;
    width: 100%;
}

.log-content {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-primary);
    line-height: 1.4;
    flex: 1;
    overflow: hidden; /* Completely hide any overflow */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
    padding: 10px;
    box-sizing: border-box;
    min-height: 120px; /* Reduced minimum height */
}

.log-content::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.log-line {
    margin: 3px 0;
    opacity: 0;
    animation: log-fade-in 0.5s ease-out forwards;
    color: var(--neon-green);
    text-shadow: 0 0 5px var(--neon-green);
}

.log-line.success {
    color: var(--neon-green);
}

.log-line.warning {
    color: var(--neon-green);
}

.log-line.error {
    color: var(--neon-green);
}

.log-line.info {
    color: var(--neon-green);
}

@keyframes log-fade-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.loading-spinner {
    position: relative;
    width: 60px;
    height: 60px;
    margin: 15px auto;
}

.spinner-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 2px solid transparent;
    border-radius: 50%;
    animation: spin 3s linear infinite;
}

.spinner-ring:nth-child(1) {
    border-top-color: var(--neon-cyan);
    animation-duration: 2s;
}

.spinner-ring:nth-child(2) {
    border-right-color: var(--neon-pink);
    animation-duration: 3s;
    animation-direction: reverse;
    width: 70%;
    height: 70%;
    top: 15%;
    left: 15%;
}

.spinner-ring:nth-child(3) {
    border-bottom-color: var(--neon-green);
    animation-duration: 4s;
    width: 40%;
    height: 40%;
    top: 30%;
    left: 30%;
}

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

.loading-scan-lines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 255, 255, 0.02) 2px,
        rgba(0, 255, 255, 0.02) 4px
    );
    animation: loading-scan 0.1s linear infinite;
    z-index: 3;
    pointer-events: none;
}

@keyframes loading-scan {
    0% { transform: translateY(0); }
    100% { transform: translateY(4px); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .split-container {
        flex-direction: column;
    }
    
    .divider {
        width: 100%;
        height: 4px;
        writing-mode: horizontal-tb;
    }
    
    .divider-handle {
        writing-mode: horizontal-tb;
        text-orientation: mixed;
    }
    
    .status-bar {
        display: none;
    }
    
    .logo-subtitle {
        display: none;
    }
    
    /* Mobile header adjustments */
    .terminal-header {
        padding: 8px 15px;
    }
    
    .logo-text {
        font-size: 1.2rem;
    }
    
    /* Hide regular control buttons on mobile */
    .system-controls {
        display: none;
    }
    
    /* Show mobile menu button */
    .mobile-menu-btn {
        display: flex !important;
    }
    
    /* Mobile menu overlay */
    .mobile-menu-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.8);
        z-index: 9999;
        display: flex;
        backdrop-filter: blur(5px);
    }
    
    /* Mobile menu panel */
    .mobile-menu-panel {
        position: fixed;
        top: 0;
        right: -300px;
        width: 280px;
        height: 100%;
        background: linear-gradient(135deg, var(--terminal-bg) 0%, var(--darker-bg) 100%);
        border-left: 2px solid var(--neon-cyan);
        box-shadow: -5px 0 20px rgba(0, 255, 255, 0.3);
        transition: right 0.3s ease;
        overflow-y: auto;
        padding: 20px;
        box-sizing: border-box;
    }
    
    .mobile-menu-panel.open {
        right: 0;
    }
    
    .mobile-menu-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 25px;
        padding-bottom: 15px;
        border-bottom: 1px solid var(--neon-cyan);
    }
    
    .mobile-menu-title {
        color: var(--neon-cyan);
        font-family: var(--font-display);
        font-size: 1.1rem;
        font-weight: bold;
        text-shadow: 0 0 10px var(--neon-cyan);
    }
    
    .mobile-menu-close {
        background: none;
        border: none;
        color: var(--neon-cyan);
        font-size: 1.8rem;
        cursor: pointer;
        padding: 5px;
        border-radius: 4px;
        transition: all 0.3s ease;
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .mobile-menu-close:hover {
        background: rgba(0, 255, 255, 0.2);
        transform: scale(1.1);
    }
    
    .mobile-menu-controls {
        display: flex;
        flex-direction: column;
        gap: 15px;
    }
    
    .mobile-control-btn {
        background: linear-gradient(135deg, var(--terminal-bg) 0%, rgba(0, 255, 65, 0.1) 100%);
        border: 1px solid var(--neon-green);
        color: var(--neon-green);
        padding: 15px 20px;
        font-family: 'Fira Code', monospace;
        font-size: 0.9rem;
        font-weight: bold;
        cursor: pointer;
        border-radius: 8px;
        transition: all 0.3s ease;
        text-transform: uppercase;
        letter-spacing: 1px;
        display: flex;
        align-items: center;
        justify-content: center;
        text-align: center;
        min-height: 50px;
        position: relative;
        overflow: hidden;
    }
    
    .mobile-control-btn::before {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        background: linear-gradient(90deg, transparent, rgba(0, 255, 65, 0.2), transparent);
        transition: left 0.5s ease;
    }
    
    .mobile-control-btn:hover::before {
        left: 100%;
    }
    
    .mobile-control-btn:hover {
        background: rgba(0, 255, 65, 0.2);
        box-shadow: 0 0 15px rgba(0, 255, 65, 0.3);
        transform: translateY(-2px);
    }
    
    .mobile-control-btn:active {
        transform: translateY(0);
        box-shadow: 0 0 10px rgba(0, 255, 65, 0.2);
    }
    
    /* Mobile menu button animation */
    .hamburger {
        display: flex;
        flex-direction: column;
        gap: 3px;
        cursor: pointer;
    }
    
    .hamburger span {
        width: 20px;
        height: 2px;
        background: var(--neon-cyan);
        transition: all 0.3s ease;
        box-shadow: 0 0 5px var(--neon-cyan);
    }
    
    .hamburger.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    
    .hamburger.active span:nth-child(2) {
        opacity: 0;
    }
    
    .hamburger.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }
    
      /* Loading screen responsive adjustments */
    .loading-content {
        padding: 10px;
        max-height: 90vh;
        width: 98%;
        max-width: none;
    }
    
    .cyber-logo {
        font-size: clamp(1.8rem, 8vw, 2.5rem);
        letter-spacing: 3px;
        margin-bottom: 10px;
    }
    
    .loading-subtitle {
        font-size: 0.9rem;
        letter-spacing: 1px;
        margin-bottom: 20px;
    }
      .init-logs {
        height: auto;
        min-height: 160px;
        max-height: clamp(180px, 30vh, 200px);
        margin: 10px 0;
        padding: 12px;
    }
    
    .log-header {
        font-size: 0.8rem;
        letter-spacing: 0.5px;
        margin-bottom: 12px;
        word-break: break-word;
        white-space: normal;
    }
      .system-info-panel {
        padding: 10px;
        margin: 10px 0;
    }
    
    /* Mobile-responsive markdown content scaling */
    .preview-content {
        font-size: 16px !important; /* Ensure readable font size on mobile */
        line-height: 1.6;
        word-wrap: break-word;
        overflow-wrap: break-word;
        hyphens: auto;
    }
    
    .preview-content h1 {
        font-size: 1.8rem !important;
        line-height: 1.3;
        margin-bottom: 1rem;
        word-break: break-word;
    }
    
    .preview-content h2 {
        font-size: 1.5rem !important;
        line-height: 1.3;
        margin-bottom: 0.8rem;
        word-break: break-word;
    }
    
    .preview-content h3 {
        font-size: 1.3rem !important;
        line-height: 1.3;
        margin-bottom: 0.7rem;
        word-break: break-word;
    }
    
    .preview-content h4,
    .preview-content h5,
    .preview-content h6 {
        font-size: 1.1rem !important;
        line-height: 1.3;
        margin-bottom: 0.6rem;
        word-break: break-word;
    }
    
    .preview-content p {
        font-size: 16px !important;
        line-height: 1.6;
        margin-bottom: 1rem;
        word-break: break-word;
        text-align: justify;
    }
    
    .preview-content code {
        font-size: 14px !important;
        padding: 3px 6px;
        word-break: break-all;
        white-space: pre-wrap;
    }
    
    .preview-content pre {
        font-size: 13px !important;
        overflow-x: auto;
        white-space: pre-wrap;
        word-wrap: break-word;
        padding: 15px;
        margin: 1rem 0;
        border-radius: 6px;
    }
    
    .preview-content pre code {
        font-size: 13px !important;
        white-space: pre-wrap;
        word-wrap: break-word;
    }
    
    .preview-content ul,
    .preview-content ol {
        padding-left: 1.5rem;
        margin-bottom: 1rem;
    }
    
    .preview-content li {
        margin-bottom: 0.5rem;
        line-height: 1.5;
        word-break: break-word;
    }
    
    .preview-content blockquote {
        margin: 1rem 0;
        padding: 1rem;
        font-size: 15px !important;
        line-height: 1.5;
        word-break: break-word;
    }
    
    .preview-content table {
        width: 100%;
        font-size: 14px !important;
        overflow-x: auto;
        display: block;
        white-space: nowrap;
    }
    
    .preview-content th,
    .preview-content td {
        padding: 8px 12px;
        word-break: break-word;
        max-width: 200px;
    }
    
    .preview-content a {
        word-break: break-all;
        text-decoration: underline;
    }
      /* Ensure markdown content doesn't overflow viewport */
    .preview-container {
        padding: 10px !important;
        max-width: 100vw;
        overflow-x: hidden;
    }
    
    /* Enhanced mobile viewer mode styling */
    .viewer-mode .mobile-menu-panel {
        background: linear-gradient(135deg, rgba(10, 10, 15, 0.98) 0%, rgba(5, 5, 8, 0.98) 100%) !important;
        border-left: 3px solid var(--neon-cyan) !important;
        box-shadow: -10px 0 30px rgba(0, 255, 255, 0.4) !important;
    }
    
    .viewer-mode .mobile-menu-title {
        font-size: 1.2rem !important;
        text-shadow: 0 0 15px var(--neon-cyan) !important;
    }
    
    .viewer-mode .mobile-control-btn {
        background: linear-gradient(135deg, rgba(0, 255, 255, 0.1) 0%, rgba(0, 255, 65, 0.1) 100%) !important;
        border: 2px solid var(--neon-cyan) !important;
        color: var(--neon-cyan) !important;
        font-size: 1rem !important;
        padding: 18px 24px !important;
        text-shadow: 0 0 8px var(--neon-cyan) !important;
        box-shadow: 0 0 15px rgba(0, 255, 255, 0.2) !important;
    }
    
    .viewer-mode .mobile-control-btn:hover {
        background: rgba(0, 255, 255, 0.3) !important;
        box-shadow: 0 0 25px rgba(0, 255, 255, 0.5) !important;
        transform: translateY(-3px) !important;
    }
    
    /* Enhanced viewer mode background for better contrast */
    .viewer-mode .terminal-container {
        background: linear-gradient(135deg, rgba(10, 10, 15, 0.98) 0%, rgba(5, 5, 8, 0.98) 100%) !important;
    }
    
    .viewer-mode .terminal-main {
        background: rgba(0, 0, 0, 0.3) !important;
    }
    
    /* Better mobile scrolling for viewer mode */
    .viewer-mode .preview-container {
        -webkit-overflow-scrolling: touch !important;
        scroll-behavior: smooth !important;
    }
    
    /* Enhanced mobile button visibility */
    .viewer-mode .mobile-menu-btn {
        background: linear-gradient(135deg, rgba(0, 255, 255, 0.2) 0%, rgba(0, 255, 255, 0.1) 100%) !important;
        border: 2px solid var(--neon-cyan) !important;
        box-shadow: 0 0 15px rgba(0, 255, 255, 0.3) !important;
        text-shadow: 0 0 8px var(--neon-cyan) !important;
    }
    
    .viewer-mode .mobile-menu-btn:hover {
        background: rgba(0, 255, 255, 0.4) !important;
        box-shadow: 0 0 25px rgba(0, 255, 255, 0.5) !important;
    }
    
    .viewer-mode .hamburger span {
        background: var(--neon-cyan) !important;
        box-shadow: 0 0 8px var(--neon-cyan) !important;
        height: 3px !important;
        width: 24px !important;
    }
    
    /* Responsive images and media */
    .preview-content img {
        max-width: 100% !important;
        height: auto !important;
        display: block;
        margin: 1rem auto;
    }
    
    .preview-content video,
    .preview-content iframe {
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
    }
}

/* Enhanced Animations */
@keyframes cyber-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

@keyframes matrix-glow {
    0%, 100% { text-shadow: 0 0 5px var(--primary-color); }
    50% { text-shadow: 0 0 15px var(--primary-color), 0 0 25px var(--primary-color); }
}

.cyber-glow {
    animation: cyber-pulse 2s ease-in-out infinite;
}

.matrix-text {
    animation: matrix-glow 3s ease-in-out infinite;
}

/* CSS Variables for Theme Support */
:root {
    --primary-color: #00ff41;
    --secondary-color: #003d12;
    --accent-color: #00cc33;
    --bg-color: #0a0a0f;
    --terminal-bg: #0d1421;
    --text-color: #ffffff;
    --neon-green: #00ff41;
    --error-red: #ff0040;
    --warning-orange: #ff9500;
    --info-blue: #00ffff;
}

/* Shortcuts Styles */

/* Shortcuts Modal */
.shortcuts-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(5px);
}

.shortcuts-modal-content {
    background: linear-gradient(135deg, var(--terminal-bg) 0%, rgba(0, 255, 65, 0.05) 100%);
    border: 2px solid var(--neon-green);
    border-radius: 12px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 0 40px var(--neon-green);
    position: relative;
}

.shortcuts-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--neon-green);
}

.shortcuts-modal-header h3 {
    color: var(--neon-green);
    font-family: 'Orbitron', monospace;
    font-size: 1.2rem;
    margin: 0;
    text-shadow: 0 0 10px var(--neon-green);
}

.shortcuts-close-btn {
    background: none;
    border: none;
    color: var(--neon-green);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.shortcuts-close-btn:hover {
    background: rgba(0, 255, 65, 0.2);
    transform: scale(1.1);
}

.shortcuts-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.shortcut-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: rgba(0, 255, 65, 0.05);
    border: 1px solid rgba(0, 255, 65, 0.2);
    border-radius: 6px;
    transition: all 0.3s ease;
}

.shortcut-item:hover {
    background: rgba(0, 255, 65, 0.1);
    border-color: var(--neon-green);
}

.shortcut-item kbd {
    background: linear-gradient(135deg, #1a1a1a 0%, #333 100%);
    border: 1px solid var(--neon-green);
    border-radius: 4px;
    padding: 4px 8px;
    font-family: 'Fira Code', monospace;
    font-size: 0.8rem;
    color: var(--neon-green);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    text-shadow: 0 0 5px var(--neon-green);
}

.shortcut-item span {
    color: var(--text-color);
    font-family: 'Fira Code', monospace;
    font-size: 0.9rem;
}

.shortcuts-footer {
    text-align: center;
    padding-top: 15px;
    border-top: 1px solid rgba(0, 255, 65, 0.3);
}

.shortcuts-footer p {
    margin: 0;
    color: var(--text-color);
    font-family: 'Fira Code', monospace;
    font-size: 0.8rem;
    opacity: 0.8;
}

/* Enhanced Status Bar */
.status-bar .status-item {
    position: relative;
    transition: all 0.3s ease;
}

.status-bar .status-item:hover {
    transform: scale(1.05);
}

.status-bar .status-item:hover .status-value {
    text-shadow: 0 0 10px var(--neon-green);
}



/* Enhanced Button Effects */
.control-btn:hover {
    animation: button-pulse 0.5s ease-in-out;
}

@keyframes button-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Advanced Glow Effects */
.cyber-enhanced {
    position: relative;
    overflow: hidden;
}

.cyber-enhanced::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(0, 255, 65, 0.1) 0%, transparent 70%);
    animation: rotate-glow 4s linear infinite;
    pointer-events: none;
}

@keyframes rotate-glow {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Terminal Enhancements */
.terminal-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--neon-green), transparent);
    animation: scan-line 2s ease-in-out infinite;
}

@keyframes scan-line {
    0%, 100% { opacity: 0; }
    50% { opacity: 1; }
}

/* Ensure scrollbars don't affect layout alignment */
.markdown-input::-webkit-scrollbar,
.preview-container::-webkit-scrollbar {
    width: 8px;
}

.markdown-input::-webkit-scrollbar-track,
.preview-container::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
}

.markdown-input::-webkit-scrollbar-thumb,
.preview-container::-webkit-scrollbar-thumb {
    background: var(--neon-cyan);
    border-radius: 4px;
    opacity: 0.6;
}

.markdown-input::-webkit-scrollbar-thumb:hover,
.preview-container::-webkit-scrollbar-thumb:hover {
    opacity: 1;
}

/* Force consistent scrollbar behavior */
.editor-container,
.preview-container {
    scrollbar-width: thin;
    scrollbar-color: var(--neon-cyan) rgba(0, 0, 0, 0.3);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .shortcuts-modal-content {
        padding: 20px;
        margin: 20px;
    }
    
    .shortcut-item {
        flex-direction: column;
        gap: 5px;
        text-align: center;
    }
    
    .shortcuts-list {
        gap: 8px;
    }
    
    .shortcut-item kbd {
        font-size: 0.7rem;
        padding: 3px 6px;
    }
}

/* Ensure no scrollbars during loading */
.loading-screen *,
.loading-screen *:before,
.loading-screen *:after {
    overflow: hidden !important;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
}

.loading-screen *::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}