/* ================================
   MODAL COMPONENT
   Overlay modals for additional content
   ================================ */

/* Modal Overlay */
.modal {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal.active {
  display: flex;
}

.modal__overlay {
  position: absolute;
  inset: 0;
  background: var(--overlay-dark);
  backdrop-filter: var(--blur-lg);
  cursor: pointer;
}

/* Modal Content */
.modal__container {
  position: relative;
  z-index: 1;
  max-width: 800px;
  width: 100%;
  max-height: 90vh;
  background: var(--card-bg);
  border-radius: var(--radius-2xl);
  border: 1px solid var(--border-medium);
  box-shadow: var(--shadow-2xl), var(--shadow-glass);
  overflow: hidden;
  animation: modalSlideIn 0.3s var(--transition-base);
}

/* Modal Image Container */
.modal__image-container {
  width: 100%;
  margin-bottom: 24px;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.modal__pagespeed-image {
  width: 100%;
  height: auto;
  display: block;
}

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

/* Modal Header */
.modal__header {
  padding: 30px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.modal__title {
  font-size: var(--text-3xl);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
  margin: 0;
}

.modal__close {
  width: 36px;
  height: 36px;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: var(--text-4xl);
  cursor: pointer;
  transition: all var(--transition-fast);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  line-height: 1;
  padding: 0;
}

.modal__close:hover {
  background: rgba(255, 77, 77, 0.1);
  color: var(--color-error);
  transform: rotate(90deg);
}

/* Modal Body */
.modal__body {
  padding: 30px;
  overflow-y: auto;
  max-height: calc(90vh - 100px);
}

.modal__body ul {
  list-style: none;
  padding: 0;
  margin: 24px 0;
}

.modal__body li {
  padding: 10px 0 10px 28px;
  border-bottom: 1px solid var(--border-subtle);
  font-size: var(--text-base);
  color: var(--text-secondary);
  position: relative;
}

.modal__body li:last-child {
  border-bottom: none;
}

.modal__body li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--accent-secondary);
  font-weight: var(--weight-bold);
  font-size: var(--text-lg);
}

.modal__body li strong {
  color: var(--text-primary);
  display: block;
  margin-bottom: 4px;
}

.modal__note {
  margin-top: 24px;
  padding: 16px;
  background: var(--glass-teal-hover-subtle);
  border-left: 4px solid var(--accent-primary);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: var(--line-height-relaxed);
}

.modal__note strong {
  color: var(--accent-primary);
}

.modal__cta {
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: center;
}

/* Mobile Adjustments */
@media (max-width: 768px) {
  .modal__container {
    max-height: 95vh;
    margin: 10px;
  }

  .modal__header {
    padding: 20px;
  }

  .modal__body {
    padding: 20px;
    max-height: calc(95vh - 80px);
  }

  .modal__title {
    font-size: var(--text-2xl);
  }
}
