/**
 * Mission Board CSS
 * Cyberpunk contract board aesthetic
 */

.mission-board-container {
  padding: 20px;
  height: 100%;
  max-height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  background: #050500; /* Very dark yellow-black tint */
  font-family: "Courier New", monospace;
  /* Ensure scrolling works */
  -webkit-overflow-scrolling: touch;
}

.mission-section {
  margin-bottom: 30px;
}

.section-header {
  color: #ffcc00;
  border-bottom: 1px solid #ffcc00;
  padding-bottom: 5px;
  margin-bottom: 15px;
  font-family: "Courier New", monospace;
  letter-spacing: 1px;
  font-size: 1.1rem;
}

.empty-msg {
  color: #555;
  font-style: italic;
  margin-bottom: 20px;
  padding: 20px;
  text-align: center;
}

/* ACTIVE MISSIONS */
.mission-section {
  margin-bottom: 30px;
}

/* Grid layout for active missions */
.active-missions-grid {
  display: grid;
  grid-template-columns: 1fr; /* Stack on mobile */
  gap: 15px;
}

@media (min-width: 768px) {
  .active-missions-grid {
    grid-template-columns: repeat(2, 1fr); /* 2-col on tablet */
  }
}

@media (min-width: 1200px) {
  .active-missions-grid {
    grid-template-columns: repeat(3, 1fr); /* 3-col on desktop */
  }
}

.active-card {
  border: 1px dashed #0f0;
  background: rgba(0, 255, 0, 0.05);
  padding: 15px;
  margin-bottom: 0; /* Remove margin, use grid gap instead */
  transition: all 0.2s ease;
  position: relative;
  min-width: 0; /* Allow grid to shrink */
  max-width: 100%; /* Prevent overflow */
}

.active-card:hover {
  background: rgba(0, 255, 0, 0.1);
  border-color: #0f0;
  box-shadow: 0 0 10px rgba(0, 255, 0, 0.3);
  transform: translateY(-2px);
}

.active-card:active {
  transform: translateY(0);
  box-shadow: 0 0 5px rgba(0, 255, 0, 0.2);
}

.active-card:focus {
  outline: 2px solid #0f0;
  outline-offset: 2px;
}

.continue-hint {
  margin-top: 10px;
  font-size: 0.85rem;
  color: #0f0;
  opacity: 0.7;
  text-align: center;
  animation: pulse-hint 2s infinite;
}

@keyframes pulse-hint {
  0%,
  100% {
    opacity: 0.7;
  }
  50% {
    opacity: 1;
  }
}

.blink-tag {
  color: #0f0;
  animation: blink 1s infinite;
  margin-right: 10px;
  font-weight: bold;
}

@keyframes blink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.3;
  }
}

.mission-dest {
  color: #0f0;
  font-weight: bold;
  float: right;
}

.mission-title {
  color: #fff;
  font-weight: bold;
  margin: 10px 0;
  font-size: 1.1rem;
}

.mission-reward {
  color: #ffcc00;
  font-size: 1.2rem;
  font-weight: bold;
}

.mission-timer {
  color: #888;
  font-size: 0.85rem;
  margin-top: 5px;
}

/* AVAILABLE CONTRACTS GRID */
.header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.refresh-btn {
  background: transparent;
  border: none;
  color: #ffcc00;
  cursor: pointer;
  font-size: 0.8rem;
  padding: 5px 10px;
  transition: all 0.2s;
}

.refresh-btn:hover {
  color: #fff;
  text-shadow: 0 0 5px #ffcc00;
}

.contracts-grid {
  display: grid;
  grid-template-columns: 1fr; /* Stack on mobile */
  gap: 15px;
  overflow-y: auto; /* Enable scrolling */
}

@media (min-width: 768px) {
  .contracts-grid {
    grid-template-columns: repeat(2, 1fr); /* 2-col on tablet */
  }
}

@media (min-width: 1024px) {
  .contracts-grid {
    grid-template-columns: repeat(3, 1fr); /* 3-col on desktop */
  }
}

.mission-card {
  border: 1px solid #443300;
  background: #110d00;
  padding: 15px;
  display: flex;
  flex-direction: column;
  transition: all 0.2s;
}

