/**
 * Access Control Modals Styling
 * Handles subscription required, private guide, and error modals
 */

/* ============================================================================
   Modal Container & Overlay
   ============================================================================ */

.access-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.access-modal.visible {
  opacity: 1;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  cursor: pointer;
}

/* ============================================================================
   Modal Card
   ============================================================================ */

.modal-card {
  position: relative;
  background: #1e1e2e;
  border: 1px solid #2a2a3e;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  max-width: 500px;
  width: 90%;
  z-index: 10001;
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.access-modal.visible .modal-card {
  transform: scale(1);
}

/* ============================================================================
   Modal Header
   ============================================================================ */

.modal-header {
  padding: 24px 24px 16px;
  border-bottom: 1px solid #2a2a3e;
}

.modal-title {
  margin: 0;
  font-size: 24px;
  font-weight: 600;
  color: #e0e0e0;
  text-align: center;
}

/* Icon-specific title colors */
.twitch-modal .modal-title {
  color: #9146ff;
}

.lock-modal .modal-title,
.login-modal .modal-title {
  color: #f0b232;
}

.error-modal .modal-title {
  color: #e74c3c;
}

/* ============================================================================
   Modal Body
   ============================================================================ */

.modal-body {
  padding: 24px;
}

.modal-message {
  margin: 0 0 12px;
  font-size: 16px;
  line-height: 1.6;
  color: #c0c0c0;
  text-align: center;
}

.modal-submessage {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: #8e8e9e;
  text-align: center;
}

.modal-message strong {
  color: #e0e0e0;
  font-weight: 600;
}

.error-details {
  font-family: 'Courier New', monospace;
  font-size: 12px;
  margin-top: 16px;
  padding: 12px;
  background: #16161e;
  border: 1px solid #2a2a3e;
  border-radius: 8px;
  color: #8e8e9e;
}

.error-details code {
  color: #f0b232;
  font-weight: 600;
}

/* ============================================================================
   Modal Actions
   ============================================================================ */

.modal-actions {
  padding: 16px 24px 24px;
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Twitch Subscribe Button - Special Branding */
/* Note: Most modal buttons now use button-system.css classes (btn-primary, btn-secondary, etc.) */
/* This special class is only used for Twitch subscription buttons to maintain brand identity */
.modal-btn.twitch-subscribe-btn {
  padding: 14px 28px;
  background: #9146ff;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-block;
  text-align: center;
}

.modal-btn.twitch-subscribe-btn:hover {
  background: #772ce8;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(145, 70, 255, 0.5);
}

.modal-btn.twitch-subscribe-btn::before {
  content: '';
  display: inline-block;
  width: 16px;
  height: 16px;
  margin-right: 8px;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23ffffff"><path d="M4 2 2 6v14h5v2h3l2-2h4l6-6V2zm16 11-3 3h-4l-2 2v-2H7V4h13zM10 7h2v5h-2zm5 0h2v5h-2z"/></svg>') no-repeat center;
  background-size: contain;
  vertical-align: middle;
}

/* ============================================================================
   Responsive Design
   ============================================================================ */

@media (max-width: 768px) {
  .modal-card {
    max-width: 95%;
    margin: 16px;
  }

  .modal-header {
    padding: 20px 20px 12px;
  }

  .modal-title {
    font-size: 20px;
  }

  .modal-body {
    padding: 20px;
  }

  .modal-message {
    font-size: 15px;
  }

  .modal-submessage {
    font-size: 13px;
  }

  .modal-actions {
    flex-direction: column;
    padding: 12px 20px 20px;
  }

}

@media (max-width: 480px) {
  .modal-title {
    font-size: 18px;
  }

  .modal-message {
    font-size: 14px;
  }

  .modal-submessage {
    font-size: 12px;
  }

  .modal-btn.twitch-subscribe-btn {
    padding: 12px 24px;
    font-size: 14px;
  }
}

/* ============================================================================
   Dark Theme Enhancements
   ============================================================================ */

.access-modal {
  color-scheme: dark;
}

.modal-card {
  background: linear-gradient(135deg, #1e1e2e 0%, #1a1a28 100%);
}

/* Twitch Modal Gradient */
.twitch-modal .modal-card {
  border: 1px solid rgba(145, 70, 255, 0.3);
}

/* Lock Modal Gradient */
.lock-modal .modal-card,
.login-modal .modal-card {
  border: 1px solid rgba(240, 178, 50, 0.3);
}

/* Error Modal Gradient */
.error-modal .modal-card {
  border: 1px solid rgba(231, 76, 60, 0.3);
}

/* ============================================================================
   Accessibility
   ============================================================================ */

/* Twitch button accessibility - button-system.css handles other buttons */
.modal-btn.twitch-subscribe-btn:focus {
  outline: 2px solid #9146ff;
  outline-offset: 2px;
}

.modal-btn.twitch-subscribe-btn:focus:not(:focus-visible) {
  outline: none;
}

.modal-btn.twitch-subscribe-btn:active {
  transform: translateY(0);
}

/* Screen reader only text */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ============================================================================
   Animation Enhancements
   ============================================================================ */

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(-20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes modalFadeOut {
  from {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
  to {
    opacity: 0;
    transform: scale(0.9) translateY(-20px);
  }
}

.access-modal.visible .modal-card {
  animation: modalFadeIn 0.3s ease forwards;
}

.access-modal:not(.visible) .modal-card {
  animation: modalFadeOut 0.3s ease forwards;
}
