/* Window Manager */
.window {
  position: absolute;
  min-width: 320px; min-height: 200px;
  background: var(--window-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 32px var(--shadow);
  overflow: hidden;
  animation: windowOpen 0.2s ease;
  z-index: 100;
}

@keyframes windowOpen {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.window.maximized {
  border-radius: 0 !important;
  top: 0 !important; left: 0 !important;
  width: 100% !important; height: calc(100% - 48px) !important;
}

.window-titlebar {
  display: flex; align-items: center;
  padding: 0 12px; height: 40px;
  background: var(--window-title);
  cursor: default;
}

.window-title {
  flex: 1; font-size: 13px; font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  display: flex; align-items: center; gap: 8px;
}

.window-controls { display: flex; gap: 6px; }
.window-controls button {
  width: 14px; height: 14px; border-radius: 50%;
  border: none; cursor: pointer; transition: all 0.2s;
  font-size: 0; display: flex; align-items: center; justify-content: center;
}
.window-close { background: #ff5f57; }
.window-close:hover { background: #ff3b30; }
.window-minimize { background: #febc2e; }
.window-minimize:hover { background: #f5a623; }
.window-maximize { background: #28c840; }
.window-maximize:hover { background: #1dbd34; }

.window-content {
  height: calc(100% - 40px);
  overflow: auto;
}

.window.active {
  z-index: 500;
  border-color: var(--accent);
}

/* App-specific styles */

/* File Manager */
.fm-toolbar {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 10px; border-bottom: 1px solid var(--border);
  background: var(--bg-secondary);
  flex-wrap: wrap;
}
.fm-toolbar button {
  padding: 6px 10px; background: transparent; color: var(--text);
  border: 1px solid var(--border); border-radius: 6px; cursor: pointer;
  font-size: 12px; transition: all 0.2s;
  display: flex; align-items: center; gap: 4px;
  white-space: nowrap;
}
.fm-toolbar button:hover { background: var(--border); }
.fm-toolbar button:disabled { opacity: 0.35; cursor: default; }
.fm-toolbar button:disabled:hover { background: transparent; }

.fm-path {
  flex: 1; min-width: 100px; padding: 6px 10px; background: var(--bg);
  border: 1px solid var(--border); border-radius: 6px;
  color: var(--text-secondary); font-size: 12px;
  cursor: default; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.fm-body {
  height: calc(100% - 46px);
  overflow: auto;
}

.fm-grid {
  display: grid; grid-template-columns: repeat(auto-fill, 90px);
  gap: 4px; padding: 12px; align-content: start;
}

.fm-item {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  width: 90px; height: 80px; padding: 8px; border-radius: 6px;
  cursor: pointer; transition: all 0.2s;
}
.fm-item:hover { background: rgba(255,255,255,0.08); }
.fm-item.selected { background: rgba(233, 69, 96, 0.2); border: 1px solid var(--accent); }
.fm-item i { font-size: 28px; margin-bottom: 4px; pointer-events: none; }
.fm-item span { font-size: 11px; text-align: center; word-break: break-word; max-width: 82px; pointer-events: none; }

.fm-empty {
  grid-column: 1 / -1; text-align: center; padding: 40px;
  color: var(--text-secondary); font-size: 14px;
}

.fm-context-menu {
  background: var(--window-bg); border: 1px solid var(--border);
  border-radius: 8px; padding: 4px; min-width: 140px;
  box-shadow: 0 4px 16px var(--shadow);
}
.fm-cm-item {
  padding: 8px 12px; font-size: 13px; border-radius: 4px;
  cursor: pointer; display: flex; align-items: center; gap: 8px;
  transition: background 0.15s;
}
.fm-cm-item:hover { background: rgba(255,255,255,0.08); }
.fm-cm-item i { width: 16px; text-align: center; color: var(--accent); }

/* Document Editor */
.editor-toolbar {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; border-bottom: 1px solid var(--border);
  background: var(--bg-secondary);
}
.editor-toolbar input {
  flex: 1; padding: 6px 10px; background: var(--bg);
  border: 1px solid var(--border); border-radius: 6px;
  color: var(--text); font-size: 14px; outline: none;
}
.editor-toolbar button {
  padding: 6px 14px; background: var(--accent); color: white;
  border: none; border-radius: 6px; cursor: pointer; font-size: 13px;
  font-weight: 500; transition: background 0.2s;
}
.editor-toolbar button:hover { background: var(--accent-hover); }

.editor-body {
  height: calc(100% - 48px);
}
.editor-body textarea {
  width: 100%; height: 100%; padding: 16px;
  background: var(--bg); color: var(--text);
  border: none; outline: none; resize: none;
  font-family: 'Cascadia Code', 'Fira Code', 'Consolas', monospace;
  font-size: 14px; line-height: 1.6;
}

/* Reporter */
.reporter-container { padding: 20px; }
.reporter-container h2 { margin-bottom: 16px; font-size: 18px; }
.reporter-form { display: flex; flex-direction: column; gap: 12px; }

.reporter-form select,
.reporter-form input,
.reporter-form textarea {
  padding: 10px 14px; background: var(--bg);
  border: 1px solid var(--border); border-radius: 8px;
  color: var(--text); font-size: 14px; outline: none;
}
.reporter-form textarea { min-height: 120px; resize: vertical; font-family: inherit; }
.reporter-form select option { background: var(--window-bg); }

.reporter-form button {
  padding: 10px; background: var(--accent); color: white;
  border: none; border-radius: 8px; font-size: 14px; cursor: pointer;
  font-weight: 600; transition: background 0.2s;
}
.reporter-form button:hover { background: var(--accent-hover); }

.reporter-list { margin-top: 20px; }
.reporter-list h3 { margin-bottom: 8px; font-size: 14px; color: var(--text-secondary); }
.reporter-item {
  padding: 10px 14px; background: var(--bg); border: 1px solid var(--border);
  border-radius: 8px; margin-bottom: 8px;
}
.reporter-item .ri-title { font-weight: 500; font-size: 14px; }
.reporter-item .ri-meta { font-size: 12px; color: var(--text-secondary); margin-top: 4px; }
.reporter-item .ri-type { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 11px; margin-right: 6px; }
.ri-type.bug { background: rgba(231, 76, 60, 0.2); color: var(--danger); }
.ri-type.suggestion { background: rgba(46, 204, 113, 0.2); color: var(--success); }
.ri-type.feedback { background: rgba(243, 156, 18, 0.2); color: var(--warning); }

/* Settings */
.settings-container { padding: 20px; }
.settings-container h2 { margin-bottom: 16px; font-size: 18px; }

.settings-section {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 10px; padding: 16px; margin-bottom: 16px;
}
.settings-section h3 { font-size: 15px; margin-bottom: 12px; }

.plan-card {
  border: 1px solid var(--border); border-radius: 10px;
  padding: 16px; text-align: center; transition: all 0.2s;
}
.plan-card.current { border-color: var(--accent); background: rgba(233, 69, 96, 0.1); }
.plan-card h4 { font-size: 16px; margin-bottom: 4px; }
.plan-card .price { font-size: 24px; font-weight: 700; margin: 8px 0; }
.plan-card .price small { font-size: 14px; font-weight: 400; color: var(--text-secondary); }
.plan-card ul { list-style: none; margin: 12px 0; }
.plan-card ul li { padding: 4px 0; font-size: 13px; color: var(--text-secondary); }
.plan-card ul li i { margin-right: 6px; }
.plan-card button {
  padding: 8px 24px; background: var(--accent); color: white;
  border: none; border-radius: 6px; cursor: pointer; font-weight: 500;
  transition: background 0.2s;
}
.plan-card button:hover { background: var(--accent-hover); }
.plan-card button.current-btn { background: var(--border); cursor: default; }

.plans-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
}

/* Document List */
.doc-list-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 16px;
}
.doc-list-new-btn {
  padding: 8px 16px; background: var(--accent); color: white;
  border: none; border-radius: 6px; cursor: pointer; font-size: 13px;
  font-weight: 500; transition: background 0.2s;
}
.doc-list-new-btn:hover { background: var(--accent-hover); }

.doc-list { display: flex; flex-direction: column; gap: 6px; }
.doc-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 10px 12px; background: var(--bg);
  border: 1px solid var(--border); border-radius: 8px;
  cursor: pointer; transition: all 0.2s;
}
.doc-item:hover { border-color: var(--accent); background: rgba(233,69,96,0.05); }
.doc-item-icon { font-size: 22px; color: var(--accent); padding-top: 2px; }
.doc-item-info { flex: 1; min-width: 0; }
.doc-item-title { font-weight: 500; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-item-preview { font-size: 12px; color: var(--text-secondary); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-item-meta { font-size: 11px; color: var(--text-secondary); margin-top: 4px; }
.doc-item-actions { display: flex; gap: 4px; align-items: center; }
.doc-del-btn {
  padding: 4px 8px; background: transparent; color: var(--danger);
  border: 1px solid transparent; border-radius: 4px; cursor: pointer; font-size: 13px;
  transition: all 0.2s;
}
.doc-del-btn:hover { background: rgba(231,76,60,0.15); border-color: var(--danger); }

/* Editor status bar */
#editor-status { flex-shrink: 0; }

/* Report Tabs */
.rep-tabs {
  display: flex; gap: 0; margin-bottom: 16px;
  border: 1px solid var(--border); border-radius: 8px; overflow: hidden;
}
.rep-tab {
  flex: 1; padding: 8px 12px; background: transparent; color: var(--text-secondary);
  border: none; cursor: pointer; font-size: 13px; transition: all 0.2s;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.rep-tab:hover { background: rgba(255,255,255,0.05); }
.rep-tab.active { background: var(--accent); color: white; }

.rep-admin-filters {
  display: flex; gap: 8px; margin-bottom: 12px;
}
.rep-admin-filters select {
  flex: 1; padding: 8px 10px; background: var(--bg);
  border: 1px solid var(--border); border-radius: 6px;
  color: var(--text); font-size: 13px; outline: none;
}

.rep-status-select {
  padding: 4px 8px; background: var(--bg);
  border: 1px solid var(--border); border-radius: 4px;
  color: var(--text); font-size: 12px; outline: none;
}

/* Terminal */
.terminal-body {
  background: #0a0a1a; height: 100%; padding: 12px;
  font-family: 'Cascadia Code', 'Fira Code', 'Consolas', monospace;
  font-size: 13px; color: #33ff33; overflow-y: auto;
}
.terminal-line { white-space: pre-wrap; word-break: break-all; }
.terminal-input-line { display: flex; align-items: center; }
.terminal-prompt { color: #33ff33; margin-right: 8px; }
.terminal-input {
  flex: 1; background: transparent; border: none; color: #33ff33;
  font-family: inherit; font-size: 13px; outline: none;
}
