/**
 * WallPreviewPanel.css
 *
 * Left panel styles for wall/boulder image preview
 * Phase 7.4b - UI Enhancements (colors, no box, nav counter, inline arrow)
 */

.wall-preview-panel {
  flex: 1;
  min-width: 0;
  position: relative;
  background: #0d0d1a;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  /* FIX 5: Performance hints for smooth resizing */
  will-change: transform;
  contain: layout;
}

.wall-preview-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* Empty state */
.wall-preview-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.5);
  gap: 12px;
}

.wall-preview-empty .empty-icon {
  font-size: 48px;
  opacity: 0.5;
}

.wall-preview-empty p {
  margin: 0;
  font-size: 14px;
}

/* Boulder info overlay - base gradient (no box) */
.boulder-info-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 16px 20px;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.9) 0%,
    rgba(0, 0, 0, 0.7) 40%,
    rgba(0, 0, 0, 0.3) 70%,
    transparent 100%
  );
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  z-index: 10;
}

/* Wall info overlay - when no boulder selected */
.boulder-info-overlay--wall {
  justify-content: center;
  text-align: center;
}

.boulder-info-overlay--wall .boulder-info-content {
  align-items: center;
}

.wall-hint {
  margin: 4px 0 0 0;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.6);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.boulder-count {
  margin-top: 8px;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
  background: rgba(185, 255, 102, 0.15);
  border: 1px solid rgba(185, 255, 102, 0.3);
  color: rgba(255, 255, 255, 0.9);
}

/* Boulder info overlay - when boulder selected (no box) */
.boulder-info-overlay--boulder {
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}

/* ========================================
   New Boulder Info Structure (Phase 7.4b)
   ======================================== */

.wall-preview-panel__boulder-info {
  cursor: pointer;
}

