/* ═══════════════════════════════════════
   DuOSc — APP INTERIORS & OVERLAYS
   Context menus, toasts, app windows
   ═══════════════════════════════════════ */

/* ═══════ APP MENU (XFCE Style) ═══════ */
.app-menu {
  position: fixed; top: 32px; left: 4px;
  width: 320px;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 4px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.5);
  display: flex;
  backdrop-filter: blur(10px);
  z-index: 10000;
  animation: menuFadeIn 0.1s ease;
}

@keyframes menuFadeIn {
  from { opacity: 0; transform: translateY(-5px); }
  to   { opacity: 1; transform: translateY(0); }
}

.app-menu-sidebar {
  width: 40px;
  background: rgba(0,0,0,0.2);
  border-right: 1px solid rgba(255,255,255,0.05);
  display: flex; flex-direction: column; justify-content: flex-end; align-items: center;
  padding: 10px 0;
}

.sidebar-user {
  font-family: var(--font-ui); font-size: 12px; color: var(--text-muted);
  writing-mode: vertical-rl; transform: rotate(180deg);
}

.app-menu-content {
  flex: 1; padding: 10px;
}

.menu-category {
  font-family: var(--font-ui); font-size: 12px; text-transform: uppercase;
  color: var(--text-muted); margin-bottom: 8px; padding-left: 8px;
}

.app-menu-item {
  display: flex; align-items: center; gap: 12px;
  width: 100%; padding: 12px;
  background: transparent; border: none; border-radius: 4px;
  color: var(--text-main); font-family: var(--font-ui); font-size: 16px;
  cursor: pointer; text-align: left;
}

