/* ==========================================================================
   MHENT WORKSPACE - COMPONENTS & UI ELEMENTS (V1.0)
   ========================================================================== */

/* ==========================================
   1. BUTTONS & CONTROLS
   ========================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 700;
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition-fast);
  white-space: nowrap;
}
.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 12px var(--primary-glow);
}
.btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: 0 6px 16px var(--primary-glow);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-surface-elevated);
  border-color: var(--border-subtle);
  color: var(--text-medium);
}
.btn-secondary:hover {
  background: var(--bg-surface-hover);
  color: var(--text-high);
  border-color: var(--border-medium);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
}
.btn-ghost:hover {
  background: var(--bg-surface-hover);
  color: var(--text-high);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.3);
}
.btn-danger:hover {
  background: #ef4444;
  color: white;
}

.btn-icon {
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: var(--radius-sm);
}

/* ==========================================
   2. FORM INPUTS & SELECTS
   ========================================== */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}
.form-label {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}
.input-text, .input-select, .input-textarea {
  background: var(--bg-glass-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 9px 13px;
  font-size: 14px;
  color: var(--text-high);
  outline: none;
  transition: var(--transition-fast);
}
.input-text:focus, .input-select:focus, .input-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
  background: var(--bg-surface);
}
.input-textarea {
  min-height: 80px;
  resize: vertical;
}

/* ==========================================
   3. COMMAND PALETTE (CTRL + K)
   ========================================== */
#command-palette-overlay {
  position: fixed;
  inset: 0;
  background: rgba(7, 9, 14, 0.75);
  backdrop-filter: blur(12px);
  z-index: 1000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 15vh;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-fast);
}
#command-palette-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.command-palette-box {
  width: 100%;
  max-width: 580px;
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg), 0 0 40px var(--primary-glow);
  overflow: hidden;
  transform: translateY(-10px) scale(0.97);
  transition: transform var(--transition-bounce);
}
#command-palette-overlay.open .command-palette-box {
  transform: translateY(0) scale(1);
}

.command-search-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
}
.command-search-header svg {
  color: var(--primary);
  flex-shrink: 0;
}
.command-search-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-high);
}

.command-results-list {
  max-height: 360px;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.command-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text-medium);
  transition: var(--transition-fast);
}
.command-item:hover, .command-item.selected {
  background: var(--primary-light);
  color: var(--primary);
}
.command-item-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.command-item-icon {
  font-size: 16px;
  width: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.command-item-title {
  font-size: 14px;
  font-weight: 700;
}
.command-item-meta {
  font-size: 11px;
  color: var(--text-muted);
}

.command-footer {
  padding: 10px 18px;
  background: var(--bg-surface-elevated);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
}

/* ==========================================
   4. MODAL DIALOGS
   ========================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(7, 9, 14, 0.7);
  backdrop-filter: blur(10px);
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-fast);
  padding: 20px;
}
.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  width: 100%;
  max-width: 520px;
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  transform: scale(0.94);
  transition: transform var(--transition-bounce);
}
.modal-overlay.open .modal-card {
  transform: scale(1);
}

.modal-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-title {
  font-size: 17px;
  font-weight: 800;
  color: var(--text-high);
}
.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
}
.modal-close-btn:hover {
  color: var(--text-high);
  background: var(--bg-surface-hover);
}

.modal-body {
  padding: 22px;
  max-height: 70vh;
  overflow-y: auto;
}

.modal-footer {
  padding: 14px 22px;
  background: var(--bg-surface-elevated);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

/* ==========================================
   5. TOAST NOTIFICATION CONTAINER
   ========================================== */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 2000;
  pointer-events: none;
}

.workspace-toast {
  pointer-events: auto;
  min-width: 280px;
  max-width: 380px;
  background: var(--bg-glass-strong);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-medium);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  box-shadow: var(--shadow-md);
  animation: fadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.workspace-toast.success { border-left-color: var(--app-drive); }
.workspace-toast.error { border-left-color: #ef4444; }
.workspace-toast.warning { border-left-color: var(--app-todo); }
.workspace-toast.info { border-left-color: var(--app-chat); }

.toast-icon {
  font-size: 18px;
  flex-shrink: 0;
}
.toast-content {
  flex: 1;
}
.toast-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-high);
  margin-bottom: 2px;
}
.toast-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* ==========================================
   6. BADGES & CHIPS
   ========================================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 800;
}
.badge-primary { background: var(--primary-light); color: var(--primary); }
.badge-success { background: rgba(16, 185, 129, 0.15); color: #10b981; }
.badge-warning { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.badge-danger { background: rgba(239, 68, 68, 0.15); color: #ef4444; }
.badge-purple { background: rgba(168, 85, 247, 0.15); color: #a855f7; }
