/* Constellation - Recipe Pool Page Styles */
/* US-3.1: Recipe List (Blades) */
/* US-3.2: Recipe Preview (Viewfinder) */
/* US-3.3: Fetch Pool Action */

/* === POOL LAYOUT === */
.pool-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-6);
  height: calc(100vh - 140px);
}

@media (max-width: 1024px) {
  .pool-container {
    grid-template-columns: 1fr;
    height: auto;
  }
}

/* === DATA FEED (Left Panel - Recipe List) === */
.data-feed {
  display: flex;
  flex-direction: column;
  background-color: var(--panel-grey);
  border: var(--border-standard);
  overflow: hidden;
}

.feed-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  border-bottom: var(--border-standard);
  background-color: rgba(0, 0, 0, 0.2);
}

.feed-title {
  font-family: var(--font-heading);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--cyber-cyan);
}

.feed-count {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--dimmed-grey);
}

.feed-count strong {
  color: var(--system-white);
}

.feed-actions {
  padding: var(--space-3) var(--space-4);
  border-bottom: var(--border-standard);
  display: flex;
  gap: var(--space-3);
}

.feed-list {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-2) 0;
}

/* === RECIPE BLADE (List Item) === */
.recipe-blade {
  position: relative;
  padding: var(--space-3) var(--space-4);
  padding-left: calc(var(--space-4) + 8px);
  border-bottom: 1px solid rgba(69, 162, 158, 0.2);
  cursor: pointer;
  transition: background-color var(--transition-fast);
}

.recipe-blade:hover {
  background-color: rgba(102, 252, 241, 0.05);
}

.recipe-blade:hover::before {
  content: ">";
  position: absolute;
  left: var(--space-3);
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--cyber-cyan);
}

.recipe-blade.selected {
  background-color: rgba(255, 165, 0, 0.1);
}

.recipe-blade.selected::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 3px;
  height: 100%;
  background-color: var(--selection-orange);
}

.recipe-blade.active {
  background-color: rgba(102, 252, 241, 0.1);
}

.blade-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 24px;
}

.blade-checkbox {
  appearance: none;
  width: 24px;
  height: 24px;
  border: var(--border-standard);
  background-color: var(--deep-void);
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
}

.blade-checkbox:checked {
  background-color: var(--selection-orange);
  border-color: var(--selection-orange);
}

.blade-checkbox:checked::after {
  content: "X";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 700;
  color: var(--deep-void);
}

.blade-number {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--dimmed-grey);
  min-width: 24px;
}

.blade-name {
  font-family: var(--font-heading);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--system-white);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.blade-meta {
  display: flex;
  gap: var(--space-3);
  margin-top: var(--space-1);
  margin-left: calc(24px + var(--space-3) + 24px + var(--space-3));
}

.blade-tag {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  text-transform: uppercase;
  color: var(--dimmed-grey);
}

.blade-tag.diet {
  color: var(--cyber-cyan);
}

/* === VISUAL FEED (Right Panel - Preview) === */
.visual-feed {
  display: flex;
  flex-direction: column;
  background-color: var(--panel-grey);
  border: var(--border-standard);
}

/* Hide drawer handle on desktop */
.drawer-handle {
  display: none;
}

.viewfinder-header {
  padding: var(--space-3) var(--space-4);
  border-bottom: var(--border-standard);
  background-color: rgba(0, 0, 0, 0.2);
}

.viewfinder-title {
  font-family: var(--font-heading);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--cyber-cyan);
}

.viewfinder-content {
  flex: 1;
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
}

/* === IMAGE CONTAINER WITH CORNER BRACKETS === */
.viewfinder-image-container {
  position: relative;
  aspect-ratio: 16 / 10;
  background-color: var(--deep-void);
  border: var(--border-standard);
  overflow: hidden;
}

