/* Modal Styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.modal-overlay.active {
  display: flex;
  opacity: 1;
}

.modal-container {
  background: var(--white);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-2xl);
  max-width: 800px;
  width: 100%;
  max-height: 90vh;
  overflow: hidden;
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.modal-overlay.active .modal-container {
  transform: scale(1);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-6);
  border-bottom: 1px solid var(--gray-200);
  background: var(--gray-50);
}

.modal-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gray-900);
  margin: 0;
}

.modal-close {
  background: none;
  border: none;
  padding: var(--space-2);
  border-radius: var(--radius-md);
  cursor: pointer;
  color: var(--gray-500);
  transition: var(--transition-normal);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  background: var(--gray-200);
  color: var(--gray-700);
}

.modal-close svg {
  width: 24px;
  height: 24px;
}

.modal-content {
  padding: var(--space-6);
  max-height: calc(90vh - 120px);
  overflow-y: auto;
  line-height: 1.6;
}

.modal-content h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--gray-900);
  margin: var(--space-6) 0 var(--space-3) 0;
}

.modal-content h3:first-child {
  margin-top: 0;
}

.modal-content h4 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--gray-800);
  margin: var(--space-4) 0 var(--space-2) 0;
}

.modal-content p {
  color: var(--gray-600);
  margin-bottom: var(--space-4);
}

.modal-content ul {
  color: var(--gray-600);
  margin-bottom: var(--space-4);
  padding-left: var(--space-6);
}

.modal-content li {
  margin-bottom: var(--space-2);
}

.modal-content strong {
  color: var(--gray-800);
  font-weight: 600;
}

/* Responsive Modal */
@media (max-width: 768px) {
  .modal-overlay {
    padding: var(--space-2);
  }
  
  .modal-container {
    max-height: 95vh;
  }
  
  .modal-header {
    padding: var(--space-4);
  }
  
  .modal-title {
    font-size: 1.25rem;
  }
  
  .modal-content {
    padding: var(--space-4);
    max-height: calc(95vh - 100px);
  }
  
  .modal-content h3 {
    font-size: 1.125rem;
  }
  
  .modal-content h4 {
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  .modal-overlay {
    padding: var(--space-1);
  }
  
  .modal-header {
    padding: var(--space-3);
  }
  
  .modal-content {
    padding: var(--space-3);
  }
}

/* Video Modal Styles */
.video-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(8px);
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.video-modal-overlay.active {
  display: flex;
  opacity: 1;
}

/* Sticky Video Popup */
.video-modal-overlay.sticky {
  background: transparent !important;
  backdrop-filter: none !important;
  align-items: flex-start !important;
  justify-content: flex-end !important;
  padding: 0 !important;
  pointer-events: none !important;
}

.video-modal-overlay.sticky .video-modal-container {
  position: fixed !important;
  top: 20px !important;
  right: 20px !important;
  width: 320px !important;
  max-width: 320px !important;
  max-height: 180px !important;
  transform: scale(1) !important;
  z-index: 10001 !important;
  pointer-events: auto !important;
  margin: 0 !important;
}

.video-modal-container {
  position: relative;
  width: 100%;
  max-width: 900px;
  max-height: 90vh;
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.video-modal-overlay.active .video-modal-container {
  transform: scale(1);
}

.video-modal-close {
  position: absolute;
  top: -50px;
  right: 0;
  background: rgba(255, 255, 255, 0.9);
  border: none;
  padding: var(--space-3);
  border-radius: 50%;
  cursor: pointer;
  color: var(--gray-700);
  transition: var(--transition-normal);
  z-index: 10001;
  display: flex;
  align-items: center;
  justify-content: center;
}

.video-modal-close:hover {
  background: var(--white);
  transform: scale(1.1);
}

.video-modal-close svg {
  width: 24px;
  height: 24px;
}

/* Sticky mode close button */
.video-modal-overlay.sticky .video-modal-close {
  top: -40px;
  right: 0;
  background: rgba(0, 0, 0, 0.8);
  color: var(--white);
  padding: var(--space-2);
}

.video-modal-overlay.sticky .video-modal-close:hover {
  background: rgba(0, 0, 0, 0.9);
}

.video-modal-overlay.sticky .video-modal-close svg {
  width: 20px;
  height: 20px;
}

.video-container-modal {
  position: relative;
  width: 100%;
  height: 0;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  background: var(--black);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-2xl);
}

.video-container-modal video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border: none;
}

/* Sticky mode video container */
.video-modal-overlay.sticky .video-container-modal {
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  border: 2px solid rgba(255, 255, 255, 0.1);
}

/* Responsive Video Modal */
@media (max-width: 768px) {
  .video-modal-overlay {
    padding: var(--space-2);
  }
  
  .video-modal-close {
    top: -40px;
    padding: var(--space-2);
  }
  
  .video-modal-close svg {
    width: 20px;
    height: 20px;
  }
  
  /* Sticky mode mobile */
  .video-modal-overlay.sticky .video-modal-container {
    width: 280px;
    max-width: 280px;
    max-height: 157px;
    top: var(--space-2);
    right: var(--space-2);
  }
}

@media (max-width: 480px) {
  .video-modal-overlay {
    padding: var(--space-1);
  }
  
  .video-modal-close {
    top: -35px;
    padding: var(--space-2);
  }
  
  .video-modal-close svg {
    width: 18px;
    height: 18px;
  }
  
  .video-container-modal {
    border-radius: var(--radius-lg);
  }
  
  /* Sticky mode small mobile */
  .video-modal-overlay.sticky .video-modal-container {
    width: 240px;
    max-width: 240px;
    max-height: 135px;
    top: var(--space-1);
    right: var(--space-1);
  }
}

