/*
 * Unique Random Selector - Custom Styles
 * 
 * This site uses a custom color palette with CSS variables.
 * Always use these variables for consistent theming and dark mode support.
 * 
 * Color Variables:
 * - var(--color-light-shades) - Background colors (#F7F6F4)
 * - var(--color-light-accent) - Accent elements (#DDC85F)
 * - var(--color-brand-primary) - Brand elements (#7F65DC)
 * - var(--color-dark-accent) - Secondary text (#969EA5)
 * - var(--color-dark-shades) - Headers, navigation (#334388)
 * - var(--color-text-dark) - Body text on light backgrounds (#475569)
 * 
 * Utility Classes:
 * - .text-dark-shades, .text-dark, .text-dark-accent - Text colors
 * - .bg-dark-shades, .bg-light-accent, etc. - Backgrounds
 * - .btn-primary, .btn-secondary - Buttons
 * - .card-primary, .card-accent - Card components
 */

/* Result Number Styling */
.result-number {
  background-color: transparent;
  color: var(--color-dark-shades);
  font-weight: 600;
  font-size: 1rem;
  font-family: 'Courier New', Courier, monospace;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--color-dark-accent);
  border-radius: 0.25rem;
  text-align: center;
  transition: all 0.15s ease;
  cursor: default;
  min-width: 3rem;
}

.result-number:hover {
  border-color: var(--color-brand-primary);
  color: var(--color-brand-primary);
}

/* Dark mode result number styling */
.dark .result-number {
  color: var(--color-text-light);
  border-color: rgba(148, 163, 184, 0.3);
}

.dark .result-number:hover {
  border-color: var(--color-brand-primary);
  color: var(--color-brand-primary);
}

/* Error Message Styling for Dark Mode */
.dark #error-message {
  background-color: rgba(220, 38, 38, 0.15);
  border-color: rgba(220, 38, 38, 0.5);
  color: #fca5a5;
}

/* Smooth transitions for all interactive elements */
button,
input,
.result-number {
  transition: all 0.2s ease;
}

/* Focus states for accessibility */
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--color-brand-primary);
  outline-offset: 2px;
}

/* Loading state for generate button */
.btn-primary:active {
  transform: scale(0.98);
}

/* Loading Spinner */
.spinner {
  border: 3px solid rgba(127, 101, 220, 0.2);
  border-top: 3px solid var(--color-brand-primary);
  border-radius: 50%;
  width: 24px;
  height: 24px;
  animation: spin 0.8s linear infinite;
  display: inline-block;
  margin-right: 0.5rem;
}

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

.btn-primary.loading {
  opacity: 0.8;
  cursor: not-allowed;
  pointer-events: none;
}

/* Responsive grid adjustments */
@media (max-width: 640px) {
  .result-number {
    font-size: 0.875rem;
    padding: 0.5rem;
    min-width: 2.5rem;
  }
}

/* Smooth fade-in for results section */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

#results-section {
  animation: fadeIn 0.3s ease;
}

/* Copy feedback animation */
@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#copy-feedback {
  animation: slideDown 0.3s ease;
}

/* Better mobile button layout */
@media (max-width: 640px) {
  .btn-secondary {
    font-size: 0.875rem;
    padding: 0.625rem 1rem;
  }
  
  .btn-secondary svg {
    width: 1rem;
    height: 1rem;
  }
}
