/* ============================================================
   apps.css — context menu + per-application styling
   ============================================================ */

/* ---------- context menu ---------- */
.ctx-menu {
  position: fixed;
  z-index: var(--z-context);
  background: #fff;
  border: 1px solid #8aa4cf;
  box-shadow: 3px 3px 8px rgba(0,0,0,.35);
  padding: 2px;
  min-width: 160px;
  font-size: 11px;
}
.ctx-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 22px 4px 24px;
  border-radius: 2px;
  cursor: default;
  position: relative;
  color: #000;
}
.ctx-item .ico { position: absolute; left: 3px; width: 16px; height: 16px; }
.ctx-item:hover { background: #316ac5; color: #fff; }
.ctx-item.disabled { color: #9a9a9a; pointer-events: none; }
.ctx-item.bold { font-weight: bold; }
.ctx-sep { height: 1px; background: #d4d4d4; margin: 3px 2px; }

/* ---------- generic explorer / file list ---------- */
.explorer { display: flex; flex-direction: column; height: 100%; }

.explorer-toolbar {
  display: flex; align-items: center; gap: 8px;
  padding: 3px 6px; flex: 0 0 auto;
  border-bottom: 1px solid #dcdcdc;
  background: linear-gradient(#fff, #eef2f7);
}
.explorer-toolbar .tb-btn {
  display: flex; align-items: center; gap: 4px;
  padding: 3px 8px; border-radius: 3px; color: #333;
}
.explorer-toolbar .tb-btn:hover { background: #cfe0f8; }
.explorer-toolbar .tb-btn.disabled { opacity: .4; pointer-events: none; }
.explorer-toolbar .tb-btn img { width: 20px; height: 20px; }

.explorer-address {
  display: flex; align-items: center; gap: 6px;
  padding: 2px 6px; flex: 0 0 auto;
  border-bottom: 1px solid #dcdcdc;
}
.explorer-address label { color: #666; }
.explorer-address .addr {
  flex: 1; display: flex; align-items: center; gap: 5px;
  border: 1px solid #7f9db9; background: #fff; padding: 2px 6px; height: 20px;
}
.explorer-address .addr img { width: 16px; height: 16px; }

.explorer-main { flex: 1; display: flex; min-height: 0; }

/* left blue task pane */
.explorer-pane {
  width: 180px; flex: 0 0 auto; overflow: auto;
  background: linear-gradient(180deg, #7aa5e8 0%, #6d9ae0 22%, #9dc0ee 62%, #d6e3f7 100%);
  padding: 8px;
}
.explorer-pane .grp { background: #fff; border-radius: 4px; margin-bottom: 10px; overflow: hidden; box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.explorer-pane .grp h4 {
  margin: 0; padding: 5px 8px; font-size: 11px; color: #0c327d;
  background: linear-gradient(#e9f0fb, #d3e0f5);
  cursor: default;
}
.explorer-pane .grp .links { padding: 5px 8px; display: flex; flex-direction: column; gap: 5px; }
.explorer-pane .grp .links a { color: #0c327d; text-decoration: none; display: flex; gap: 6px; align-items: center; }
.explorer-pane .grp .links a:hover { color: #1a5fd0; text-decoration: underline; }
.explorer-pane .grp .links img { width: 16px; height: 16px; }

/* file view */
.explorer-view {
  flex: 1; overflow: auto; background: #fff; padding: 8px;
  display: flex; flex-wrap: wrap; align-content: flex-start; gap: 4px;
}
.file-icon {
  width: 82px; padding: 6px 4px;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  border: 1px solid transparent; border-radius: 2px; text-align: center;
}
.file-icon .ico { width: 32px; height: 32px; }
.file-icon .name { font-size: 11px; line-height: 1.15; color: #000; word-break: break-word; padding: 0 2px; }
.file-icon:hover { background: #eaf1fc; border-color: #cbdcf3; }
.file-icon.selected { background: #cddef5; border-color: #a9c6ec; }
.file-icon.selected .name { background: #316ac5; color: #fff; border-radius: 1px; }

/* list view variant */
.explorer-view.list { flex-direction: column; flex-wrap: nowrap; gap: 0; }
.explorer-view.list .file-icon { flex-direction: row; width: 100%; justify-content: flex-start; gap: 8px; padding: 3px 6px; }
.explorer-view.list .file-icon .ico { width: 16px; height: 16px; }

/* ---------- notepad ---------- */
.notepad { display: flex; flex-direction: column; height: 100%; }
.notepad textarea {
  flex: 1;
  border: 1px solid #7f9db9;
  margin: 0; padding: 4px 6px;
  font-family: "Lucida Console", "Courier New", monospace;
  font-size: 12px;
  resize: none;
  outline: none;
  white-space: pre;
  overflow: auto;
  background: #fff;
}
.notepad textarea.wrap { white-space: pre-wrap; }

/* ---------- internet explorer ---------- */
.iexplore { display: flex; flex-direction: column; height: 100%; }
.ie-bar { display: flex; align-items: center; gap: 6px; padding: 4px 6px; border-bottom: 1px solid #dcdcdc; }
.ie-bar .addr { flex: 1; height: 20px; border: 1px solid #7f9db9; padding: 1px 6px; font-size: 11px; }
.iexplore iframe { flex: 1; border: none; width: 100%; background: #fff; }
.ie-home { padding: 30px; height: 100%; overflow: auto; background: #fff; font-size: 13px; color: #222; }
.ie-home h1 { color: #003399; }
.ie-home a { color: #0645ad; }

/* ---------- image viewer ---------- */
.imgview { display: flex; flex-direction: column; height: 100%; background: #5a5a5a; }
.imgview .stage { flex: 1; display: flex; align-items: center; justify-content: center; overflow: auto; padding: 10px; }
.imgview .stage img { max-width: 100%; max-height: 100%; box-shadow: 0 0 8px rgba(0,0,0,.6); background: #fff; }
.imgview .bar { flex: 0 0 auto; display: flex; justify-content: center; gap: 6px; padding: 5px; background: linear-gradient(#eef2f7,#dfe6ef); }

/* ---------- media player ---------- */
.mediaplayer { display: flex; flex-direction: column; height: 100%; background: #1a2a45; color: #cfe0ff; }
.mediaplayer .screen { flex: 1; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.mediaplayer .screen video, .mediaplayer .screen audio { max-width: 100%; max-height: 100%; }
.mediaplayer .viz { text-align: center; }
.mediaplayer .viz .disc { font-size: 46px; animation: spin 3s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.mediaplayer .ctrls { flex: 0 0 auto; padding: 8px; background: linear-gradient(#3a5b8f,#22375c); text-align: center; }

/* ---------- pdf / acrobat ---------- */
.pdfview { display: flex; flex-direction: column; height: 100%; }
.pdfview iframe, .pdfview embed { flex: 1; border: none; width: 100%; }

/* ---------- generic centered dialogs ---------- */
.dialog-pad { padding: 14px; display: flex; gap: 14px; }
.dialog-pad .d-ico { width: 40px; height: 40px; flex: 0 0 auto; }
.dialog-pad .d-body { font-size: 11px; line-height: 1.5; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 8px 12px; }

/* ---------- minesweeper ---------- */
.mines { padding: 8px; background: #c0c0c0; user-select: none; }
.mines .hud { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; border: 2px inset #fff; padding: 4px 6px; }
.mines .counter { background: #000; color: #f00; font-family: "Lucida Console", monospace; font-weight: bold; padding: 1px 4px; font-size: 18px; letter-spacing: 1px; }
.mines .face { font-size: 18px; width: 30px; height: 30px; border: 2px outset #fff; background: #c0c0c0; cursor: default; }
.mines .grid { display: grid; gap: 0; border: 3px inset #fff; background: #808080; }
.mines .cell {
  width: 20px; height: 20px; border: 2px outset #fff; background: #c0c0c0;
  display: flex; align-items: center; justify-content: center;
  font-weight: bold; font-size: 13px; font-family: Tahoma, sans-serif; cursor: default;
}
.mines .cell.open { border: 1px solid #9a9a9a; background: #bdbdbd; }
.mines .cell.mine { background: #f00; }
.mines .c1 { color: #0000ff; } .mines .c2 { color: #008000; } .mines .c3 { color: #ff0000; }
.mines .c4 { color: #000080; } .mines .c5 { color: #800000; } .mines .c6 { color: #008080; }
.mines .c7 { color: #000; } .mines .c8 { color: #808080; }
