:root {
    --bg-dark: #1e1e1e;
    --bg-darker: #121212;
    --bg-light: #2d2d2d;
    --text-main: #e0e0e0;
    --text-muted: #a0a0a0;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --danger: #ef4444;
    --border: #404040;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-darker);
    color: var(--text-main);
    height: 100vh;
    overflow: hidden;
}

.app-container { display: flex; height: 100%; }

/* Sidebar */
.sidebar {
    width: 300px;
    background-color: var(--bg-dark);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
}

.nav-tabs { display: flex; border-bottom: 1px solid var(--border); }
.nav-btn {
    flex: 1;
    background: none;
    border: none;
    padding: 12px;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    font-size: 0.9rem;
}
.nav-btn.active { color: var(--accent); border-bottom-color: var(--accent); }

.list-container { flex: 1; overflow-y: auto; }
.list-item {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.2s;
}
.list-item:hover { background-color: var(--bg-light); }
.list-item h4 { margin-bottom: 5px; color: var(--text-main); font-size: 1rem; }
.list-item p { font-size: 0.85em; color: var(--text-muted); }

/* Main Content */
.main-content {
    flex: 1;
    padding: 20px;
    background-color: var(--bg-darker);
    position: relative;
    overflow: hidden;
}

.view-section { height: 100%; display: flex; flex-direction: column; }
.hidden { display: none !important; }

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border);
}

/* Forms */
.form-group { margin-bottom: 20px; display: flex; flex-direction: column; }
.form-group label { margin-bottom: 8px; color: var(--text-muted); font-size: 0.9rem; }
.form-group input, .form-group textarea {
    background-color: var(--bg-light);
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 12px;
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
}
.form-group input:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
}
.form-group textarea { min-height: 200px; resize: none; }
.flex-grow { flex: 1; display: flex; flex-direction: column; }
.flex-grow textarea { flex: 1; }

/* Buttons */
.btn {
    padding: 8px 20px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-weight: 500;
    transition: 0.2s;
    font-size: 0.95rem;
}
.btn.primary { background-color: var(--accent); color: white; }
.btn.primary:hover { background-color: var(--accent-hover); }
.btn.secondary { background-color: var(--bg-light); color: var(--text-main); }
.btn.secondary:hover { background-color: #3d3d3d; }
.btn.danger { background-color: transparent; color: var(--danger); }
.btn.danger:hover { background-color: rgba(239, 68, 68, 0.1); }
.btn-icon { background: none; border: none; color: var(--accent); cursor: pointer; font-size: 1.2rem; }
.btn.large { width: 100%; padding: 12px; font-size: 1.1rem; }

/* Runner Layout */
.runner-container { display: flex; gap: 20px; flex: 1; overflow: hidden; }
.input-panel, .output-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: var(--bg-dark);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid var(--border);
}
.input-panel h4, .output-panel h4 { margin-bottom: 15px; color: var(--text-muted); font-weight: normal; }
.scroll-content { flex: 1; overflow-y: auto; padding-right: 5px; }
.panel-footer { margin-top: 20px; }

.result-box {
    flex: 1;
    background-color: var(--bg-light);
    padding: 20px;
    border-radius: 8px;
    overflow-y: auto;
    white-space: pre-wrap;
    line-height: 1.6;
    font-size: 1.05rem;
}
.placeholder { color: var(--text-muted); font-style: italic; display: flex; justify-content: center; align-items: center; height: 100%; }

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
}
.empty-state i { font-size: 4rem; margin-bottom: 20px; opacity: 0.3; }
.empty-state h3 { font-size: 1.5rem; margin-bottom: 10px; color: var(--text-main); }

/* Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #404040; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #505050; }

/* Loading Effects */
.loader-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--accent);
}

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(59, 130, 246, 0.3);
    border-radius: 50%;
    border-top-color: var(--accent);
    animation: spin 1s ease-in-out infinite;
    margin-bottom: 15px;
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.5);
}

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

.loading-text {
    font-size: 0.9rem;
    letter-spacing: 1px;
    animation: pulse 1.5s infinite;
}

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

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

.modal-content {
    background-color: var(--bg-dark);
    width: 80%;
    max-width: 800px;
    height: 85%;
    border-radius: 12px;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 { font-weight: normal; color: var(--text-main); }

.btn-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 5px;
    transition: color 0.2s;
}
.btn-close:hover { color: var(--text-main); }

.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.detail-group { margin-bottom: 25px; }
.detail-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--accent);
    font-size: 0.9rem;
    font-weight: 500;
}

.detail-value { color: var(--text-main); font-size: 1rem; }

.detail-box {
    background-color: var(--bg-light);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid var(--border);
    white-space: pre-wrap;
    line-height: 1.6;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.detail-box.highlight {
    color: var(--text-main);
    border-left: 3px solid var(--accent);
}

.detail-code {
    background-color: #1a1a1a;
    padding: 15px;
    border-radius: 8px;
    font-family: 'Consolas', monospace;
    font-size: 0.9rem;
    color: #a5d6ff;
    overflow-x: auto;
}
