/* Main Application Controller Styles - Task 10 Integration */

/* Global refresh progress indicator */
.global-refresh-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  backdrop-filter: blur(2px);
}

.progress-content {
  background: white;
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  text-align: center;
  min-width: 300px;
  max-width: 90vw;
}

.progress-spinner {
  margin-bottom: 1rem;
}

.progress-spinner i {
  font-size: 2rem;
  color: #007bff;
}

.progress-text {
  color: #333;
  font-size: 1.1rem;
  font-weight: 500;
}

.progress-message {
  display: block;
  margin-bottom: 0.5rem;
}

/* Form disabled state during refresh */
.refresh-disabled {
  opacity: 0.6 !important;
  cursor: not-allowed !important;
  pointer-events: none !important;
}

/* Character selection state persistence */
.character-card.selection-restored {
  animation: selectionRestored 0.5s ease-out;
}

@keyframes selectionRestored {
  0% {
    transform: scale(1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  }
  50% {
    transform: scale(1.02);
    box-shadow: 0 4px 16px rgba(0, 123, 255, 0.3);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  }
}

/* Cache status integration styles */
.character-card .cache-status-integration {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 0.75rem;
  font-weight: 500;
  backdrop-filter: blur(4px);
}

.cache-status-integration.cache-valid {
  color: #28a745;
  border: 1px solid rgba(40, 167, 69, 0.3);
}

.cache-status-integration.cache-stale {
  color: #ffc107;
  border: 1px solid rgba(255, 193, 7, 0.3);
}

.cache-status-integration.cache-expired {
  color: #dc3545;
  border: 1px solid rgba(220, 53, 69, 0.3);
}

/* Refresh button integration */
.refresh-btn.main-controller-integrated {
  transition: all 0.3s ease;
}

.refresh-btn.main-controller-integrated:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

.refresh-btn.main-controller-integrated:disabled {
  transform: none;
  box-shadow: none;
}

/* Global event system indicators */
.component-communication-active {
  position: relative;
}

.component-communication-active::after {
  content: "";
  position: absolute;
  top: -2px;
  right: -2px;
  width: 8px;
  height: 8px;
  background: #28a745;
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.5;
    transform: scale(1.2);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* Responsive design for mobile */
@media (max-width: 768px) {
  .progress-content {
    padding: 1.5rem;
    min-width: 280px;
  }

  .progress-spinner i {
    font-size: 1.5rem;
  }

  .progress-text {
    font-size: 1rem;
  }

  .cache-status-integration {
    font-size: 0.7rem;
    padding: 1px 4px;
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  .progress-content {
    background: #2d3748;
    color: #e2e8f0;
  }

  .progress-spinner i {
    color: #4299e1;
  }

  .cache-status-integration {
    background: rgba(45, 55, 72, 0.9);
    color: #e2e8f0;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .global-refresh-progress {
    background: rgba(0, 0, 0, 0.8);
  }

  .progress-content {
    border: 2px solid #000;
  }

  .cache-status-integration {
    border-width: 2px;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .character-card.selection-restored,
  .refresh-btn.main-controller-integrated,
  .component-communication-active::after {
    animation: none;
    transition: none;
  }

  .refresh-btn.main-controller-integrated:hover:not(:disabled) {
    transform: none;
  }
}
