﻿/* ========================================
   KYSTENO - Bulk Operations Styles (Build 30)
   ======================================== */

/* ── Bulk Action Bar (fixed bottom) ─────────────────────────── */
#bulkActionBar {
  position: fixed;
  bottom: -72px;
  left: 280px; /* sidebar width */
  right: 0;
  height: 56px;
  background: var(--card-bg, #fff);
  border-top: 2px solid var(--primary);
  box-shadow: 0 -4px 20px rgba(79, 70, 229, 0.15);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  z-index: 900;
  transition: bottom 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#bulkActionBar.active {
  bottom: 0;
}

.bulk-bar-count {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  white-space: nowrap;
  min-width: 90px;
}

.bulk-bar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.bulk-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--border, #e2e8f0);
  background: var(--bg, #f8fafc);
  color: var(--text, #1e293b);
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}

.bulk-btn:hover {
  background: var(--hover-bg, #f1f5f9);
  border-color: var(--border-hover, var(--border));
  transform: translateY(-1px);
}

.bulk-btn-danger {
  color: #dc2626;
  border-color: #fecaca;
  background: #fff5f5;
}

.bulk-btn-danger:hover {
  background: #fee2e2;
  border-color: #f87171;
}

.bulk-bar-cancel {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: var(--hover-bg, #f1f5f9);
  color: var(--text-muted, #94a3b8);
  cursor: pointer;
  margin-left: auto;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
}

.bulk-bar-cancel:hover {
  background: #fee2e2;
  color: #dc2626;
}

/* ── Bulk checkboxes in sidebar tree ─────────────────────────── */
.bulk-cb {
  width: 15px;
  height: 15px;
  margin-right: 4px;
  flex-shrink: 0;
  cursor: pointer;
  accent-color: var(--primary);
  border-radius: 3px;
}

/* ── Bulk Select button in sidebar footer ────────────────────── */
.bulk-select-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--border, #e2e8f0);
  background: transparent;
  color: var(--text-muted, #64748b);
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.bulk-select-btn:hover,
.bulk-select-btn.active {
  background: #f0fdfa;
  color: var(--primary);
  border-color: var(--primary);
}

/* ── Folder view checkboxes ──────────────────────────────────── */
.folder-page-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0 !important;
}

/* Breathing room around all content inside the folder view
   (title, page list, repository panel, related-decisions panel) */
#folderView {
  padding: 24px 32px;
}

/* Same breathing room for the gutter sections that appear under a
   folder/page view (Recent Activity, Repository, Related Decisions),
   so they don't hug the left border of the section. */
#gutterAuditSection,
#gutterCommitsSection,
#gutterDecisionsSection {
  padding-left: 32px;
  padding-right: 32px;
}

.folder-select-all-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 8px;
  border-bottom: 1px solid var(--border, #e2e8f0);
  margin-bottom: 4px;
  font-size: 12px;
  color: var(--text-muted);
}

/* ── Modal shared base ───────────────────────────────────────── */
.bulk-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 1100;
  display: none;
  align-items: center;
  justify-content: center;
}

.bulk-overlay.active {
  display: flex;
}

.bulk-modal {
  background: var(--card-bg, #fff);
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  width: 460px;
  max-width: 94vw;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.bulk-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border, #e2e8f0);
}

.bulk-modal-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.bulk-modal-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted, #94a3b8);
  padding: 4px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.bulk-modal-close:hover {
  background: var(--hover-bg, #f1f5f9);
  color: var(--text, #1e293b);
}

.bulk-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
}

.bulk-modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid var(--border, #e2e8f0);
}

.bulk-modal-footer .btn {
  padding: 8px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--border, #e2e8f0);
  transition: background 0.15s, transform 0.1s;
}

.bulk-modal-footer .btn-secondary {
  background: var(--card-bg, #f8fafc);
  color: var(--text, #1e293b);
}

.bulk-modal-footer .btn-secondary:hover {
  background: var(--sidebar-hover, #f1f5f9);
}

.dark-mode .bulk-modal-footer .btn-secondary {
  background: #1E293B;
  color: #E2E8F0;
  border-color: #334155;
}

.dark-mode .bulk-modal-footer .btn-secondary:hover {
  background: #334155;
}

.bulk-modal-footer .btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.bulk-modal-footer .btn-primary:hover:not(:disabled) {
  background: #0f9688;
  transform: translateY(-1px);
}

.bulk-modal-footer .btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.bulk-modal-footer .btn-danger {
  background: #dc2626;
  color: #fff;
  border-color: #dc2626;
}

.bulk-modal-footer .btn-danger:hover {
  background: #b91c1c;
}

/* ── Move modal — folder tree picker ─────────────────────────── */
.bulk-picker-item {
  display: flex;
  align-items: center;
  padding: 8px 10px;
  border-radius: 7px;
  cursor: pointer;
  font-size: 13px;
  transition: background 0.15s;
  margin-bottom: 2px;
}

.bulk-picker-item:hover {
  background: var(--hover-bg, #f1f5f9);
}

.bulk-picker-item.selected {
  background: #f0fdfa;
  color: var(--primary);
  font-weight: 500;
  outline: 1px solid var(--primary);
}

/* ── Tag modal ───────────────────────────────────────────────── */
.bulk-tag-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 4px;
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.1s;
}

.bulk-tag-row:hover {
  background: var(--hover-bg, #f1f5f9);
}

.bulk-tag-chip {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}

.bulk-tag-new-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border, #e2e8f0);
}

.bulk-tag-new-row input {
  flex: 1;
  padding: 7px 10px;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 7px;
  font-size: 13px;
  background: var(--bg, #f8fafc);
  color: var(--text, #1e293b);
  outline: none;
  transition: border-color 0.15s;
}

.bulk-tag-new-row input:focus {
  border-color: var(--primary);
}

/* ── Delete modal — item list ────────────────────────────────── */
.bulk-delete-list {
  max-height: 240px;
  overflow-y: auto;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 8px;
  padding: 6px;
  margin-top: 10px;
}

.bulk-delete-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 5px;
  font-size: 13px;
}

.bulk-delete-item:nth-child(even) {
  background: var(--hover-bg, #f8fafc);
}

.bulk-delete-warning {
  font-size: 13px;
  color: var(--text-muted, #64748b);
  margin: 0 0 4px;
}

.bulk-delete-warning strong {
  color: #dc2626;
}

/* ── Export modal ────────────────────────────────────────────── */
.bulk-export-formats {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}

.bulk-export-fmt-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.bulk-export-fmt-row:hover {
  background: var(--hover-bg, #f1f5f9);
}

.bulk-export-fmt-row input[type="radio"] {
  margin-top: 2px;
  accent-color: var(--primary);
  flex-shrink: 0;
}

.bulk-export-fmt-row input[type="radio"]:checked ~ .bulk-fmt-info {
  color: var(--primary);
}

.bulk-fmt-info strong {
  display: block;
  font-size: 13px;
  font-weight: 600;
}

.bulk-fmt-info span {
  font-size: 12px;
  color: var(--text-muted, #94a3b8);
}

/* ── Dark mode adjustments ───────────────────────────────────── */
.dark-mode #bulkActionBar {
  background: var(--card-bg);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.4);
}

.dark-mode .bulk-modal {
  background: var(--card-bg);
}

.dark-mode .bulk-picker-item {
  color: var(--text);
}

.dark-mode .bulk-picker-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.dark-mode .bulk-picker-item.selected {
  background: rgba(129, 140, 248, 0.18);
  color: #A5B4FC;
  outline-color: #818CF8;
}

.dark-mode .bulk-export-fmt-row {
  border-color: rgba(255, 255, 255, 0.1);
  color: #E2E8F0;
}

.dark-mode .bulk-export-fmt-row:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.2);
}

.dark-mode .bulk-export-fmt-row input[type="radio"]:checked ~ .bulk-fmt-info {
  color: #A5B4FC;
}

.dark-mode .bulk-fmt-info span {
  color: #94A3B8;
}

/* ── Mobile adjustments ──────────────────────────────────────── */
@media (max-width: 768px) {
  #bulkActionBar {
    left: 0;
    flex-wrap: wrap;
    height: auto;
    padding: 10px 14px;
    gap: 8px;
  }

  .bulk-bar-actions {
    flex-wrap: wrap;
  }

  .bulk-btn {
    font-size: 12px;
    padding: 5px 10px;
  }
}
/* Ensure notification bell wrapper doesn't get squeezed */
.notif-bell-wrapper {
  flex: 0 0 auto !important;
  width: 36px;
}

.notif-bell-wrapper .user-action-btn {
  width: 36px !important;
}

/* ── Workspace Export modal ──────────────────────────────────── */
.ws-export-lockout-note {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin-top: 14px;
  padding: 10px 12px;
  background: var(--hover-bg, #f0fdf4);
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  font-size: 12px;
  color: #166534;
  line-height: 1.5;
}

.ws-export-format-note {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin-top: 14px;
  padding: 10px 12px;
  background: var(--hover-bg, #eff6ff);
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  font-size: 12px;
  color: #1e40af;
  line-height: 1.5;
}

.dark-mode .ws-export-format-note {
  background: rgba(147, 197, 253, 0.08);
  border-color: rgba(147, 197, 253, 0.25);
  color: #93c5fd;
}

.dark-mode .ws-export-lockout-note {
  background: rgba(134, 239, 172, 0.08);
  border-color: rgba(134, 239, 172, 0.25);
  color: #86efac;
}

.bulk-modal-footer .btn-primary i {
  vertical-align: middle;
  margin-right: 4px;
}