/**
 * BoulderSidebar.css
 *
 * Right sidebar styles for boulder list
 * Search/filters now in header (SprayWallHeader)
 *
 * Phase 7.4b - UI Enhancements
 */

.boulder-sidebar {
  width: 320px;
  min-width: 250px;
  max-width: 500px;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--bg-secondary, rgb(33, 37, 41));
  border-left: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
  overflow: hidden;
  position: relative; /* For resize handle positioning */
}

/* Phase 7.4c: Resize handle */
.boulder-sidebar__resize-handle {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  cursor: ew-resize;
  background: transparent;
  transition: background 0.2s ease;
  z-index: 10;
}

.boulder-sidebar__resize-handle:hover,
.boulder-sidebar__resize-handle:active {
  background: var(--primary-color, #9747ff);
}

/* Header */
.boulder-sidebar__header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px;
  border-bottom: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
}

.boulder-sidebar__header h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary, #fff);
}

.boulder-sidebar__count {
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--rumble-green, #B9FF66);
  color: black;
  font-size: 12px;
  font-weight: 800;
}

/* Phase 7.4c: Bulk Actions Toolbar */
.bulk-actions-toolbar {
  position: sticky;
  top: 0;
  background: rgba(13, 13, 26, 0.95);
  backdrop-filter: blur(8px);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(151, 71, 255, 0.3);
  z-index: 10;
}

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

.bulk-actions-toolbar__select-all {
  background: transparent;
  border: none;
  padding: 4px;
  color: var(--primary-color, #9747ff);
  cursor: pointer;
  display: flex;
  align-items: center;
  font-size: 18px;
}

.bulk-actions-toolbar__select-all:hover {
  color: var(--primary-hover, #8637ef);
}

.selection-count {
  font-weight: 600;
  font-size: 14px;
  color: #fff;
}

.bulk-actions {
  display: flex;
  gap: 8px;
}

.bulk-action-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s;
}

.bulk-action-btn--danger {
  background: rgba(211, 47, 47, 0.15);
  color: #ff4d6d;
}

.bulk-action-btn--danger:hover {
  background: rgba(211, 47, 47, 0.25);
}

.bulk-actions-toolbar__clear {
  background: transparent;
  border: none;
  padding: 6px;
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  display: flex;
  align-items: center;
  font-size: 16px;
  transition: color 0.2s;
}

.bulk-actions-toolbar__clear:hover {
  color: #fff;
}

/* Boulder list */
.boulder-sidebar__list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

.boulder-sidebar__list::-webkit-scrollbar {
  width: 6px;
}

.boulder-sidebar__list::-webkit-scrollbar-track {
  background: transparent;
}

.boulder-sidebar__list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}

.boulder-sidebar__list::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* Loading state */
.boulder-sidebar__loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  gap: 12px;
  color: var(--text-secondary, rgba(255, 255, 255, 0.5));
  font-size: 13px;
}

/* Empty state */
.boulder-sidebar__empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  text-align: center;
}

.boulder-sidebar__empty p {
  margin: 0;
  color: var(--text-secondary, rgba(255, 255, 255, 0.5));
  font-size: 14px;
}

/* Footer with add button */
.boulder-sidebar__footer {
  padding: 12px;
  border-top: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
}

.boulder-sidebar__add-btn {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 8px;
  background: var(--primary-color, #7c3aed);
  color: white;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.boulder-sidebar__add-btn:hover {
  background: var(--primary-color-hover, #6d28d9);
}

/* CTA Overlay for Follow Required */
.boulder-sidebar__cta-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.boulder-sidebar__cta-modal {
  background: var(--bg-secondary, #1e2227);
  border: 1px solid var(--border-color, #333);
  border-radius: 12px;
  padding: 24px;
  max-width: 320px;
  text-align: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.boulder-sidebar__cta-modal h3 {
  margin: 0 0 12px 0;
  font-size: 18px;
  color: var(--text-primary, #fff);
}

.boulder-sidebar__cta-modal p {
  margin: 0 0 20px 0;
  font-size: 14px;
  color: var(--text-secondary, #8b949e);
  line-height: 1.5;
}

.boulder-sidebar__cta-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.boulder-sidebar__cta-btn {
  padding: 12px 16px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.boulder-sidebar__cta-btn--primary {
  background: var(--rumble-green, #B9FF66);
  color: #1c2024;
}

.boulder-sidebar__cta-btn--primary:hover {
  background: #a8e85c;
}

.boulder-sidebar__cta-btn--secondary {
  background: transparent;
  color: var(--text-secondary, #8b949e);
  border: 1px solid var(--border-color, #333);
}

.boulder-sidebar__cta-btn--secondary:hover {
  color: var(--text-primary, #fff);
  border-color: var(--text-primary, #fff);
}

/* ============================================
   MOBILE ADAPTATIONS
   Phase 7.5 - Mobile SprayWallView
   ============================================ */

@media (max-width: 960px) {
  /* Force full width in BottomSheet context */
  .boulder-sidebar {
    width: 100% !important;
    min-width: unset !important;
    max-width: unset !important;
    height: 100%;
    border-left: none;
    border-radius: 0;
  }

  /* Hide desktop resize handle */
  .boulder-sidebar__resize-handle {
    display: none !important;
  }

  /* Adjust header padding for mobile */
  .boulder-sidebar__header {
    padding: 12px 16px;
    gap: 8px;
  }

  /* List container fills available space */
  .boulder-sidebar__list {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 8px 8px;
    padding-bottom: env(safe-area-inset-bottom, 0);
  }

  /* Bulk actions toolbar - sticky at top */
  .bulk-actions-toolbar {
    position: sticky;
    top: 0;
    z-index: 10;
    background: rgba(13, 13, 26, 0.98);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 8px 12px;
  }

  .bulk-action-btn {
    min-height: 40px;
    padding: 8px 16px;
  }

  /* Empty state */
  .boulder-sidebar__empty {
    padding: 32px 24px;
  }

  /* Loading state */
  .boulder-sidebar__loading {
    padding: 24px;
  }

  /* Hide footer on mobile - SprayWallMobileNav has the Add button */
  .boulder-sidebar__footer {
    display: none;
  }

  /* CTA modal adjustments */
  .boulder-sidebar__cta-modal {
    margin: 16px;
    max-width: calc(100% - 32px);
  }

  .boulder-sidebar__cta-btn {
    min-height: 48px;
    font-size: 15px;
  }
}

/* Small phones (iPhone SE, etc.) */
@media (max-width: 375px) {
  .boulder-sidebar__header {
    padding: 8px 12px;
  }

  .boulder-sidebar__list {
    padding: 6px 10px;
  }

  .boulder-sidebar__empty {
    padding: 24px 16px;
  }
}
