/* ===================================
   Terms & Conditions Modal
   =================================== */

.terms-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 9998;
  animation: fadeIn 0.2s ease;
}

.terms-modal-overlay.fade-out {
  animation: fadeOut 0.2s ease;
}

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

@keyframes fadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

.terms-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--snow-white);
  border-radius: var(--radius-lg);
  max-width: 700px;
  width: 90%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  z-index: 9999;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    transform: translate(-50%, calc(-50% + 30px));
    opacity: 0;
  }
  to {
    transform: translate(-50%, -50%);
    opacity: 1;
  }
}

/* Header */
.terms-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-lg);
  border-bottom: 1px solid var(--border-light);
  flex-shrink: 0;
}

.terms-modal-title {
  font-size: var(--text-xlarge);
  font-weight: var(--weight-bold);
  color: var(--text-primary);
  margin: 0;
}

.terms-modal-close {
  background: none;
  border: none;
  font-size: 32px;
  line-height: 1;
  color: var(--text-secondary);
  cursor: pointer;
  padding: var(--space-xs);
  min-width: 40px;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  transition: all var(--duration-fast) var(--ease-smooth);
}

.terms-modal-close:hover {
  background: var(--bg-overlay);
  color: var(--lake-blue);
}

.terms-modal-close:active {
  transform: scale(0.95);
}

/* Content */
.terms-modal-content {
  overflow-y: auto;
  padding: var(--space-lg);
  flex: 1;
  -webkit-overflow-scrolling: touch;
}

/* Scrollbar styling */
.terms-modal-content::-webkit-scrollbar {
  width: 8px;
}

.terms-modal-content::-webkit-scrollbar-track {
  background: transparent;
}

.terms-modal-content::-webkit-scrollbar-thumb {
  background: var(--stone-grey);
  border-radius: var(--radius-sm);
}

.terms-modal-content::-webkit-scrollbar-thumb:hover {
  background: var(--lake-blue);
}

/* Terms Sections */
.terms-section {
  margin-bottom: var(--space-xl);
}

.terms-section:last-child {
  margin-bottom: var(--space-md);
}

.terms-section h3 {
  font-size: var(--text-large);
  font-weight: var(--weight-semibold);
  color: var(--lake-blue);
  margin: 0 0 var(--space-sm) 0;
}

.terms-section p {
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0;
}

/* Last Updated */
.terms-last-updated {
  margin-top: var(--space-lg);
  padding-top: var(--space-md);
  border-top: 1px solid var(--border-light);
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  font-style: italic;
  text-align: center;
}

/* Prevent body scroll when modal is open */
body.modal-open {
  overflow: hidden;
}

/* Responsive */
@media (max-width: 768px) {
  .terms-modal-overlay {
    padding: 0;
    align-items: flex-start;
  }

  .terms-modal {
    max-height: 100vh;
    border-radius: 0;
    min-height: 100vh;
  }

  .terms-modal-header {
    padding: var(--space-md);
  }

  .terms-modal-content {
    padding: var(--space-md);
  }

  .terms-modal-title {
    font-size: var(--text-large);
  }
}

@media (max-width: 480px) {
  .terms-modal-header {
    padding: var(--space-sm) var(--space-md);
  }

  .terms-modal-content {
    padding: var(--space-sm) var(--space-md);
  }

  .terms-modal-close {
    font-size: 28px;
  }

  .terms-section h3 {
    font-size: var(--text-base);
  }

  .terms-section p {
    font-size: var(--text-sm);
  }
}

/* Modal animations */
.terms-modal.active {
  opacity: 1;
}
