@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;800&display=swap');

:root {
    --bg-dark: #050505;
    --sidebar-bg: #0a0a0a;
    --glass: rgba(255, 255, 255, 0.04);
    --glass-hover: rgba(255, 255, 255, 0.08);
    --border: rgba(255, 255, 255, 0.1);
    --accent: #38bdf8;
    --py-accent: #ffd43b;
    --danger: #ef4444;
    --success: #22c55e;
    --text-light: #e2e8f0;
    --text-muted: #94a3b8;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-light);
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: background 0.3s, color 0.3s;
}

header {
    height: 60px;
    background: var(--glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    border-bottom: 1px solid var(--border);
    z-index: 100;
}

.header-left, .header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.menu-btn {
    background: none;
    border: none;
    color: var(--accent);
    font-size: 1.5rem;
    cursor: pointer;
    transition: transform 0.2s;
}

.menu-btn:hover {
    transform: scale(1.1);
}

.logo {
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 2px;
    background: linear-gradient(90deg, #fff, var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.tab-system {
    display: flex;
    gap: 5px;
    background: rgba(0, 0, 0, 0.5);
    padding: 5px;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.tab-btn {
    padding: 6px 16px;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.tab-btn:hover {
    color: #fff;
}

.tab-btn.active {
    background: var(--glass);
    color: var(--accent);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

#tabPy.active {
    color: var(--py-accent);
}

#status-cloud {
    font-size: 0.75rem;
    font-weight: 600;
}

.btn-thanos {
    background: linear-gradient(45deg, #ef4444, #991b1b);
    border: none;
    color: white;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    font-size: 0.85rem;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.3);
    transition: all 0.3s ease;
}

.btn-thanos:hover {
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.6);
    transform: translateY(-1px);
}

.sidebar {
    position: fixed;
    left: -350px;
    top: 0;
    width: 340px;
    height: 100vh;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border);
    transition: left 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 20px;
    overflow-y: auto;
    z-index: 200;
    box-shadow: 15px 0 30px rgba(0,0,0,0.8);
}

.sidebar.active {
    left: 0;
}

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

.sidebar-header h2 {
    font-size: 1.2rem;
    color: var(--accent);
}

#closeMenu {
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
}

.menu-section {
    margin-bottom: 5px;
    border-bottom: 1px solid var(--border);
}

.menu-header {
    width: 100%;
    background: none;
    border: none;
    color: var(--text-light);
    text-align: left;
    padding: 15px 5px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.menu-header:hover {
    color: var(--accent);
}

.menu-content {
    display: none;
    padding: 10px 5px 15px 5px;
}

.btn {
    width: 100%;
    padding: 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: bold;
    border: none;
    transition: opacity 0.2s, transform 0.2s;
    margin-top: 8px;
    color: #fff;
    background: var(--glass);
    border: 1px solid var(--border);
}

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

.btn-accent { background: var(--accent); color: #000; border: none; }
.btn-save { background: var(--success); border: none; }
.btn-reset { background: var(--danger); border: none; }
.btn-all { background: linear-gradient(45deg, #a855f7, #6366f1); border: none; }
.btn-google { background: white; color: #000; display: flex; align-items: center; justify-content: center; gap: 10px; }

.main-workspace {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: opacity 1.5s ease;
}

.workspace-env {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    position: absolute;
    top: 0; left: 0;
    transition: opacity 0.4s ease, visibility 0.4s;
}

.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    z-index: -1;
}

.code-panels {
    display: flex;
    flex: 1;
    height: 50%;
    background: #000;
    overflow: hidden;
}

.panel {
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border);
    transition: flex 0.4s ease, width 0.4s ease;
    width: 40px;
    background: var(--bg-dark);
}

.panel.active {
    flex: 1;
    width: auto;
    background: #000;
}

.panel-header {
    padding: 10px 0;
    font-size: 0.8rem;
    font-weight: 800;
    cursor: pointer;
    text-align: center;
    writing-mode: vertical-rl;
    height: 100%;
    display: flex;
    align-items: center;
    color: var(--text-muted);
    letter-spacing: 2px;
}

.panel.active .panel-header {
    writing-mode: horizontal-tb;
    height: auto;
    padding: 8px 15px;
    text-align: left;
    display: block;
    background: rgba(0,0,0,0.5);
    border-bottom: 1px solid var(--border);
}

.panel#panel-html .panel-header { color: #f16529; }
.panel#panel-css .panel-header { color: #2965f1; }
.panel#panel-js .panel-header { color: #f0db4f; }

.editor-container {
    flex: 1;
    width: 100%;
}

.responsive-bar {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 5px 15px;
    background: var(--bg-dark);
    border-bottom: 1px solid var(--border);
}

.res-btn {
    padding: 5px 10px;
    border: 1px solid var(--border);
    border-radius: 4px;
    cursor: pointer;
    background: var(--glass);
    color: var(--text-muted);
    transition: 0.2s;
}

.res-btn.active {
    background: var(--accent);
    color: #000;
    border-color: var(--accent);
}

.preview-panel {
    flex: 1;
    height: 50%;
    background: #fff;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

iframe#output {
    width: 100%;
    height: 100%;
    border: none;
    background: #fff;
    transition: width 0.3s ease, height 0.3s ease;
}

#err-js-preview {
    display: none;
    position: absolute;
    left: 0; right: 0; bottom: 0;
    background: #fee; color: #b91c1c;
    font-family: monospace;
    z-index: 10; padding: 10px;
    font-size: 13px;
    border-top: 2px solid #ef4444;
}

.python-workspace {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #000;
}

.python-workspace .editor-box {
    flex: 7;
    display: flex;
    flex-direction: column;
    border-bottom: 2px solid var(--py-accent);
}

.python-workspace .panel-header {
    writing-mode: horizontal-tb;
    height: auto;
    padding: 8px 15px;
    text-align: left;
    display: block;
    color: var(--py-accent);
    background: var(--bg-dark);
}

.console-box {
    flex: 3;
    display: flex;
    flex-direction: column;
    background: #0a0a0a;
}

.py-console {
    flex: 1;
    padding: 15px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 14px;
    color: #a3b8cc;
    overflow-y: auto;
}

.thanos-canvas-overlay {
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 9999;
}
