/* Missions Component Styles - SOLIUS Missions System
 * Figma-Perfect Design - November 2025
 * Based on UI Design System Colors
 */

/* ==================== ANIMATIONS ==================== */
@keyframes fade-in-up {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* ==================== MAIN CONTAINER ==================== */
.missions-component {
  width: 100%;
  height: 100%;
  overflow-y: auto;
  padding: 24px;
  background: #00091E;
  animation: fade-in 0.3s ease-out;
}

.missions-container {
  width: 100%;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  animation: fade-in-up 0.5s ease-out;
}

/* ==================== TABS ==================== */
.missions-tabs {
  display: flex;
  gap: 12px;
  margin-bottom: 32px;
  width: 100%;
}

.missions-tab {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  padding: 8px 16px;
  gap: 8px;
  height: 48px;
  flex: 1;
  background: #192239;
  border-radius: 100px;
  border: none;
  cursor: pointer;
  transition: all 0.3s;
  font-family: 'Montserrat', sans-serif;
  color: #536285;
  font-size: 18px;
  font-weight: 500;
  line-height: 26px;
}

.missions-tab .tab-icon {
  width: 24px;
  height: 24px;
  flex: none;
  opacity: 1;
}

.missions-tab:hover {
  background: #1f2a47;
  color: #7B83FF;
}

.missions-tab.active {
  background: linear-gradient(124.88deg, #B475CC 21.7%, #555DFF 81.79%);
  box-shadow: 0 4px 20px rgba(85, 93, 255, 0.6);
  color: #FFFFFF;
}

.missions-tab.active .tab-icon {
  filter: brightness(0) invert(1);
}

/* ==================== MISSION GRID ==================== */
.missions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 24px;
}

/* ==================== MISSION CARD ==================== */
.mission-card {
  background: linear-gradient(311.13deg, #00091E 22.82%, #303365 88.03%);
  border: 1px solid rgba(85, 93, 255, 0.2);
  border-radius: 20px;
  padding: 24px;
  transition: all 0.3s;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  animation: fade-in-up 0.5s ease-out;
  animation-fill-mode: both;
}

/* Stagger animation for multiple cards */
.mission-card:nth-child(1) { animation-delay: 0s; }
.mission-card:nth-child(2) { animation-delay: 0.05s; }
.mission-card:nth-child(3) { animation-delay: 0.1s; }
.mission-card:nth-child(4) { animation-delay: 0.15s; }
.mission-card:nth-child(5) { animation-delay: 0.2s; }
.mission-card:nth-child(6) { animation-delay: 0.25s; }
.mission-card:nth-child(7) { animation-delay: 0.3s; }
.mission-card:nth-child(8) { animation-delay: 0.35s; }
.mission-card:nth-child(9) { animation-delay: 0.4s; }

.mission-card:hover {
  border-color: #555DFF;
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(85, 93, 255, 0.3);
}

/* Mission Icon */
.mission-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin-bottom: 16px;
}

.mission-icon-easy {
  background: rgba(52, 199, 89, 0.1);
  border: 1px solid rgba(52, 199, 89, 0.3);
}

.mission-icon-medium {
  background: rgba(255, 184, 108, 0.1);
  border: 1px solid rgba(255, 184, 108, 0.3);
}

.mission-icon-hard {
  background: rgba(255, 59, 48, 0.1);
  border: 1px solid rgba(255, 59, 48, 0.3);
}

/* Mission Header */
.mission-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
  gap: 12px;
}

.mission-header h3 {
  font-size: 18px;
  font-weight: 600;
  color: #FFFFFF;
  margin: 0;
  flex: 1;
  font-family: 'Montserrat', sans-serif;
}

/* Difficulty Badge */
.mission-difficulty {
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  font-family: 'Montserrat', sans-serif;
}

.mission-difficulty-easy {
  background: rgba(52, 199, 89, 0.1);
  color: #34C759;
  border: 1px solid rgba(52, 199, 89, 0.3);
}

.mission-difficulty-medium {
  background: rgba(255, 184, 108, 0.1);
  color: #FFB86C;
  border: 1px solid rgba(255, 184, 108, 0.3);
}

