/* Token System Styles - Integrated */

/* =============================================================================
   TOKEN DISPLAY COMPONENT STYLES
   Used in main application for token balance display
   ============================================================================= */

/* Token Display in Button Group (Primary Style) */
.button-group .token-display {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1rem;
  background: linear-gradient(135deg, #eab308 0%, #ca8a04 100%);
  border-radius: 12px;
  box-shadow:
    0 2px 4px rgba(0, 0, 0, 0.1),
    0 1px 2px rgba(0, 0, 0, 0.06);
  transition: all 0.3s ease;
  cursor: default;
  user-select: none;
  white-space: nowrap;
  min-height: 44px;
}

.button-group .token-display:hover {
  transform: translateY(-1px);
  box-shadow:
    0 4px 8px rgba(0, 0, 0, 0.15),
    0 2px 4px rgba(0, 0, 0, 0.1);
}

.button-group .token-display i {
  font-size: 1.25rem;
  color: #ffd700;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
  animation: token-pulse 2s ease-in-out infinite;
}

.button-group .token-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.95);
  letter-spacing: 0.3px;
}

.button-group .token-count {
  font-size: 1.25rem;
  font-weight: 700;
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  min-width: 2ch;
  text-align: center;
}

/* Legacy Container Style (for backward compatibility) */
.token-display-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  background: linear-gradient(135deg, #eab308 0%, #ca8a04 100%);
  border-radius: 12px;
  box-shadow:
    0 4px 6px rgba(0, 0, 0, 0.1),
    0 1px 3px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  cursor: default;
  user-select: none;
  margin: 1rem auto;
  max-width: 200px;
}

.token-display-container:hover {
  transform: translateY(-2px);
  box-shadow:
    0 6px 12px rgba(0, 0, 0, 0.15),
    0 2px 4px rgba(0, 0, 0, 0.1);
}

.token-icon {
  font-size: 1.5rem;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
  animation: token-pulse 2s ease-in-out infinite;
}

.token-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.125rem;
}

.token-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.token-count {
  font-size: 1.5rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* =============================================================================
   SHARED TOKEN STATES
   Common states used by both display and issuance components
   ============================================================================= */

/* Loading States */
.button-group .token-display.loading,
.token-display-container.loading {
  opacity: 0.7;
  pointer-events: none;
}

.button-group .token-display.loading .token-count,
.token-display-container.loading .token-count {
  animation: token-loading 1.5s ease-in-out infinite;
}

@keyframes token-loading {
  0%,
  100% {
    opacity: 0.5;
  }
  50% {
    opacity: 1;
  }
}

/* Error States */
.button-group .token-display.error,
.token-display-container.error {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.button-group .token-display.error i,
.token-display-container.error .token-icon {
  animation: token-shake 0.5s ease-in-out;
}

@keyframes token-shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-5px);
  }
  75% {
    transform: translateX(5px);
  }
}

/* Success Animations */
.button-group .token-display.token-gained,
.token-display-container.token-gained {
  animation: token-gain 0.6s ease-out;
}

@keyframes token-gain {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.15);
    box-shadow: 0 8px 16px rgba(234, 179, 8, 0.4);
  }
  100% {
    transform: scale(1);
  }
}

/* Token Pulse Animation */
@keyframes token-pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

/* =============================================================================
   TOKEN ISSUANCE PAGE STYLES
   Full page styles for /tokens/issue page
   ============================================================================= */

