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

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif;
    background: #0d1117;
    color: #c9d1d9;
}

/* ============= CONTAINER ============= */
.container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100%;
}

/* ============= NAVBAR ============= */
.navbar {
    background: linear-gradient(to right, #161b22 0%, #0d1117 100%);
    border-bottom: 1px solid #30363d;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.navbar-brand h1 {
    font-size: 18px;
    font-weight: 600;
    color: #ffffff;
    letter-spacing: 0.5px;
}

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

/* ============= BUTTONS ============= */
.btn-run {
    background: linear-gradient(135deg, #238636 0%, #2ea043 100%);
    color: white;
    border: 1px solid #2ea043;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s;
    box-shadow: 0 2px 6px rgba(35, 134, 54, 0.3);
}

.btn-run:hover {
    background: linear-gradient(135deg, #2ea043 0%, #3fb950 100%);
    box-shadow: 0 4px 12px rgba(35, 134, 54, 0.4);
    transform: translateY(-1px);
}

.btn-run:active {
    transform: translateY(0);
}

.btn {
    background: #21262d;
    color: #c9d1d9;
    border: 1px solid #30363d;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
}

.btn:hover {
    background: #30363d;
    border-color: #444c56;
}

.btn-secondary:hover {
    background: #30363d;
}

.btn-icon {
    padding: 4px 8px;
    min-width: 32px;
}

/* ============= MAIN GRID LAYOUT ============= */
.grid-layout {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 0;
    padding: 0;
    overflow: hidden;
}

/* ============= PANELS ============= */
.panel {
    display: flex;
    flex-direction: column;
    background: #0d1117;
    border: 1px solid #30363d;
    overflow: hidden;
}

.panel.full-width {
    grid-column: span 2;
}

.panel-header {
    background: linear-gradient(to bottom, #161b22 0%, #0d1117 100%);
    padding: 12px 16px;
    border-bottom: 1px solid #30363d;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.panel-header h3 {
    font-size: 13px;
    font-weight: 600;
    color: #79c0ff;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.header-buttons {
    display: flex;
    gap: 6px;
}

/* ============= EDITORS ============= */
.editor-input {
    flex: 1;
    background: #0d1117;
    color: #c9d1d9;
    border: none;
    padding: 15px 12px;
    font-family: 'Courier New', 'Consolas', 'Monaco', monospace;
    font-size: 13px;
    line-height: 1.6;
    resize: none;
    outline: none;
    overflow: auto;
    tab-size: 4;
    caret-color: #79c0ff;
}

.editor-input::placeholder {
    color: #6e7681;
    opacity: 0.7;
}

.editor-input::selection {
    background: #388bfd;
    color: #ffffff;
}

.editor-input::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

.editor-input::-webkit-scrollbar-track {
    background: transparent;
}

.editor-input::-webkit-scrollbar-thumb {
    background: #30363d;
    border-radius: 5px;
    border: 2px solid #0d1117;
}

.editor-input::-webkit-scrollbar-thumb:hover {
    background: #444c56;
    border-color: #161b22;
}

/* ============= PREVIEW OUTPUT ============= */
.preview-output {
    flex: 1;
    background: #ffffff;
    overflow: auto;
    position: relative;
}

.preview-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #999;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    text-align: center;
}

.preview-placeholder p {
    font-size: 14px;
}

.preview-placeholder strong {
    color: #333;
    font-weight: 600;
}

/* ============= CONSOLE ============= */
.console-output {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    font-family: 'Courier New', 'Consolas', 'Monaco', monospace;
    font-size: 12px;
    line-height: 1.5;
    background: #0d1117;
}

.console-output::-webkit-scrollbar {
    width: 10px;
}

.console-output::-webkit-scrollbar-track {
    background: transparent;
}

.console-output::-webkit-scrollbar-thumb {
    background: #30363d;
    border-radius: 5px;
    border: 2px solid #0d1117;
}

.console-log-line {
    padding: 4px 0;
    margin: 2px 0;
    border-left: 3px solid transparent;
    padding-left: 8px;
    word-break: break-all;
}

.console-log-line.log {
    color: #c9d1d9;
    border-left-color: #6e7681;
}

.console-log-line.success {
    color: #3fb950;
    border-left-color: #3fb950;
    background: rgba(63, 185, 80, 0.1);
    padding: 4px 8px;
    margin: 2px 0;
}

.console-log-line.error {
    color: #f85149;
    border-left-color: #f85149;
    background: rgba(248, 81, 73, 0.1);
    padding: 4px 8px;
    margin: 2px 0;
}

.console-log-line.warn {
    color: #d29922;
    border-left-color: #d29922;
    background: rgba(210, 153, 34, 0.1);
    padding: 4px 8px;
    margin: 2px 0;
}

.console-log-line.info {
    color: #79c0ff;
    border-left-color: #79c0ff;
    background: rgba(121, 192, 255, 0.08);
    padding: 4px 8px;
    margin: 2px 0;
}

.console-log-line.prompt-line {
    color: #6e7681;
    border-left-color: #30363d;
}

/* ============= CONSOLE INPUT ============= */
.console-input-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: #161b22;
    border-top: 1px solid #30363d;
    flex-shrink: 0;
}

.console-prompt {
    color: #6e7681;
    font-weight: 600;
    font-family: 'Courier New', 'Consolas', monospace;
    font-size: 12px;
}

.console-input {
    flex: 1;
    background: #0d1117;
    color: #c9d1d9;
    border: 1px solid #30363d;
    padding: 8px 12px;
    border-radius: 6px;
    font-family: 'Courier New', 'Consolas', monospace;
    font-size: 12px;
    outline: none;
    transition: all 0.2s;
}

.console-input:focus {
    border-color: #79c0ff;
    background: #0d1117;
    box-shadow: 0 0 0 3px rgba(121, 192, 255, 0.1);
}

.console-input::placeholder {
    color: #6e7681;
}

/* ============= RESPONSIVE ============= */
@media (max-width: 1400px) {
    .grid-layout {
        grid-template-columns: 1fr 1fr;
    }
    
    .panel.full-width {
        grid-column: span 2;
    }
}

@media (max-width: 900px) {
    .grid-layout {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto auto auto;
    }
    
    .panel.full-width {
        grid-column: 1;
    }
}

/* ============= SCROLLBAR GLOBAL ============= */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #0d1117;
}

::-webkit-scrollbar-thumb {
    background: #30363d;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #444c56;
}

/* ============= SYNTAX HIGHLIGHTING ============= */
.hljs {
    background: transparent !important;
    color: #c9d1d9 !important;
}

.hljs-tag {
    color: #79c0ff;
}

.hljs-attr {
    color: #79c0ff;
}

.hljs-string {
    color: #a371f7;
}

.hljs-number {
    color: #79c0ff;
}

.hljs-literal {
    color: #79c0ff;
}

.hljs-comment {
    color: #8b949e;
    font-style: italic;
}

.hljs-keyword {
    color: #ff7b72;
}

.hljs-function {
    color: #d29922;
}

.hljs-title {
    color: #79c0ff;
}
