/**
 * Modal/Overlay Styles
 * Extracted from base.html for better organization
 *
 * Usage: Dialogs, popups, and overlay panels
 * Classes: .modal-overlay, .modal, .modal-header, .modal-body, .modal-footer
 */

/* Modal Overlay - Proper centering */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal-overlay.hidden {
  display: none;
}

/* Modal Container - Responsive sizing and scrolling */
.modal {
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  animation: modalSlideIn 0.3s ease-out;
}

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

/* Modal Header - Fixed at top */
.modal-header {
  padding: 24px 24px 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.modal-header h3 {
  font-size: 20px;
  font-weight: 600;
  color: #1f2937;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Modal Subtitle */
.modal-subtitle {
  padding: 8px 24px 0 24px;
  color: #6b7280;
  font-size: 14px;
  line-height: 1.5;
  flex-shrink: 0;
}

/* Modal Body - Scrollable content */
.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

/* Modal Footer - Fixed at bottom */
.modal-footer {
  padding: 20px 24px 24px 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid #f3f4f6;
  flex-shrink: 0;
}

/* Sub Link */
.modal-sub-link {
  text-align: center;
  padding: 0 24px 24px 24px;
  font-size: 13px;
  color: #6b7280;
  flex-shrink: 0;
}

/* Close Button Styling */
.close-btn {
  background: none;
  border: none;
  font-size: 24px;
  color: #9ca3af;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: all 0.2s ease;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.close-btn:hover {
  background: #f3f4f6;
  color: #6b7280;
}

/* Button styles used in modals */
.btn-outline:hover {
  background: #f9fafb;
  border-color: #9ca3af;
}

.btn-primary {
  background: #059669;
  color: white;
}

.btn-primary:hover {
  background: #047857;
}

/* Mobile Responsive */
@media (max-width: 640px) {
  .modal-overlay {
    padding: 16px;
  }

  .modal {
    max-height: 95vh;
  }

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

  .modal-subtitle {
    padding: 8px 20px 0 20px;
  }

  .modal-body {
    padding: 20px;
  }

  .modal-footer {
    padding: 16px 20px 20px 20px;
    flex-direction: column;
  }

  .btn {
    padding: 14px 20px;
  }

  .modal-sub-link {
    padding: 0 20px 20px 20px;
  }
}
