/**
 * SprayWallView Styles
 *
 * Phase 7.0 - Foundation
 * Phase 7.4a - Desktop/Mobile layout switching
 */

.spray-wall-view {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  overflow: hidden;
  background: var(--bg-primary, #fff);
}

/* Desktop variant */
.spray-wall-view--desktop {
  background: var(--editor-bg, #1a1a2e);
}

/* Mobile variant */
.spray-wall-view--mobile {
  background: var(--bg-primary, #fff);
}

.spray-wall-view__header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color, #e0e0e0);
  background: var(--bg-primary, #fff);
  flex-shrink: 0;
}

.spray-wall-view__back-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 12px;
  border: none;
  border-radius: 8px;
  background: var(--bg-secondary, #f5f5f5);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary, #333);
  transition: background 0.2s, transform 0.1s;
}

.spray-wall-view__back-btn:hover {
  background: var(--bg-tertiary, #e8e8e8);
}

.spray-wall-view__back-btn:active {
  transform: scale(0.98);
}

.spray-wall-view__back-arrow {
  font-size: 16px;
}

.spray-wall-view__title {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
  color: var(--text-primary, #333);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.spray-wall-view__content {
  flex: 1;
  overflow: hidden;
  position: relative;
}

/* Ensure SprayWallManager fills the container */
.spray-wall-view__content > div {
  height: 100%;
}

/* Dark mode support */
[data-theme="dark"] .spray-wall-view,
[data-theme="dark"] .spray-wall-view--mobile {
  background: var(--bg-primary, #1a1a1a);
}

[data-theme="dark"] .spray-wall-view__header {
  background: var(--bg-primary, #1a1a1a);
  border-color: var(--border-color, #333);
}

[data-theme="dark"] .spray-wall-view__back-btn {
  background: var(--bg-secondary, #2a2a2a);
  color: var(--text-primary, #fff);
}

[data-theme="dark"] .spray-wall-view__back-btn:hover {
  background: var(--bg-tertiary, #3a3a3a);
}

[data-theme="dark"] .spray-wall-view__title {
  color: var(--text-primary, #fff);
}

/* ============================================
   MOBILE LAYOUT (Phase 7.5)
   BottomSheet pattern - same as GymMapEditor
   ============================================ */

.spray-wall-view--mobile-layout {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  overflow: hidden;
  background: var(--editor-bg, #0f0f1a);
}

/* Canvas container - takes remaining space above sheet */
.spray-wall-view__canvas-mobile {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1;
  transition: height 0.3s ease-out;
  background: var(--editor-bg, #0f0f1a);
}

/* FAB - Floating Action Button for Add Boulder */
.spray-wall-view__fab {
  position: fixed;
  z-index: 95;
  transition: bottom 0.3s ease-out, opacity 0.2s;
}

.spray-wall-view__fab--hidden {
  opacity: 0;
  pointer-events: none;
}

/* Phase 10: Follow CTA FAB */
.spray-wall-view__fab--follow {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border: none;
  border-radius: 24px;
  background: linear-gradient(135deg, #ff6b6b 0%, #ee5a5a 100%);
  color: white;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(255, 107, 107, 0.4);
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}

.spray-wall-view__fab--follow:hover:not(:disabled) {
  background: linear-gradient(135deg, #ff5252 0%, #e04848 100%);
  transform: scale(1.05);
  box-shadow: 0 6px 16px rgba(255, 107, 107, 0.5);
}

.spray-wall-view__fab--follow:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

/* Phase 10: Login CTA FAB */
.spray-wall-view__fab--login {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border: none;
  border-radius: 24px;
  background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
  color: white;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(108, 117, 125, 0.4);
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}

.spray-wall-view__fab--login:hover {
  background: linear-gradient(135deg, #5a6268 0%, #495057 100%);
  transform: scale(1.05);
  box-shadow: 0 6px 16px rgba(108, 117, 125, 0.5);
}

/* FAB text label */
.spray-wall-view__fab-text {
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
}

/* Loading state */
.spray-wall-view__fab-loading {
  font-size: 14px;
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Ensure modals appear above everything */
.spray-wall-view--mobile-layout .boulder-modal,
.spray-wall-view--mobile-layout .focus-mode-modal,
.spray-wall-view--mobile-layout .quick-send-sheet,
.spray-wall-view--mobile-layout .flag-modal {
  z-index: 2000;
}

/* Mobile bottom nav override - hide save button for SprayWall */
.spray-wall-view--mobile-layout .studio-mobile-nav__btn--save {
  display: none;
}

/* Mobile loading overlay */
.spray-wall-view__loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
}

/* Navigation arrows for collapsed mode */
.spray-wall-view__nav-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  border: none;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 15;
  cursor: pointer;
}

.spray-wall-view__nav-arrow--prev {
  left: 12px;
}

.spray-wall-view__nav-arrow--next {
  right: 12px;
}

.spray-wall-view__nav-arrow:active {
  background: rgba(0, 0, 0, 0.7);
}

/* ============================================
   MOBILE HEADER (Phase 7.6)
   SmartBreadcrumbs in fixed header
   ============================================ */

.spray-wall-view__mobile-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 48px;
  z-index: 95;
  display: flex;
  align-items: center;
  padding: 0 12px;
  background: linear-gradient(
    to bottom,
    rgba(15, 15, 26, 0.95) 0%,
    rgba(15, 15, 26, 0.8) 70%,
    transparent 100%
  );
  padding-top: env(safe-area-inset-top, 0);
}

/* Adjust canvas to account for header */
.spray-wall-view--mobile-layout .spray-wall-view__canvas-mobile {
  top: 48px;
}

/* Account for safe area on notched devices */
@supports (padding-top: env(safe-area-inset-top)) {
  .spray-wall-view__mobile-header {
    height: calc(48px + env(safe-area-inset-top, 0));
    padding-top: env(safe-area-inset-top, 0);
  }

  .spray-wall-view--mobile-layout .spray-wall-view__canvas-mobile {
    top: calc(48px + env(safe-area-inset-top, 0));
  }
}

/* ============================================
   MOBILE FILTER OVERLAY (Phase 7.6)
   ============================================ */

.spray-wall-view__mobile-filter-overlay {
  position: fixed;
  bottom: 60px; /* Above bottom nav */
  left: 0;
  right: 0;
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

/* Override FilterDropdown positioning for mobile overlay */
.spray-wall-view__mobile-filter-overlay .filter-dropdown {
  position: relative;
  top: auto;
  right: auto;
  width: 100%;
  max-width: 100%;
  max-height: 70vh;
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
}

/* Backdrop for mobile filter */
.spray-wall-view__mobile-filter-overlay .filter-dropdown__backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 60px;
  background: rgba(0, 0, 0, 0.5);
  z-index: -1;
}
