/* Additional styles for enhanced download page components */

/* Bootstrap Modal Base Styles */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1055;
  display: none !important; /* Ensure modal is hidden initially */
  width: 100%;
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  outline: 0;
}

.modal.fade {
  transition: opacity 0.15s linear;
}

.modal.show {
  display: block !important;
}

.modal-dialog {
  position: relative;
  width: auto;
  margin: 0.5rem;
  pointer-events: none;
}

.modal.fade .modal-dialog {
  transition: transform 0.3s ease-out;
  transform: translate(0, -50px);
}

.modal.show .modal-dialog {
  transform: none;
}

.modal-dialog-centered {
  display: flex;
  align-items: center;
  min-height: calc(100% - 1rem);
}

.modal-content {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  pointer-events: auto;
  background-color: #2c2c2c;
  background-clip: padding-box;
  border: 1px solid #444444;
  border-radius: 0.375rem;
  outline: 0;
}

.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1050;
  width: 100vw;
  height: 100vh;
  background-color: #000;
}

.modal-backdrop.fade {
  opacity: 0;
}

.modal-backdrop.show {
  opacity: 0.5;
}

.modal-header {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1rem;
  border-bottom: 1px solid #444444;
  border-top-left-radius: calc(0.375rem - 1px);
  border-top-right-radius: calc(0.375rem - 1px);
}

.modal-title {
  margin-bottom: 0;
  line-height: 1.5;
  color: #ffffff;
}

.modal-body {
  position: relative;
  flex: 1 1 auto;
  padding: 1rem;
}

.modal-footer {
  display: flex;
  flex-wrap: wrap;
  flex-shrink: 0;
  align-items: center;
  justify-content: flex-end;
  padding: 0.75rem;
  border-top: 1px solid #444444;
  border-bottom-right-radius: calc(0.375rem - 1px);
  border-bottom-left-radius: calc(0.375rem - 1px);
}

.btn-close {
  box-sizing: content-box;
  width: 1em;
  height: 1em;
  padding: 0.25em 0.25em;
  color: #ffffff;
  background: transparent url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23ffffff'%3e%3cpath d='m.235 1.437 1.437-1.437 6.828 6.828 6.828-6.828 1.437 1.437-6.828 6.828 6.828 6.828-1.437 1.437-6.828-6.828-6.828 6.828-1.437-1.437 6.828-6.828z'/%3e%3c/svg%3e") center/1em auto no-repeat;
  border: 0;
  border-radius: 0.375rem;
  opacity: 0.5;
}

.btn-close:hover {
  color: #ffffff;
  text-decoration: none;
  opacity: 0.75;
}

.btn-close:focus {
  outline: 0;
  box-shadow: 0 0 0 0.25rem rgba(102, 126, 234, 0.25);
  opacity: 1;
}

.modal-lg {
  max-width: 800px;
}

@media (min-width: 576px) {
  .modal-dialog {
    max-width: 500px;
    margin: 1.75rem auto;
  }
  
  .modal-dialog-centered {
    min-height: calc(100% - 3.5rem);
  }
  
  .modal-lg {
    max-width: 800px;
  }
}

/* Video Container Styles */
.video-container {
  position: relative;
  width: 100%;
  height: 0;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  overflow: hidden;
  background: #000;
  border-radius: 8px;
}

.video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Specific styling for gameplay modal */
#gameplayModal {
  display: none !important;
}

#gameplayModal.show {
  display: block !important;
}

/* Bootstrap Collapse Classes */
.collapse {
  display: none;
}

.collapse.show {
  display: block;
}

.collapsing {
  position: relative;
  height: 0;
  overflow: hidden;
  transition: height 0.35s ease;
}

/* Enhanced FAQ Animations */
.faq-item {
  transform: translateY(0);
  transition: all 0.3s ease;
}

.faq-item:hover {
  transform: translateY(-2px);
}

.faq-answer {
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transition: all 0.3s ease;
}

.faq-answer.show {
  opacity: 1;
  max-height: 500px;
  transition: all 0.4s ease;
}

.faq-question::before {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 2px;
  background: var(--primary-color);
  transition: width 0.3s ease;
}

.faq-question:hover::before {
  width: 100%;
}

.faq-question[aria-expanded="true"]::before {
  width: 100%;
}

/* Download Confirmation Modal */
.download-confirmation-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  animation: fadeIn 0.3s ease;
}

.download-confirmation-modal .modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.download-confirmation-modal .modal-content {
  background: #2c2c2c;
  border-radius: 12px;
  max-width: 500px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: slideIn 0.3s ease;
  border: 1px solid #444444;
}

.download-confirmation-modal .modal-header {
  padding: 24px 24px 16px;
  border-bottom: 1px solid #444444;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.download-confirmation-modal .modal-header h4 {
  margin: 0;
  color: #ffffff;
  font-weight: 700;
}

.download-confirmation-modal .close-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #b0b0b0;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.download-confirmation-modal .close-btn:hover {
  background: #1a1a1a;
  color: #ffffff;
}

.download-confirmation-modal .modal-body {
  padding: 24px;
  text-align: center;
}

.download-confirmation-modal .success-icon {
  margin-bottom: 16px;
}

.download-confirmation-modal .success-icon i {
  font-size: 3rem;
  color: var(--success-color);
}

.download-confirmation-modal .modal-body p {
  font-size: 1.125rem;
  margin-bottom: 24px;
  color: #ffffff;
}