.app-menu-item:hover {
  background: var(--accent); color: #000;
}
.app-menu-item:hover .menu-icon, .app-menu-item:hover .menu-icon path { fill: #000 !important; stroke: #000 !important; }
.app-menu-item:hover .menu-icon rect { fill: #000 !important; }
.menu-icon { width: 24px; height: 24px; }

/* ═══════ CONTEXT MENU ═══════ */
.context-menu {
  position: fixed;
  min-width: 220px;
  background: var(--bg-raised);
  border: 1px solid var(--border-mid);
  border-radius: 8px;
  padding: 6px;
  z-index: 9500;
  animation: fadeIn 0.1s ease;
  box-shadow: 0 12px 36px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.05);
}

.ctx-item {
  display: block; width: 100%;
  padding: 9px 12px;
  background: transparent;
  border: none;
  border-left: 2px solid transparent;
  border-radius: 5px;
  color: var(--text-secondary);
  font-family: var(--font-display);
  font-size: 11px;
  text-align: left;
  cursor: pointer;
  transition: all 0.1s;
}

.ctx-item:hover {
  background: var(--green-glow);
  color: var(--green);
  border-left-color: var(--green);
}

.ctx-divider {
  border: none;
  border-top: 1px solid var(--border-dim);
  margin: 4px 0;
}

/* ═══════ CVE FOOTER ═══════ */
.cve-footer {
  position: fixed;
  bottom: 52px; right: 12px;
  z-index: 100;
}

.cve-footer-btn {
  background: transparent;
  border: none;
  font-family: var(--font-display);
  font-size: 9px;
  color: var(--red);
  cursor: pointer;
  opacity: 0.4;
  transition: opacity 0.2s;
  letter-spacing: 1px;
}

.cve-footer-btn:hover { opacity: 1; }

/* ═══════ TOASTS ═══════ */
.toast-container {
  position: fixed; top: 20px; right: 20px;
  z-index: 9900;
  display: flex; flex-direction: column; gap: 8px;
}

.toast {
  width: 300px;
  padding: 12px 16px;
  background: var(--bg-raised);
  border: 1px solid var(--border-mid);
  border-left: 3px solid var(--green);
  border-radius: 6px;
  color: var(--green);
  font-family: var(--font-display);
  font-size: 12px;
  animation: toastIn 0.3s cubic-bezier(0.34,1.56,0.64,1), fadeOut 0.3s ease 2.7s forwards;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

@keyframes toastIn {
  from { transform: translateX(100px); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}

@keyframes fadeOut {
  to { opacity: 0; transform: translateY(-10px); }
}

/* ═══════ SCAN OVERLAY ═══════ */
.scan-overlay {
  position: fixed; inset: 0;
  background: rgba(6,8,15,0.9);
  display: flex; align-items: center; justify-content: center;
  z-index: 9600;
}

.scan-content { width: 500px; max-width: 90%; }

.scan-title {
  font-family: var(--font-display);
  font-size: 12px;
  color: var(--green);
  margin-bottom: 16px;
  letter-spacing: 2px;
}

.scan-progress-track {
  height: 2px; background: var(--border-dim);
  border-radius: 1px; overflow: hidden;
  margin-bottom: 16px;
}

.scan-progress-bar {
  height: 100%; width: 0%;
  background: var(--green);
  transition: width 0.15s;
}

.scan-log {
  font-size: 11px; color: var(--text-dim);
  line-height: 1.8;
  max-height: 200px; overflow-y: auto;
  font-family: var(--font-mono);
}

/* ═══════ SCREENSAVER ═══════ */
.screensaver {
  position: fixed; inset: 0;
  background: #030507;
  z-index: 9990;
  cursor: pointer;
}

.matrix-canvas { width: 100%; height: 100%; }

.screensaver-hint {
  position: absolute;
  bottom: 30px; width: 100%;
  text-align: center;
  font-family: var(--font-display);
  font-size: 10px;
  color: rgba(57,217,138,0.2);
  letter-spacing: 2px;
}

/* ═══════════════════════════════════════
   APP-SPECIFIC INTERIOR STYLES
   ═══════════════════════════════════════ */

/* ── Section Headers (all apps) ── */
.dossier-section h3,
.briefing-section h3,
.comms-channels h3 {
  font-family: var(--font-display);
  font-size: 9px;
  color: var(--text-dim);
  letter-spacing: 4px;
  text-transform: uppercase;
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-dim);
  display: flex; align-items: center; gap: 8px;
}

.dossier-section h3::before,
.briefing-section h3::before,
.comms-channels h3::before {
  content: '';
  width: 4px; height: 4px;
  background: var(--green);
  flex-shrink: 0;
}

/* ── DOSSIER ── */
.dossier-stamp {
  position: absolute; top: 20px; right: 24px;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 400;
  color: rgba(239,68,68,0.12);
  transform: rotate(12deg);
  letter-spacing: 6px;
  pointer-events: none;
  border: 2px solid rgba(239,68,68,0.12);
  padding: 4px 16px;
}

.dossier-section { margin-bottom: 24px; }

.redacted {
  background: var(--text-primary);
  color: var(--text-primary);
  padding: 0 6px;
  border-radius: 2px;
  cursor: default;
}

.hidden-text {
  color: var(--bg-surface);
  font-size: 1px;
  line-height: 0;
  position: absolute;
  overflow: hidden;
}

/* ── INCIDENTS ── */
.incidents-split {
  display: flex; gap: 0;
  height: 100%;
  margin: -24px;
}

.incidents-list {
  width: 280px;
  border-right: 1px solid var(--border-dim);
  overflow-y: auto;
  flex-shrink: 0;
  background: rgba(0,0,0,0.15);
}

.incident-item {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(26,37,53,0.5);
  cursor: pointer;
  transition: background 0.1s;
  border-left: 2px solid transparent;
}

.incident-item:hover, .incident-item.active {
  background: var(--green-glow);
  border-left-color: var(--green);
}

.incident-id {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--blue);
}

.incident-name {
  font-family: var(--font-ui);
  font-size: 12px;
  margin-top: 2px;
  color: var(--text-primary);
}

.severity-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 3px;
  font-family: var(--font-display);
  font-size: 9px;
  letter-spacing: 1px;
  margin-top: 4px;
}

