/*
FILE: /styles.css
PURPOSE: Moonskai Editor v3 styling (split + diff + settings + PWA-friendly top safe-area).
CREATED BY: Scott Russo.

Notes:
- Keep it sleek, modern, and readable.
- The "option background" issue on Windows is handled by styling .select option.
*/

:root{
  --bg:#0b0f12;
  --panel:#0f1418;
  --panel2:#10171c;
  --border:rgba(255,255,255,0.08);
  --border2:rgba(255,255,255,0.12);
  --text:#e9f6f2;
  --muted:rgba(233,246,242,0.65);
  --accent:#63ffd1;
  --accent2:#2ee1b3;
  --danger:#ff5b6e;
  --shadow: 0 18px 60px rgba(0,0,0,0.45);
  --radius: 16px;
  --radius2: 22px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --sans: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family:var(--sans);
  background:radial-gradient(1400px 700px at 15% 0%, rgba(99,255,209,0.07), transparent 60%),
             radial-gradient(1200px 800px at 80% 10%, rgba(46,225,179,0.06), transparent 55%),
             var(--bg);
  color:var(--text);
}

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

.toolbar{
  position:sticky;
  top:0;
  z-index:20;
  display:flex;
  justify-content:space-between;
  gap:14px;
  padding: calc(env(safe-area-inset-top, 0px) + 6px) 12px 6px 12px;
  background: linear-gradient(to bottom, rgba(15,20,24,0.94), rgba(15,20,24,0.80));
  backdrop-filter: blur(12px);
  border-bottom:1px solid var(--border);
  align-items:center;
  min-height:54px;
}
    
.toolbar-left{
  display:flex;
  gap:14px;
  align-items:center;
  min-width:0;
}
.brand{
  display:flex;
  align-items:center;
  gap:10px;
  padding:0;
  border:none;
  border-radius:0;
  background:transparent;
  box-shadow:none;
}

.brand-badge{
  width:28px;
  height:28px;
  display:grid;
  place-items:center;
  border-radius:999px;
  background: transparent;
  border: none;
}


.brand-title{
  font-weight:800;
  letter-spacing:0.02em;
  line-height:1.05;
}
.brand-sub{
  display:block;
  font-size:10px;
  color:var(--muted);
  font-weight:700;
  margin-top:2px;
  line-height:1.1;
}
  .toolbar-actions{
  display:flex;
  align-items:center;
  gap:6px;
  flex-wrap:nowrap;           /* key: prevent multi-row toolbar bloat */
  min-width:0;
  overflow-x:auto;
  overflow-y:hidden;
  -webkit-overflow-scrolling: touch;
  }
  .plugin-buttons{
  display:flex;
  align-items:center;
  gap:6px;
  flex-wrap:nowrap;
}


.toolbar-right{
  display:flex;
  align-items:center;
  gap:8px;
  padding:6px 10px;
}

.toolbar-sep{
  width:1px;
  height:28px;
  background: var(--border2);
  margin:0 4px;
}

.btn{
  border:1px solid var(--border2);
  background: rgba(16,23,28,0.55);
  color:var(--text);
  padding:9px 12px;
  border-radius: 999px;
  cursor:pointer;
  font-weight:700;
  font-size:13px;
  letter-spacing:0.01em;
  transition: transform 120ms ease, background 120ms ease, border-color 120ms ease;
  user-select:none;
}

.btn:hover{
  transform: translateY(-1px);
  border-color: rgba(99,255,209,0.30);
  background: rgba(16,23,28,0.70);
}

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

.btn.primary{
  background: linear-gradient(180deg, rgba(99,255,209,0.18), rgba(46,225,179,0.10));
  border-color: rgba(99,255,209,0.34);
}

.btn.danger{
  border-color: rgba(255,91,110,0.40);
  background: rgba(255,91,110,0.08);
}

.select-wrap{
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  gap:4px;
  padding:6px 10px;
  border:1px solid var(--border);
  border-radius:14px;
  background: rgba(16,23,28,0.55);
}

  .select-label{
    font-size:12px;
    color:var(--muted);
    font-weight:800;
    line-height:1.1;
  }
  .select{
    width:100%;
    font-size:12px;
    border:1px solid #000;      /* thin black outline */
    outline:none;
    background: rgba(15,20,24,0.80);  /* header-like gray */
    color:#fff;                 /* white selected text */
    font-weight:800;
    cursor:pointer;
    padding:6px 8px;
    border-radius:10px;
  }
         
/* Make native dropdown option list readable on Windows */
.select option,
.select optgroup{
  color:#000;
  background:#e6e6e6;
}
#pluginSelect{
  min-width: 160px;
  max-width: 240px;
}

.tabs-bar{
  border-bottom:1px solid var(--border);
  background: rgba(15,20,24,0.65);
  backdrop-filter: blur(10px);
}

.tabs{
  display:flex;
  gap:6px;
    padding:8px 10px;
  overflow:auto;
  overscroll-behavior: contain;
}

.tab{
  display:flex;
  align-items:center;
  gap:8px;
  padding:7px 10px;
  border-radius: 999px;
  border:1px solid var(--border);
  background: rgba(16,23,28,0.42);
  cursor:pointer;
  user-select:none;
  white-space:nowrap;
  transition: background 120ms ease, border-color 120ms ease;
  touch-action: none;
}

.tab:hover{
  background: rgba(16,23,28,0.62);
}

.tab.active{
  border-color: rgba(99,255,209,0.40);
  background: rgba(16,23,28,0.72);
}

.tab .dot{
  width:8px;
  height:8px;
  border-radius:50%;
  background: rgba(233,246,242,0.22);
}