.wall-preview-panel__boulder-info:hover .wall-preview-panel__boulder-name {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Boulder name - larger, with arrow inline */
.wall-preview-panel__boulder-name {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 6px 0;
  font-size: 22px;
  font-weight: 600;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.wall-preview-panel__grade {
  padding: 4px 10px;
  border-radius: 6px;
  background: var(--rumble-green, #B9FF66);
  color: #1c2024;
  font-size: 13px;
  font-weight: 600;
}

.wall-preview-panel__enter-hint {
  display: inline-flex;
  align-items: center;
  color: var(--rumble-green, #B9FF66);
  margin-left: 4px;
}

/* Setter meta */
.wall-preview-panel__meta {
  margin: 0 0 8px 0;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* Stats - clean row */
.wall-preview-panel__stats {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
}

.wall-preview-panel__stat {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.8);
}

.wall-preview-panel__stat--likes svg {
  color: #ff4d6d;
}

.wall-preview-panel__stat--sends svg {
  color: var(--rumble-green, #B9FF66);
}

/* Action buttons */
.wall-preview-panel__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.wall-preview-panel__action-btn {
  padding: 8px 14px;
  border: none;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  color: var(--text-primary, #fff);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.wall-preview-panel__action-btn:hover {
  background: rgba(255, 255, 255, 0.25);
}

.wall-preview-panel__action-btn--icon {
  padding: 8px 10px;
  font-size: 16px;
}

/* Like button - always red */
.wall-preview-panel__action-btn--like {
  color: #ff4d6d;
}

.wall-preview-panel__action-btn--like:hover {
  background: rgba(255, 77, 109, 0.15);
}

.wall-preview-panel__action-btn--like.active {
  background: rgba(255, 77, 109, 0.2);
  color: #ff4d6d;
}

/* Bookmark/Wishlist button - purple (not green) */
.wall-preview-panel__action-btn--bookmark {
  color: var(--primary-color, #7c3aed);
}

.wall-preview-panel__action-btn--bookmark:hover {
  background: rgba(124, 58, 237, 0.15);
}

.wall-preview-panel__action-btn--bookmark.active {
  background: rgba(124, 58, 237, 0.2);
  color: var(--primary-color, #7c3aed);
}

/* Log Send button */
.wall-preview-panel__action-btn--send {
  background: rgba(255, 255, 255, 0.15);
}

.wall-preview-panel__action-btn--send.active {
  background: var(--rumble-green, #B9FF66);
  color: #1c2024;
}

/* Edit button - purple accent */
.wall-preview-panel__action-btn--edit {
  color: var(--primary-color, #9747ff);
}

.wall-preview-panel__action-btn--edit:hover {
  background: rgba(151, 71, 255, 0.15);
}

/* Expand button - green accent */
.wall-preview-panel__action-btn--expand {
  background: rgba(185, 255, 102, 0.15);
  border: 1px solid rgba(185, 255, 102, 0.3);
}

.wall-preview-panel__action-btn--expand:hover {
  background: rgba(185, 255, 102, 0.25);
  border-color: rgba(185, 255, 102, 0.5);
}

/* Navigation counter - bottom right corner */
.boulder-nav-counter {
  position: absolute;
  bottom: 16px;
  right: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  border-radius: 20px;
  z-index: 15;
}

.boulder-nav-counter .nav-btn {
  padding: 6px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  width: auto;
  height: auto;
}

.boulder-nav-counter .nav-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.2);
}

.boulder-nav-counter .nav-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.boulder-nav-counter .nav-counter {
  font-size: 13px;
  color: #fff;
  font-weight: 500;
  min-width: 50px;
  text-align: center;
}

/* ========================================
   Legacy Classes (kept for compatibility)
   ======================================== */

.boulder-info-card {
  cursor: pointer;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0;
}

.boulder-info-card:hover .boulder-name {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.boulder-info-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 4px;
}

.boulder-info-title {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.boulder-info-title .boulder-name {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.boulder-info-title .boulder-grade {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  color: white;
}

.boulder-enter-hint {
  display: inline-flex;
  align-items: center;
  color: var(--rumble-green, #B9FF66);
  opacity: 0.9;
}

.boulder-setter {
  margin: 0 0 12px 0;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.8);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.boulder-stats {
  color: rgba(255, 255, 255, 0.6);
}

.boulder-stats svg {
  vertical-align: middle;
  margin-right: 2px;
}

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

.boulder-action-btn {
  padding: 8px 14px;
  border: none;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  color: var(--text-primary, #fff);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.boulder-action-btn:hover {
  background: rgba(255, 255, 255, 0.25);
}

.boulder-action-btn--icon {
  padding: 8px 10px;
  font-size: 16px;
}

.boulder-action-btn--like {
  color: #ff4d6d;
}

.boulder-action-btn--like:hover {
  background: rgba(255, 77, 109, 0.15);
}

.boulder-action-btn--like.active {
  background: rgba(255, 77, 109, 0.2);
  color: #ff4d6d;
}

.boulder-action-btn--bookmark {
  color: var(--primary-color, #7c3aed);
}

.boulder-action-btn--bookmark:hover {
  background: rgba(124, 58, 237, 0.15);
}

.boulder-action-btn--bookmark.active {
  background: rgba(124, 58, 237, 0.2);
  color: var(--primary-color, #7c3aed);
}

.boulder-action-btn--send {
  background: rgba(255, 255, 255, 0.15);
}

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

.boulder-action-btn--expand {
  background: rgba(185, 255, 102, 0.15);
  border: 1px solid rgba(185, 255, 102, 0.3);
}

.boulder-action-btn--expand:hover {
  background: rgba(185, 255, 102, 0.25);
  border-color: rgba(185, 255, 102, 0.5);
}

/* Legacy navigation controls */
.boulder-nav {
  display: none;
}

.boulder-info-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.boulder-info-content .boulder-name {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.boulder-info-content .boulder-grade {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  background: var(--rumble-green, #B9FF66);
  color: #1c2024;
  width: fit-content;
}

.boulder-info-content .boulder-setter {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .wall-preview-panel__enter-hint,
  .boulder-enter-hint {
    animation: none;
  }
}

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

@media (max-width: 960px) {
  /* Fill parent container (spray-wall-view__canvas-mobile) */
  .wall-preview-panel {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    height: 100%;
    z-index: 1;
    border-radius: 0;
    border: none;
  }

  /* Canvas container fills panel */
  .wall-preview-canvas {
    width: 100%;
    height: 100%;
  }

  /* Fabric.js canvas wrapper - ensure it fills container */
  .wall-preview-panel .canvas-container {
    width: 100% !important;
    height: 100% !important;
  }

  /* Smooth height transitions when sheet changes */
  .wall-preview-panel--animating {
    transition: height 0.3s ease-out;
  }

  /* Boulder info overlay - positioned above sheet */
  .boulder-info-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10;
    padding: 12px 16px;  /* Reduced top/bottom padding from 16px to 12px */
    padding-bottom: calc(64px + env(safe-area-inset-bottom, 0));
    background: linear-gradient(
      to top,
      rgba(0, 0, 0, 0.92) 0%,
      rgba(0, 0, 0, 0.75) 50%,
      transparent 100%
    );
  }

  /* Boulder name - mobile sizing */
  .wall-preview-panel__boulder-name {
    font-size: 18px;
    gap: 8px;
  }

  .wall-preview-panel__grade {
    font-size: 12px;
    padding: 3px 8px;
  }

  .wall-preview-panel__meta {
    font-size: 13px;
    margin-bottom: 6px;
  }

  /* Stats row */
  .wall-preview-panel__stats {
    gap: 12px;
    margin-bottom: 10px;
  }

  .wall-preview-panel__stat {
    font-size: 13px;
  }

  /* Action buttons - larger touch targets */
  .wall-preview-panel__actions {
    gap: 10px;
  }

  .wall-preview-panel__action-btn {
    min-width: 44px;
    min-height: 44px;
    padding: 10px 16px;
    font-size: 14px;
    border-radius: 10px;
  }

  .wall-preview-panel__action-btn--icon {
    padding: 10px 12px;
    font-size: 18px;
  }

  /* Navigation arrows - visible when sheet collapsed */
  .wall-preview-panel__nav-btn {
    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;
    transition: background 0.2s;
  }

  .wall-preview-panel__nav-btn--prev {
    left: 12px;
  }

  .wall-preview-panel__nav-btn--next {
    right: 12px;
  }

  .wall-preview-panel__nav-btn:active {
    background: rgba(0, 0, 0, 0.7);
  }

  /* Navigation counter - HIDE on mobile (user sees list, doesn't need counter) */
  .boulder-nav-counter {
    display: none;
  }

  /* Empty state */
  .wall-preview-empty {
    padding: 24px;
  }

  .wall-preview-empty .empty-icon {
    font-size: 40px;
  }

  .wall-preview-empty p {
    font-size: 13px;
  }
}

/* Small phones */
@media (max-width: 375px) {
  .wall-preview-panel__boulder-name {
    font-size: 16px;
  }

  .wall-preview-panel__action-btn {
    padding: 8px 12px;
    font-size: 13px;
  }

  /* boulder-nav-counter already hidden on mobile - no need for positioning */
}