.mission-card:hover {
  border-color: #ffcc00;
  box-shadow: 0 0 10px rgba(255, 204, 0, 0.2);
}

.mission-card.expired-card {
  opacity: 0.5;
  border-color: #333;
}

.card-top {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: #886600;
  margin-bottom: 10px;
}

.difficulty {
  font-weight: bold;
}

.type-tag {
  padding: 2px 8px;
  background: rgba(255, 204, 0, 0.1);
  border: 1px solid #ffcc00;
}

.type-tag.illegal {
  background: rgba(255, 0, 0, 0.1);
  border-color: #f00;
  color: #f00;
}

.mission-body {
  flex-grow: 1;
  margin-bottom: 15px;
}

.mission-body h4 {
  margin: 0 0 5px 0;
  color: #ffcc00;
  font-size: 1rem;
}

.mission-body p {
  margin: 0;
  font-size: 0.85rem;
  color: #aaa;
  line-height: 1.4;
}

.illegal-warning {
  color: #f00;
  font-size: 0.8rem;
  margin-top: 5px;
  font-weight: bold;
}

.card-footer {
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid #332200;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.reward-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.reward-text {
  font-size: 1.1rem;
  font-weight: bold;
  color: #fff;
}

.rep-text {
  font-size: 0.85rem;
  color: #0f0;
}

.accept-btn {
  background: transparent;
  border: 1px solid #ffcc00;
  color: #ffcc00;
  padding: 8px 15px;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.2s;
  text-transform: uppercase;
}

.accept-btn:hover {
  background: #ffcc00;
  color: #000;
  box-shadow: 0 0 10px rgba(255, 204, 0, 0.5);
}

.accept-btn:active {
  transform: scale(0.95);
}

/* MISSION FILTERS */
.mission-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 15px;
}

.filter-btn {
  background: transparent;
  border: 1px solid #443300;
  color: #886600;
  padding: 6px 12px;
  cursor: pointer;
  font-size: 0.85rem;
  font-family: "Courier New", monospace;
  transition: all 0.2s;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.filter-btn:hover {
  border-color: #ffcc00;
  color: #ffcc00;
  background: rgba(255, 204, 0, 0.1);
}

.filter-btn.active {
  background: #ffcc00;
  color: #000;
  border-color: #ffcc00;
  box-shadow: 0 0 8px rgba(255, 204, 0, 0.4);
}

.filter-btn.active:hover {
  background: #ddaa00;
  box-shadow: 0 0 12px rgba(255, 204, 0, 0.6);
}

/* LOADING AND EMPTY STATES */
.loading-msg {
  color: #557755;
  text-align: center;
  padding: 40px;
  font-style: italic;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.loading-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid #333;
  border-top: 3px solid #39ff14;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.no-filtered-missions {
  color: #774444;
  text-align: center;
  padding: 20px;
  margin-top: 20px;
  border: 1px dashed #774444;
  background: rgba(119, 68, 68, 0.1);
}

/* MISSION CARD ANIMATIONS */
@keyframes missionCardIntro {
  0% {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
  50% {
    opacity: 0.7;
    transform: translateY(-5px) scale(1.02);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.mission-card {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}

.mission-card:hover {
  transform: translateY(-3px) scale(1.02);
}

/* Attention-grabbing pulse for mission cards */
.mission-card:nth-child(odd) {
  animation: missionCardAttention 3s ease-in-out infinite;
  animation-delay: 1s;
}

.mission-card:nth-child(even) {
  animation: missionCardAttention 3s ease-in-out infinite;
  animation-delay: 2s;
}

@keyframes missionCardAttention {
  0%, 100% {
    box-shadow: 0 0 5px rgba(57, 255, 20, 0.2);
  }
  50% {
    box-shadow: 0 0 20px rgba(57, 255, 20, 0.4), 0 0 30px rgba(255, 255, 136, 0.2);
  }
}

/* Reduced motion support for mission cards */
@media (prefers-reduced-motion: reduce) {
  .mission-card {
    animation: none !important;
  }

  .mission-card:hover {
    transform: none;
  }
}

/* Mission guidance shimmer effect */
@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

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