.tab.dirty .dot{
  background: var(--accent);
}

.tab .name{
  font-weight:800;
    font-size:12px;
}

.tab .close{
  width:20px;
  height:20px;
  display:grid;
  place-items:center;
  border-radius:50%;
  border:1px solid transparent;
  color: rgba(233,246,242,0.70);
}
  border-radius:50%;
  border:1px solid transparent;
  color: rgba(233,246,242,0.70);
}

.tab .close:hover{
  border-color: rgba(255,255,255,0.16);
  color: rgba(233,246,242,0.95);
}

.editor-container{
  position:relative;
  flex:1;
  min-height:0;
  background: rgba(10,14,17,0.35);
}

/* Split + Diff layout */
#editorLeft, #editorRight, #diffEditor{ width:100%; height:100%; }
/* V4: Single View (hide compare pane) */
#splitWrap.single .pane-right{ display:none; }
#splitWrap.single .pane-left{ flex: 1 1 auto; }
#splitWrap.single .pane + .pane{ border-left:none; }

.split-wrap{ position:absolute; inset:0; display:flex; }
.split-wrap.single .pane.right{ display:none; }
.split-wrap.single .pane{ flex:1; }

.pane{ position:relative; flex:1; min-width:0; overflow:hidden; }
.pane + .pane{ border-left:1px solid var(--border); }
.editor-host{ width:100%; height:100%; }
.diff-wrap{ position:absolute; inset:0; }

.pane-label{
  position:absolute;
  top:10px;
  left:12px;
  z-index:5;
  font-size:11px;
  letter-spacing:0.12em;
  color:rgba(233,246,242,0.75);
  background:rgba(17,23,24,0.55);
  border:1px solid rgba(255,255,255,0.12);
  padding:4px 8px;
  border-radius:999px;
  backdrop-filter: blur(6px);
  user-select:none;
}

.pane-overlay{
  position:absolute;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:24px;
  pointer-events:none;
}
.overlay-card{
  max-width:520px;
  width:100%;
  background:rgba(17,23,24,0.85);
  border:1px solid rgba(255,255,255,0.14);
  border-radius:16px;
  padding:16px 18px;
  box-shadow: var(--shadow);
}
.overlay-title{ font-weight:700; margin-bottom:6px; }
.overlay-sub{ color:var(--muted); font-size:13px; line-height:1.35; }

.status-bar{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  padding: 10px 14px calc(env(safe-area-inset-bottom, 0px) + 10px) 14px;
  border-top:1px solid var(--border);
  background: rgba(15,20,24,0.80);
  backdrop-filter: blur(10px);
}

.status-left, .status-right{
  display:flex;
  align-items:center;
  gap:10px;
  min-width:0;
}

.mono{
  font-family: var(--mono);
  font-size:12px;
  color: rgba(233,246,242,0.78);
}

.pill{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(99,255,209,0.35);
  background: rgba(99,255,209,0.08);
  font-size: 12px;
  font-weight: 800;
}

.boot-overlay{
  position:absolute;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:24px;
  background: rgba(11,15,18,0.62);
  backdrop-filter: blur(10px);
  z-index:50;
}

.boot-card{
  max-width: 720px;
  width: 100%;
  border-radius: 20px;
  padding: 18px 18px 16px 18px;
  background: rgba(16,23,28,0.82);
  border: 1px solid rgba(255,255,255,0.14);
  box-shadow: var(--shadow);
}

.boot-title{
  font-weight: 900;
  letter-spacing:0.02em;
  margin-bottom: 6px;
}

.boot-sub{
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 12px;
}

.boot-details{
  font-family: var(--mono);
  font-size: 12px;
  color: rgba(233,246,242,0.80);
  white-space: pre-wrap;
  margin:0;
}

.dialog{
  border:none;
  padding:0;
  background: transparent;
}

.dialog::backdrop{
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(10px);
}

.dialog-card{
  width: min(720px, calc(100vw - 28px));
  border-radius: 22px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(16,23,28,0.92);
  box-shadow: var(--shadow);
  color: var(--text);
  padding: 0;
  overflow: hidden;
}

.dialog-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding: 14px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.10);
}

.dialog-title{
  font-weight: 900;
  letter-spacing:0.02em;
}

.dialog-body{
  padding: 14px;
  display:grid;
  gap: 12px;
}

.dialog-foot{
  padding: 14px;
  border-top: 1px solid rgba(255,255,255,0.10);
  display:flex;
  justify-content:flex-end;
}

.card{
  padding: 12px 12px;
  border-radius: 18px;
  background: rgba(10,14,17,0.40);
  border: 1px solid rgba(255,255,255,0.10);
}

.card-title{
  font-weight: 900;
  margin-bottom: 8px;
}

.row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
  padding: 8px 0;
}

.muted{
  color: var(--muted);
}

.small{
  font-size: 12px;
}
/* Plugins dialog */
.plugin-list{
  display:grid;
  gap:10px;
  margin-top:10px;
}
.plugin-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:10px 12px;
  border:1px solid rgba(255,255,255,0.10);
  border-radius:14px;
  background: rgba(10,14,17,0.30);
}
.plugin-meta{
  display:flex;
  align-items:center;
  gap:10px;
  min-width:0;
}
.plugin-toggle{
  display:flex;
  align-items:center;
  gap:10px;
  min-width:0;
}
.plugin-name{
  font-weight:800;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  max-width:52vw;
}
.plugin-actions{
  display:flex;
  align-items:center;
  gap:8px;
  flex-shrink:0;
}
.plugin-actions-bar{
  display:flex;
  align-items:center;
  gap:10px;
  margin-top:12px;
  flex-wrap:wrap;
}