.download-tips {
  background: #1a1a1a;
  border-radius: 8px;
  padding: 20px;
  text-align: left;
  margin-bottom: 20px;
  border: 1px solid #444444;
}

.download-tips h5 {
  margin-bottom: 12px;
  color: #ffffff;
  font-weight: 600;
}

.download-tips ul {
  margin: 0;
  padding-left: 20px;
}

.download-tips li {
  margin-bottom: 8px;
  color: #b0b0b0;
  line-height: 1.5;
}

.download-confirmation-modal .modal-footer {
  padding: 16px 24px 24px;
  text-align: center;
}

.download-confirmation-modal .modal-footer {
  padding: 16px 24px 24px;
  text-align: center;
}

.download-confirmation-modal .modal-footer .btn {
  padding: 12px 30px;
  font-weight: 600;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

/* Progress Modal */
.progress-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  animation: fadeIn 0.3s ease;
}

.progress-modal .modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.progress-modal .modal-content {
  background: #2c2c2c;
  border-radius: 12px;
  max-width: 600px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  border: 1px solid #444444;
}

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

.progress-modal .modal-header h4 {
  margin: 0;
  color: #ffffff;
  font-weight: 700;
}

.progress-modal .modal-body {
  padding: 24px;
}

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

.progress-bar {
  width: 100%;
  height: 20px;
  background: #1a1a1a;
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  margin-bottom: 12px;
  border: 1px solid #444444;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
  width: 0%;
  transition: width 0.3s ease;
  border-radius: 10px;
}

.progress-text {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
  color: #b0b0b0;
}

.progress-percentage {
  font-weight: 600;
  color: #ffffff;
}

.download-info {
  background: #1a1a1a;
  border-radius: 8px;
  padding: 16px;
  border: 1px solid #444444;
}

.download-info p {
  margin-bottom: 8px;
  color: #ffffff;
}

.download-info p:last-child {
  margin-bottom: 0;
}

/* Custom Tooltip */
.custom-tooltip {
  position: absolute;
  background: #1a1a1a;
  color: #ffffff;
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid #444444;
  font-size: 0.875rem;
  z-index: 10000;
  pointer-events: none;
  opacity: 0;
  animation: tooltipFadeIn 0.2s ease forwards;
}

.custom-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: #1a1a1a;
}

/* Notification */
.notification {
  position: fixed;
  top: 20px;
  right: 20px;
  background: #2c2c2c;
  border-radius: 8px;
  padding: 16px 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  z-index: 10000;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  max-width: 350px;
  border: 1px solid #444444;
}

.notification.show {
  transform: translateX(0);
}

.notification.success {
  border-left: 4px solid var(--success-color);
}

.notification.error {
  border-left: 4px solid #e74c3c;
}

.notification.info {
  border-left: 4px solid var(--primary-color);
}

.notification-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.notification-content i {
  font-size: 1.2rem;
}

.notification.success i {
  color: var(--success-color);
}

.notification.error i {
  color: #e74c3c;
}

.notification.info i {
  color: var(--primary-color);
}

.notification-content span {
  color: #ffffff;
  font-weight: 500;
}

/* Loading States */
.btn-download.loading {
  position: relative;
  pointer-events: none;
  color: transparent !important;
}

.btn-download.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 20px;
  height: 20px;
  border: 2px solid transparent;
  border-top: 2px solid currentColor;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* Enhanced hover effects */
.download-card:hover .provider-logo .icon {
  transform: scale(1.1);
  transition: transform 0.3s ease;
}

.feature-card:hover .feature-icon {
  animation: bounce 0.6s ease;
}

.step-card:hover .step-number {
  animation: pulse 0.8s ease;
}

/* Accessibility improvements */
.btn-download:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

.faq-question:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .download-card {
    border: 2px solid var(--text-color);
  }
  
  .btn-download {
    border: 2px solid currentColor;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .fade-in,
  .scale-in,
  .download-card,
  .feature-card,
  .step-card {
    animation: none !important;
    transition: none !important;
    transform: none !important;
  }
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
  .downloads-page-enhanced {
    --text-color: #ffffff;
    --text-light: #b3b3b3;
    --background-light: #2c2c2c;
    --background-dark: #1a1a1a;
    --border-color: #444444;
  }
  
  .download-card,
  .requirements-card,
  .feature-card,
  .step-card {
    background: #2c2c2c;
    color: white;
  }
  
  .download-confirmation-modal .modal-content,
  .progress-modal .modal-content {
    background: #2c2c2c;
    color: white;
  }
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

@keyframes tooltipFadeIn {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes spin {
  from {
    transform: translate(-50%, -50%) rotate(0deg);
  }
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

@keyframes bounce {
  0%, 20%, 53%, 80%, 100% {
    transform: translate3d(0, 0, 0);
  }
  40%, 43% {
    transform: translate3d(0, -8px, 0);
  }
  70% {
    transform: translate3d(0, -4px, 0);
  }
  90% {
    transform: translate3d(0, -2px, 0);
  }
}

@keyframes pulse {
  0% {
    transform: translateX(-50%) scale(1);
  }
  50% {
    transform: translateX(-50%) scale(1.1);
  }
  100% {
    transform: translateX(-50%) scale(1);
  }
}

/* Print styles */
@media print {
  .download-confirmation-modal,
  .progress-modal,
  .notification {
    display: none !important;
  }
  
  .btn-download::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    color: #666;
  }
}