.severity-critical { background: var(--red-dim); color: var(--red); border: 1px solid rgba(239,68,68,0.25); }
.severity-high { background: var(--amber-dim); color: var(--amber); border: 1px solid rgba(245,158,11,0.25); }
.severity-medium { background: var(--blue-dim); color: var(--blue); border: 1px solid rgba(59,130,246,0.25); }

.incident-detail {
  flex: 1; padding: 24px; overflow-y: auto;
}

.incident-detail h2 {
  font-family: var(--font-mono);
  font-size: 15px;
  color: var(--green);
  margin-bottom: 16px;
}

.detail-grid {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 8px;
  font-size: 13px;
  margin-bottom: 20px;
}

.detail-label {
  color: var(--text-dim);
  font-family: var(--font-display);
  font-size: 10px;
  letter-spacing: 1px;
}

.detail-value { color: var(--text-secondary); font-family: var(--font-ui); }

.evidence-link {
  color: var(--blue);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 12px;
  transition: color 0.15s;
}

.evidence-link:hover { text-decoration: underline; }

/* ── TTPs GRID ── */
.ttps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.ttp-category {
  background: rgba(0,0,0,0.2);
  border: 1px solid var(--border-dim);
  border-radius: 8px;
  padding: 16px;
}

.ttp-category h3 {
  font-family: var(--font-display);
  font-size: 10px;
  margin-bottom: 14px;
  letter-spacing: 2px;
  display: flex; align-items: center; gap: 8px;
}

.ttp-category h3::before {
  content: '';
  width: 4px; height: 4px;
}

.ttp-category.offensive h3 { color: var(--red); }
.ttp-category.offensive h3::before { background: var(--red); }
.ttp-category.defensive h3 { color: var(--blue); }
.ttp-category.defensive h3::before { background: var(--blue); }

.ttp-skill {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 10px;
}

.ttp-name {
  font-family: var(--font-ui);
  font-size: 12px;
  min-width: 120px;
  color: var(--text-secondary);
}

.ttp-bar-track {
  flex: 1; height: 3px;
  background: rgba(255,255,255,0.04);
  border-radius: 2px;
  overflow: hidden;
}

.ttp-bar { height: 100%; border-radius: 2px; transition: width 1s ease; }

.offensive .ttp-bar { background: var(--red); }
.defensive .ttp-bar { background: var(--blue); }

.ttp-pct {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-dim);
  min-width: 32px;
  text-align: right;
}

/* ── COMMS / CONTACT ── */
.comms-form { max-width: 480px; }

.comms-field { margin-bottom: 16px; }

.comms-field label {
  display: block;
  font-family: var(--font-display);
  font-size: 9px;
  color: var(--text-dim);
  letter-spacing: 3px;
  margin-bottom: 6px;
}

.comms-field input, .comms-field textarea {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-inset);
  border: 1px solid var(--border-dim);
  border-radius: 6px;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.comms-field textarea {
  min-height: 120px;
  resize: vertical;
  font-family: var(--font-ui);
}

.comms-field input:focus, .comms-field textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(57,217,138,0.08);
}

.comms-submit {
  padding: 12px 24px;
  background: transparent;
  border: 1px solid var(--green);
  border-radius: 6px;
  color: var(--green);
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: 2px;
  cursor: pointer;
  transition: all 0.2s;
}

.comms-submit:hover { background: var(--green-glow); }
.comms-submit:active { transform: scale(0.98); }

.comms-channels {
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid var(--border-dim);
}

.channel-link {
  display: inline-block;
  padding: 6px 14px;
  margin: 4px;
  border: 1px solid var(--border-dim);
  border-radius: 6px;
  color: var(--text-secondary);
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 11px;
  transition: all 0.15s;
}

.channel-link:hover {
  border-color: var(--green);
  color: var(--green);
  background: var(--green-glow);
}