.mission-difficulty-hard {
  background: rgba(255, 59, 48, 0.1);
  color: #FF3B30;
  border: 1px solid rgba(255, 59, 48, 0.3);
}

/* Mission Description */
.mission-description {
  font-size: 14px;
  color: #536285;
  line-height: 1.5;
  margin-bottom: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-family: 'Montserrat', sans-serif;
  flex: 1;
}

/* Mission Footer */
.mission-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.mission-reward {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #7B83FF;
  font-weight: 600;
  font-family: 'Montserrat', sans-serif;
}

.reward-icon {
  font-size: 18px;
}

/* Progress Circle */
.mission-progress {
  position: relative;
}

.progress-ring {
  transform: rotate(-90deg);
}

.progress-ring-bg {
  fill: none;
  stroke: rgba(85, 93, 255, 0.2);
  stroke-width: 3;
}

.progress-ring-fill {
  fill: none;
  stroke: #555DFF;
  stroke-width: 3;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.5s;
}

.progress-text {
  transform: rotate(90deg) translate(0, -40px);
  font-size: 10px;
  fill: #FFFFFF;
  font-weight: 600;
  text-anchor: middle;
  font-family: 'Montserrat', sans-serif;
}

/* Mission Button - Glossy with Blue Glow on Right */
.mission-button {
  width: 100%;
  position: relative;
  padding: 0;
  border: none;
  cursor: pointer;
  font-family: 'Montserrat', sans-serif;
  border-radius: 12px;
  height: 48px;
  overflow: visible;
}

.mission-button.btn-primary {
  background: linear-gradient(90deg, transparent 60%, rgba(0, 13, 255, 0.6) 100%);
}

.mission-button .btn-content {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  color: white;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.3s;
}

.mission-button.btn-primary:hover .btn-content {
  background: rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 0 20px rgba(85, 93, 255, 0.3), 0 4px 20px rgba(85, 93, 255, 0.4);
}

.mission-button.btn-success {
  background: linear-gradient(135deg, #34C759, #7BFFBF);
}

.mission-button.btn-success .btn-content {
  background: transparent;
  border: none;
  color: white;
}

.mission-button.btn-success:hover {
  transform: scale(1.02);
  box-shadow: 0 4px 20px rgba(52, 199, 89, 0.4);
}

.mission-button.btn-disabled {
  background: rgba(142, 142, 147, 0.2);
  cursor: not-allowed;
}

.mission-button.btn-disabled .btn-content {
  background: transparent;
  border: none;
  color: #8E8E93;
}

.mission-button.btn-pending {
  background: rgba(255, 184, 108, 0.1);
  border: 1px solid rgba(255, 184, 108, 0.3);
  cursor: default;
}

.mission-button.btn-pending .btn-content {
  background: transparent;
  border: none;
  color: #FFB86C;
}

/* Empty State */
.missions-empty {
  text-align: center;
  padding: 80px 24px;
  color: #536285;
  font-size: 16px;
  font-family: 'Montserrat', sans-serif;
}

/* Loading State */
.missions-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 400px;
  color: #536285;
  font-family: 'Montserrat', sans-serif;
}

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(85, 93, 255, 0.2);
  border-top-color: #555DFF;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 16px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ==================== STARDUST BALANCE IN HEADER ==================== */
.stardust-balance {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: rgba(85, 93, 255, 0.1);
  border: 1px solid rgba(85, 93, 255, 0.3);
  border-radius: 12px;
  font-family: 'Montserrat', sans-serif;
  margin-right: 12px;
}

.stardust-icon {
  font-size: 18px;
}

.stardust-amount {
  color: #7B83FF;
  font-size: 14px;
  font-weight: 600;
}

/* ==================== MISSION MODAL ==================== */
.mission-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  transition: opacity 0.3s;
}

.mission-modal-overlay.show {
  opacity: 1;
}

