:root {
    --bg-dark: #1e1e1e;
    --sidebar-bg: #252526;
    --header-bg: #333333;
    --accent: #007acc;
    --text: #d4d4d4;
    --border: #3c3c3c;
}

body {
    margin: 0;
    font-family: 'Segoe UI', Tahoma, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text);
    overflow: hidden;
    height: 100vh;
}

.ide-container { display: flex; flex-direction: column; height: 100vh; }

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

.btn { padding: 6px 15px; border: none; border-radius: 3px; cursor: pointer; font-weight: 600; font-size: 13px; }
.btn-run { background-color: #28a745; color: white; }
.btn-upload { background-color: var(--accent); color: white; }
.btn-new { background-color: #6c757d; color: white; }

main { display: flex; flex: 1; overflow: hidden; }

.sidebar { width: 200px; background-color: var(--sidebar-bg); border-right: 1px solid var(--border); }
.sidebar-title { padding: 10px; font-size: 11px; font-weight: bold; color: #888; text-transform: uppercase; }

#file-list { list-style: none; padding: 0; margin: 0; }
.file-item { padding: 8px 15px; font-size: 13px; cursor: pointer; display: flex; align-items: center; gap: 8px; }
.file-item.active { background-color: #37373d; border-left: 2px solid var(--accent); }

.editor-container { flex: 1; display: flex; flex-direction: column; }
.editor-header { background: #2d2d2d; padding: 5px 15px; font-size: 12px; border-bottom: 1px solid var(--border); }
#code-editor { flex: 1; background: transparent; color: #9cdcfe; border: none; padding: 15px; font-family: 'Consolas', monospace; font-size: 14px; outline: none; }

.preview-container { flex: 1; background: white; display: flex; flex-direction: column; border-left: 1px solid var(--border); }
.preview-header { background: #f3f3f3; color: #333; padding: 5px 15px; font-size: 12px; }
#output-frame { flex: 1; border: none; background: white; }

footer { background: var(--accent); height: 22px; font-size: 11px; display: flex; align-items: center; padding: 0 10px; color: white; }

/* Modal Styling */
.modal-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.7);
    z-index: 1000; align-items: center; justify-content: center; backdrop-filter: blur(5px);
}
.modal-card {
    background: #1e1e1e; width: 400px; border-radius: 12px; padding: 20px;
    border: 1px solid #333; box-shadow: 0 10px 25px rgba(0,0,0,0.5);
}
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.modal-header h3 { margin: 0; color: #fff; }
.close-btn { background: none; border: none; color: #888; font-size: 18px; cursor: pointer; }
.close-btn:hover { color: #f87171; }

.modal-tabs { display: flex; border-bottom: 1px solid #333; margin-bottom: 20px; }
.tab-btn {
    flex: 1; background: none; border: none; color: #888; padding: 10px;
    cursor: pointer; font-weight: 600; transition: 0.3s;
}
.tab-btn.active { color: #3b82f6; border-bottom: 2px solid #3b82f6; }

.file-input { width: 100%; padding: 10px; background: #2d2d2d; border: 1px dashed #555; border-radius: 8px; color: #fff; }
.url-box { width: 100%; padding: 12px; background: #2d2d2d; border: 1px solid #444; border-radius: 8px; color: #fff; box-sizing: border-box; }




/* Auth Inputs Styling */
.auth-input {
    width: 100%;
    padding: 12px;
    margin-bottom: 10px;
    background: #2d2d2d;
    border: 1px solid #444;
    border-radius: 6px;
    color: #fff;
    font-size: 14px;
    box-sizing: border-box;
    transition: border 0.3s;
}
.auth-input:focus {
    border-color: #007acc;
    outline: none;
}

.folder-header {
    display: flex;
    justify-content: space-between;
    padding: 10px 15px;
    background: #2d2d2d;
    font-weight: bold;
    font-size: 13px;
    color: #ddd;
}
.folder-header i, .folder-actions i {
    cursor: pointer;
    margin-left: 10px;
    color: #888;
}
.folder-header i:hover, .folder-actions i:hover { color: #fff; }

.file-tree-ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.folder-details summary {
    display: flex;
    justify-content: space-between;
    padding: 8px 15px;
    cursor: pointer;
    list-style: none;
    font-size: 13px;
    color: #ccc;
}
.folder-details summary::-webkit-details-marker { display: none; }
.folder-details[open] .arrow { transform: rotate(90deg); }

.file-item {
    display: flex;
    justify-content: space-between;
    padding: 6px 30px; /* Indent files */
    font-size: 13px;
    color: #aaa;
    cursor: pointer;
}
.file-item:hover { background: #2d2d2d; color: #fff; }
.delete-icon { color: #f87171; opacity: 0; }
.file-item:hover .delete-icon { opacity: 1; }