/* ── TERMINAL ── */
.terminal-body {
  background: #030507 !important;
  padding: 0 !important;
  font-family: var(--font-mono) !important;
  font-size: 13px !important;
  display: flex !important;
  flex-direction: column !important;
}

/* Terminal status bar */
.terminal-body::before {
  content: 'saket@duosc  ~  bash  80×24';
  display: block;
  padding: 4px 12px;
  background: rgba(0,0,0,0.4);
  font-family: var(--font-display);
  font-size: 10px;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border-dim);
  flex-shrink: 0;
}

.terminal-output {
  white-space: pre-wrap;
  color: var(--text-secondary);
  line-height: 1.7;
  text-shadow: 0 0 8px rgba(57,217,138,0.2);
  padding: 12px 16px;
  flex: 1;
  overflow-y: auto;
}

.terminal-output .prompt-text { color: var(--green); }
.terminal-output .cmd-text { color: var(--text-primary); }
.terminal-output .output-text { color: var(--text-secondary); }
.terminal-output .error-text { color: var(--red); text-shadow: 0 0 6px rgba(239,68,68,0.25); }

.terminal-input-line {
  display: flex; align-items: center; gap: 0;
  padding: 4px 16px 12px;
}

.terminal-prompt {
  color: var(--green);
  white-space: pre;
  text-shadow: 0 0 8px rgba(57,217,138,0.2);
}

.terminal-input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 13px;
  outline: none;
  caret-color: var(--green);
  text-shadow: 0 0 8px rgba(57,217,138,0.15);
}

/* ── BRIEFING / RESUME ── */
.briefing-header {
  text-align: center;
  padding: 20px 0 30px;
  border-bottom: 1px solid var(--border-dim);
  margin-bottom: 24px;
}

.briefing-header h1 {
  font-family: var(--font-display);
  font-size: 10px;
  color: var(--red);
  letter-spacing: 4px;
  margin-bottom: 16px;
}

.briefing-header h2 {
  font-family: var(--font-ui);
  font-size: 24px;
  font-weight: 500;
  color: var(--text-primary);
}

.briefing-header p {
  color: var(--text-dim);
  font-family: var(--font-ui);
  font-size: 13px;
  margin-top: 6px;
}

.briefing-section { margin-bottom: 28px; }

.briefing-download {
  display: inline-block;
  padding: 10px 20px;
  border: 1px solid var(--blue);
  border-radius: 6px;
  color: var(--blue);
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 1px;
  transition: all 0.2s;
  margin-top: 12px;
}

.briefing-download:hover {
  background: var(--blue-dim);
}

/* ── PROPERTIES ── */
.props-grid {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 8px 16px;
  font-size: 13px;
  font-family: var(--font-ui);
}

.props-label {
  color: var(--text-dim);
  font-family: var(--font-display);
  font-size: 10px;
  letter-spacing: 1px;
}

/* ═══════ MOBILE RESPONSIVE ═══════ */
@media (max-width: 768px) {
  .desktop-icons {
    flex-direction: row; flex-wrap: wrap;
    justify-content: center;
    top: 10px; left: 10px; right: 10px;
    max-height: none;
  }

  .desktop-icon { width: 76px; }
  .file-icon { width: 34px; height: 40px; }
  .file-badge { font-size: 7px; }

  .app-window {
    position: fixed !important;
    top: 0 !important; left: 0 !important;
    width: 100% !important;
    height: calc(100% - 48px) !important;
    border-radius: 0;
    min-width: unset;
  }

  .incidents-split { flex-direction: column; }
  .incidents-list {
    width: 100%; max-height: 200px;
    border-right: none;
    border-bottom: 1px solid var(--border-dim);
  }

  .taskbar-right { min-width: auto; gap: 6px; }
  .start-text { display: none; }
  .tray-item#battery-indicator { display: none; }
  .tray-divider:nth-of-type(3) { display: none; }

  .ttps-grid { grid-template-columns: 1fr; }
}