/* Global Styles for Token Issuance Page */
.token-issuance-page * {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

.token-issuance-page {
  font-family:
    -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: linear-gradient(135deg, #eab308 0%, #ca8a04 100%);
  min-height: 100vh;
  padding: 2rem;
  color: #333;
}

.issuance-container {
  max-width: 900px;
  margin: 0 auto;
}

/* Header */
.issuance-header {
  background: white;
  border-radius: 16px;
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  text-align: center;
}

.issuance-header h1 {
  font-size: 2rem;
  color: #eab308;
  margin-bottom: 0.5rem;
}

.issuance-header p {
  color: #666;
  font-size: 1rem;
  margin-bottom: 1.5rem;
}

.controls {
  display: flex;
  justify-content: center;
  gap: 1rem;
}

/* Shared Button Styles */
.control-btn,
.check-btn,
.issue-btn,
.primary-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: #eab308;
  color: white;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
  white-space: nowrap;
}

.control-btn:hover,
.check-btn:hover,
.issue-btn:hover,
.primary-btn:hover {
  background: #ca8a04;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(234, 179, 8, 0.3);
}

.issue-btn {
  padding: 1rem 2rem;
  background: white;
  color: #eab308;
  font-weight: 700;
  font-size: 1rem;
}

.issue-btn:hover {
  background: #f8f9fa;
  color: #ca8a04;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.issue-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Loading State for Issuance Page */
.loading {
  background: white;
  border-radius: 16px;
  padding: 3rem;
  text-align: center;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #eab308;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 1rem;
}

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

.loading p {
  color: #666;
  font-size: 1rem;
}

/* Error Container */
.error-container {
  background: #fee;
  border: 2px solid #fcc;
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  color: #c33;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.error-container::before {
  content: '⚠️';
  font-size: 2rem;
}

/* Hidden State */
.hidden {
  display: none !important;
}

/* Main Content */
#issuance-content {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* Adventure Selection Section */
.adventure-selection-section {
  background: white;
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.adventure-selection-section h2 {
  font-size: 1.5rem;
  color: #333;
  margin-bottom: 1.5rem;
}

.adventure-input-group {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.adventure-input-group label {
  font-weight: 600;
  color: #555;
  white-space: nowrap;
}

.adventure-input {
  flex: 1;
  padding: 0.75rem 1rem;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.adventure-input:focus {
  outline: none;
  border-color: #eab308;
  box-shadow: 0 0 0 3px rgba(234, 179, 8, 0.1);
}

/* Status Section */
.status-section {
  background: white;
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.status-card {
  margin-bottom: 2rem;
}

.status-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid #f0f0f0;
}

.status-header h3 {
  font-size: 1.5rem;
  color: #333;
}

/* Verification Badge */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-weight: 600;
  font-size: 0.875rem;
}

.badge-verified {
  background: #d4edda;
  color: #155724;
}

.badge-unverified {
  background: #f8d7da;
  color: #721c24;
}

/* Status Info */
.status-info {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem;
  background: #f8f9fa;
  border-radius: 8px;
}

.info-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #555;
  font-weight: 500;
}

.info-label i {
  color: #eab308;
}

.info-value {
  font-weight: 700;
  color: #333;
  font-size: 1.125rem;
}

/* Warning and Success Boxes */
.warning-box {
  display: flex;
  gap: 1.5rem;
  padding: 1.5rem;
  background: #fff3cd;
  border: 2px solid #ffc107;
  border-radius: 12px;
  margin-bottom: 1.5rem;
}

.warning-box i {
  font-size: 2rem;
  color: #856404;
  flex-shrink: 0;
}

.warning-content h4 {
  color: #856404;
  margin-bottom: 0.5rem;
  font-size: 1.125rem;
}

.warning-content p {
  color: #856404;
  line-height: 1.6;
  margin-bottom: 0.5rem;
}

.warning-content p:last-child {
  margin-bottom: 0;
}

.success-box {
  display: flex;
  gap: 1.5rem;
  padding: 1.5rem;
  background: #d4edda;
  border: 2px solid #28a745;
  border-radius: 12px;
  margin-bottom: 1.5rem;
}

.success-box i {
  font-size: 2rem;
  color: #155724;
  flex-shrink: 0;
}

.success-content h4 {
  color: #155724;
  margin-bottom: 0.5rem;
  font-size: 1.125rem;
}

.success-content p {
  color: #155724;
  line-height: 1.6;
}

/* Issuance Box */
.issuance-box {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 12px;
  margin-bottom: 1rem;
}

.issuance-info {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: white;
}

.issuance-info i {
  font-size: 2.5rem;
  opacity: 0.9;
}

.issuance-text h4 {
  font-size: 1.25rem;
  margin-bottom: 0.25rem;
}

.issuance-text p {
  font-size: 0.875rem;
  opacity: 0.9;
}

/* Info Note */
.info-note {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  background: #e7f3ff;
  border-left: 4px solid #2196f3;
  border-radius: 8px;
}

.info-note i {
  color: #2196f3;
  font-size: 1.25rem;
}

.info-note p {
  color: #0d47a1;
  margin: 0;
  line-height: 1.5;
}

/* Action Buttons */
.action-buttons {
  display: flex;
  justify-content: center;
  gap: 1rem;
}

/* Activity Section */
.activity-section {
  background: white;
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.activity-section h3 {
  font-size: 1.25rem;
  color: #333;
  margin-bottom: 1.5rem;
}

.activity-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.activity-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background: #f8f9fa;
  border-radius: 8px;
  border-left: 4px solid #667eea;
}

.activity-type {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  color: #333;
}

.activity-type i {
  color: #667eea;
}

.activity-amount {
  font-weight: 700;
  font-size: 1.125rem;
}

.activity-amount.positive {
  color: #28a745;
}

.activity-amount.negative {
  color: #dc3545;
}

.activity-time {
  font-size: 0.875rem;
  color: #666;
}

.no-data {
  text-align: center;
  color: #999;
  padding: 2rem;
  font-style: italic;
}

/* Toast Notification */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  padding: 1rem 1.5rem;
  background: #333;
  color: white;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  z-index: 1000;
  animation: toast-slide-in 0.3s ease-out;
}

.toast.success {
  background: #28a745;
}

.toast.error {
  background: #dc3545;
}

.toast.warning {
  background: #ffc107;
  color: #333;
}

@keyframes toast-slide-in {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* =============================================================================
   RESPONSIVE DESIGN
   ============================================================================= */

@media (max-width: 768px) {
  /* Token Display Responsive */
  .button-group .token-display {
    padding: 0.5rem 0.75rem;
    gap: 0.375rem;
  }

  .button-group .token-display i {
    font-size: 1rem;
  }

  .button-group .token-label {
    font-size: 0.75rem;
  }

  .button-group .token-count {
    font-size: 1rem;
  }

  .token-display-container {
    padding: 0.625rem 1rem;
    max-width: 180px;
  }

  .token-icon {
    font-size: 1.25rem;
  }

  .token-label {
    font-size: 0.625rem;
  }

  .token-count {
    font-size: 1.25rem;
  }

  /* Token Issuance Page Responsive */
  .token-issuance-page {
    padding: 1rem;
  }

  .issuance-header {
    padding: 1.5rem;
  }

  .issuance-header h1 {
    font-size: 1.5rem;
  }

  .adventure-input-group {
    flex-direction: column;
    align-items: stretch;
  }

  .adventure-input-group label {
    text-align: left;
  }

  .check-btn {
    width: 100%;
    justify-content: center;
  }

  .status-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .issuance-box {
    flex-direction: column;
    gap: 1.5rem;
    text-align: center;
  }

  .issuance-info {
    flex-direction: column;
  }

  .issue-btn {
    width: 100%;
    justify-content: center;
  }

  .activity-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .toast {
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
  }
}

/* =============================================================================
   ACCESSIBILITY
   ============================================================================= */

.token-display-container:focus-visible,
.control-btn:focus-visible,
.check-btn:focus-visible,
.issue-btn:focus-visible,
.primary-btn:focus-visible {
  outline: 3px solid #667eea;
  outline-offset: 2px;
}

/* =============================================================================
   DARK MODE SUPPORT
   ============================================================================= */

@media (prefers-color-scheme: dark) {
  .token-display-container {
    box-shadow:
      0 4px 6px rgba(0, 0, 0, 0.3),
      0 1px 3px rgba(0, 0, 0, 0.2);
  }

  .token-display-container:hover {
    box-shadow:
      0 6px 12px rgba(0, 0, 0, 0.4),
      0 2px 4px rgba(0, 0, 0, 0.3);
  }
}

/* =============================================================================
   PRINT STYLES
   ============================================================================= */

@media print {
  .token-issuance-page {
    background: white;
  }

  .controls,
  .action-buttons,
  .issue-btn {
    display: none;
  }
}