.viewfinder-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Scanline overlay */
.viewfinder-image-container::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.1) 2px,
    rgba(0, 0, 0, 0.1) 4px
  );
  pointer-events: none;
  z-index: 1;
  opacity: 0.5;
}

/* Corner brackets */
.corner-bracket {
  position: absolute;
  width: 20px;
  height: 20px;
  border-color: var(--dimmed-grey);
  border-style: solid;
  z-index: 2;
}

.corner-bracket.top-left {
  top: 8px;
  left: 8px;
  border-width: 2px 0 0 2px;
}

.corner-bracket.top-right {
  top: 8px;
  right: 8px;
  border-width: 2px 2px 0 0;
}

.corner-bracket.bottom-left {
  bottom: 8px;
  left: 8px;
  border-width: 0 0 2px 2px;
}

.corner-bracket.bottom-right {
  bottom: 8px;
  right: 8px;
  border-width: 0 2px 2px 0;
}

/* === RECIPE METADATA === */
.viewfinder-meta {
  margin-top: var(--space-4);
  flex: 1;
}

.meta-row {
  display: flex;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}

.meta-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--dimmed-grey);
  min-width: 60px;
}

.meta-value {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--system-white);
}

.meta-value.highlight {
  color: var(--cyber-cyan);
}

/* === VIEWFINDER ACTIONS === */
.viewfinder-actions {
  display: flex;
  gap: var(--space-3);
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: var(--border-standard);
}

.viewfinder-actions .btn {
  flex: 1;
}

/* === EMPTY STATE === */
.viewfinder-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--dimmed-grey);
  text-align: center;
}

.viewfinder-empty-icon {
  font-family: var(--font-mono);
  font-size: 2rem;
  margin-bottom: var(--space-4);
}

.viewfinder-empty-text {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
}

/* === MOBILE: BOTTOM DRAWER === */
@media (max-width: 1024px) {
  .visual-feed {
    display: none;
  }

  .visual-feed.drawer-open {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 70vh;
    z-index: 200;
    border-radius: 16px 16px 0 0;
    animation: drawer-slide-up 0.3s ease;
    overflow: hidden;
  }

  /* Prevent drawer content from intercepting backdrop clicks */
  .visual-feed.drawer-open .viewfinder-content {
    overflow-y: auto;
    max-height: calc(70vh - 80px);
  }

  .visual-feed.drawer-open .viewfinder-image-container {
    pointer-events: auto;
  }

  @keyframes drawer-slide-up {
    from {
      transform: translateY(100%);
    }
    to {
      transform: translateY(0);
    }
  }

  .drawer-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 199;
    cursor: pointer;
  }

  .drawer-backdrop.visible {
    display: block;
  }

  /* Drawer handle - now visible */
  .drawer-handle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-2) var(--space-4);
    background-color: rgba(0, 0, 0, 0.3);
    border-bottom: var(--border-standard);
  }

  .drawer-handle-bar {
    width: 40px;
    height: 4px;
    background-color: var(--dimmed-grey);
    border-radius: 2px;
  }

  .drawer-close-btn {
    background: none;
    border: var(--border-standard);
    padding: var(--space-2) var(--space-3);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--dimmed-grey);
    cursor: pointer;
    transition: all var(--transition-fast);
  }

  .drawer-close-btn:hover {
    color: var(--alert-red);
    border-color: var(--alert-red);
  }
}

/* === LOADING STATE === */
.feed-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-8);
  color: var(--dimmed-grey);
}

.feed-loading-spinner {
  width: 24px;
  height: 24px;
  border: 2px solid var(--dimmed-grey);
  border-top-color: var(--cyber-cyan);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: var(--space-4);
}

.feed-loading-text {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
}

/* === SELECTION SUMMARY === */
.selection-summary {
  padding: var(--space-3) var(--space-4);
  background-color: rgba(0, 0, 0, 0.2);
  border-top: var(--border-standard);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.selection-count {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--dimmed-grey);
}

.selection-count strong {
  color: var(--selection-orange);
}
