/* ==========================================================================
   DevOS v0.2.4 Master Layout System
   ========================================================================== */

#app {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

.topbar {
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    background: #181818;
    border-bottom: 1px solid #2b2b2b;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    color: white;
}

.logo .version {
    font-size: 12px;
    color: #3d5afe;
}

.actions {
    display: flex;
    gap: 12px;
}

.actions button {
    font-size: 20px;
    background: transparent;
    border: none;
    color: white;
}

/* --- Navigation Bar Row --- */
.editor-tabs {
    display: flex !important;
    height: 56px;
    background: #222;
    align-items: center;
    box-sizing: border-box;
}

/* Unified clean size scaling across mobile viewports */
.editor-tabs button.tab {
    flex: 2 !important; /* Takes up proportional comfortable space */
    height: 100%;
    border: none;
    background: #222;
    color: white;
    font-size: 16px;
}

.editor-tabs button.tab.active {
    background: #3d5afe;
}

/* Explicit compact horizontal footprint for History Controls */
.history-controls {
    display: flex !important;
    width: 76px !important;
    min-width: 76px !important;
    max-width: 76px !important;
    height: 100% !important;
    background: #161616 !important;
    border-left: 1px solid #2b2b2b;
    border-right: 1px solid #2b2b2b;
    box-sizing: border-box;
    align-items: center;
}

.history-controls button {
    flex: 1 !important;
    height: 100% !important;
    background: transparent !important;
    border: none !important;
    outline: none !important;
    color: #444444; /* Dim grey default */
    font-size: 18px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
}

.history-controls button:active {
    background: #222 !important;
}

#runBtn {
    flex: 1.5 !important; /* Slightly smaller layout track to make room */
    height: 100%;
    background: #2e7d32 !important;
    color: white;
    border: none;
    font-weight: bold;
    font-size: 15px;
}

/* --- Workspace Structure --- */
#workspace {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#editor {
    flex: 1;
    position: relative;
    background: #151515;
}

.editor-panel {
    position: absolute;
    inset: 0;
    display: none;
    width: 100%;
    height: 100%;
    padding: 16px;
    border: none;
    outline: none;
    resize: none;
    background: #151515;
    color: white;
    font-size: 15px;
    font-family: monospace;
    box-sizing: border-box;
}

.editor-panel.active {
    display: block !important;
}

#previewContainer {
    height: 240px;
    display: flex;
    flex-direction: column;
    background: white;
}

#dragHandle {
    height: 18px;
    background: #2b2b2b;
    display: flex;
    justify-content: center;
    align-items: center;
    touch-action: none;
}

#dragHandle::before {
    content: "";
    width: 70px;
    height: 6px;
    border-radius: 100px;
    background: #888;
}

#preview {
    flex: 1;
    border: none;
    width: 100%;
    background: white;
}

/* ==========================================================================
   Added Engine Features: DevOS v0.2.5 Modals & Overlays System
   ========================================================================== */
.devos-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background: #1e1e1e;
    border: 1px solid #2b2b2b;
    border-radius: 8px;
    width: 100%;
    max-width: 320px;
    padding: 20px;
    color: #ffffff;
    box-sizing: border-box;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    border-bottom: 1px solid #2b2b2b;
    padding-bottom: 8px;
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: bold;
}

.close-modal-btn {
    background: transparent;
    border: none;
    color: #888;
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
}

.action-btn-primary {
    width: 100%;
    background: #3d5afe;
    color: white;
    border: none;
    padding: 10px;
    font-weight: bold;
    border-radius: 4px;
    font-size: 14px;
    margin-bottom: 16px;
    cursor: pointer;
}

.project-list-wrapper h4 {
    margin: 0 0 8px 0;
    color: #888;
    font-size: 13px;
}

#projectList {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 180px;
    overflow-y: auto;
}

#projectList li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: #252525;
    margin-bottom: 6px;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
}

#projectList li.active-proj {
    border-left: 3px solid #3d5afe;
    background: #2b2b2b;
}

.delete-proj-btn {
    background: transparent;
    border: none;
    color: #ef5350;
    font-weight: bold;
    font-size: 18px;
    cursor: pointer;
    padding: 0 4px;
}

/* Settings Form Controls */
.settings-group {
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.settings-group label {
    font-size: 13px;
    color: #aaa;
}

.settings-group select {
    background: #252525;
    color: white;
    border: 1px solid #333;
    padding: 8px;
    border-radius: 4px;
    font-size: 14px;
    outline: none;
}

.checkbox-group {
    flex-direction: row !important;
    justify-content: space-between;
    align-items: center;
}

.checkbox-group input {
    width: 18px;
    height: 18px;
    accent-color: #3d5afe;
}

.danger-zone {
    margin-top: 24px;
    border-top: 1px solid #ef535044;
    padding-top: 12px;
}

.danger-zone h4 {
    margin: 0 0 8px 0;
    color: #ef5350;
    font-size: 13px;
}

.action-btn-danger {
    width: 100%;
    background: #c62828;
    color: white;
    border: none;
    padding: 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
}