.mission-modal {
  background: linear-gradient(311.13deg, #00091E 22.82%, #303365 88.03%);
  border: 1px solid rgba(85, 93, 255, 0.3);
  border-radius: 24px;
  padding: 32px;
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  font-family: 'Montserrat', sans-serif;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: transparent;
  border: none;
  color: #536285;
  font-size: 24px;
  cursor: pointer;
  transition: color 0.2s;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
}

.modal-close:hover {
  color: #FFFFFF;
  background: rgba(255, 255, 255, 0.1);
}

.modal-header {
  text-align: center;
  margin-bottom: 24px;
}

.mission-icon-large {
  width: 80px;
  height: 80px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  margin: 0 auto 16px;
}

.modal-header h2 {
  font-size: 24px;
  font-weight: 700;
  color: #FFFFFF;
  margin-bottom: 8px;
  font-family: 'Montserrat', sans-serif;
}

.modal-body {
  margin-bottom: 24px;
}

.mission-description-full {
  font-size: 16px;
  color: #536285;
  line-height: 1.6;
  margin-bottom: 24px;
}

.mission-reward-large {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px;
  background: rgba(85, 93, 255, 0.1);
  border: 1px solid rgba(85, 93, 255, 0.3);
  border-radius: 12px;
  margin-bottom: 24px;
}

.mission-reward-large .reward-icon {
  font-size: 32px;
}

.mission-reward-large .reward-text {
  font-size: 18px;
  font-weight: 700;
  color: #7B83FF;
}

.mission-progress-bar {
  margin-bottom: 24px;
}

.progress-label {
  font-size: 14px;
  color: #FFFFFF;
  margin-bottom: 8px;
  text-align: center;
}

.progress-bar-track {
  width: 100%;
  height: 8px;
  background: rgba(85, 93, 255, 0.2);
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #555DFF, #7B83FF);
  border-radius: 4px;
  transition: width 0.5s;
}

.mission-status-message {
  text-align: center;
  padding: 16px;
  background: rgba(85, 93, 255, 0.05);
  border-radius: 12px;
  color: #7B83FF;
  font-size: 14px;
  margin-bottom: 24px;
}

.mission-requirements {
  margin-bottom: 24px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 12px;
  border: 1px solid rgba(85, 93, 255, 0.1);
}

.mission-requirements h4 {
  font-size: 16px;
  color: #FFFFFF;
  margin-bottom: 8px;
  font-weight: 600;
}

.mission-requirements p {
  font-size: 14px;
  color: #536285;
  line-height: 1.5;
}

.manual-submission {
  margin-bottom: 24px;
}

.manual-submission h4 {
  font-size: 16px;
  color: #FFFFFF;
  margin-bottom: 12px;
  font-weight: 600;
}

.manual-submission textarea {
  width: 100%;
  min-height: 100px;
  background: rgba(13, 21, 41, 0.8);
  border: 1px solid rgba(85, 93, 255, 0.2);
  border-radius: 12px;
  padding: 12px;
  color: #FFFFFF;
  font-size: 14px;
  font-family: 'Montserrat', sans-serif;
  resize: vertical;
  margin-bottom: 12px;
}

.manual-submission textarea:focus {
  outline: none;
  border-color: #555DFF;
}

.manual-submission textarea::placeholder {
  color: #536285;
}

.modal-footer {
  display: flex;
  gap: 12px;
}

.modal-footer button {
  flex: 1;
  padding: 12px 24px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'Montserrat', sans-serif;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* ==================== TOAST NOTIFICATIONS ==================== */
.mission-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 16px 24px;
  border-radius: 12px;
  color: #FFFFFF;
  font-size: 14px;
  font-weight: 600;
  font-family: 'Montserrat', sans-serif;
  z-index: 10001;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s;
  max-width: 400px;
}

.mission-toast.show {
  opacity: 1;
  transform: translateY(0);
}

.mission-toast-success {
  background: linear-gradient(135deg, #34C759, #7BFFBF);
}

.mission-toast-error {
  background: linear-gradient(135deg, #FF3B30, #FF6B6B);
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
  .missions-component {
    padding: 16px;
  }

  .missions-grid {
    grid-template-columns: 1fr;
  }

  .missions-tabs {
    flex-wrap: wrap;
    gap: 8px;
  }

  .missions-tab {
    padding: 10px 16px;
    font-size: 13px;
  }

  .missions-header h1 {
    font-size: 24px;
  }

  .mission-modal {
    padding: 24px;
    width: 95%;
  }

  .mission-toast {
    right: 16px;
    bottom: 16px;
    max-width: calc(100% - 32px);
  }
}

