/* ===== MODAL BASE STYLES ===== */

/* Base Modal Structure */
.modal-base {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.modal-base.active {
  opacity: 1;
  visibility: visible;
}

/* Base Modal Overlay */
.modal-base .modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
  cursor: pointer;
}

/* Base Modal Content */
.modal-base .modal-content {
  position: relative;
  background: white;
  border-radius: 20px;
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.modal-base.active .modal-content {
  transform: scale(1);
}

/* Base Modal Header */
.modal-base .modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 32px;
  border-bottom: 1px solid #e5e7eb;
}

.modal-base .modal-header h2 {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
}

.modal-base .modal-close {
  background: none;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--muted);
  transition: all 0.2s ease;
}

.modal-base .modal-close:hover {
  background: rgba(5, 150, 105, 0.1);
  color: var(--brand);
  transform: rotate(90deg);
}

/* Base Modal Body */
.modal-base .modal-body {
  padding: 32px;
  overflow-y: auto;
  max-height: calc(90vh - 100px);
}

.modal-base .modal-subtitle {
  text-align: center;
  font-size: 18px;
  color: var(--muted);
  margin-bottom: 32px;
  font-weight: 500;
}

/* Base Back Button */
.modal-base .back-btn {
  background: none;
  border: 2px solid var(--brand);
  color: var(--brand);
  padding: 10px 20px;
  border-radius: 25px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.modal-base .back-btn:hover {
  background: var(--brand);
  color: white;
  transform: translateX(-4px);
}

/* Base Card Styles */
.modal-base .card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  max-width: 1200px;
  margin: 0 auto;
}

.modal-base .card-item {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0.7) 100%);
  border: 2px solid rgba(5, 150, 105, 0.1);
  border-radius: 20px;
  padding: 32px 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
}

.modal-base .card-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-hover) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
  border-radius: 18px;
}

.modal-base .card-item:hover::before {
  opacity: 0.05;
}

.modal-base .card-item:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(5, 150, 105, 0.2);
  border-color: var(--brand);
}

.modal-base .card-icon {
  margin: 0 auto 20px;
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, var(--brand-light) 0%, rgba(5, 150, 105, 0.1) 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
}

.modal-base .card-item h3 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 12px 0;
  position: relative;
  z-index: 1;
}

.modal-base .card-item p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
  margin: 0 0 16px 0;
  position: relative;
  z-index: 1;
}

.modal-base .card-badge {
  background: var(--brand-light);
  color: var(--brand);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  display: inline-block;
  position: relative;
  z-index: 1;
}

/* Base Header with Back Button */
.modal-base .section-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 32px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(5, 150, 105, 0.1);
}

.modal-base .section-header h3 {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
}

/* Base Responsive Design */
@media (max-width: 768px) {
  .modal-base .modal-content {
    max-width: 95vw;
    max-height: 95vh;
    margin: 20px;
  }

  .modal-base .modal-header {
    padding: 20px 24px;
  }

  .modal-base .modal-header h2 {
    font-size: 24px;
  }

  .modal-base .modal-body {
    padding: 24px 20px;
  }

  .modal-base .card-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .modal-base .card-item {
    padding: 24px 20px;
  }

  .modal-base .card-item h3 {
    font-size: 20px;
  }

  .modal-base .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .modal-base .section-header h3 {
    font-size: 20px;
  }
}

@media (max-width: 480px) {
  .modal-base .modal-content {
    border-radius: 16px;
  }

  .modal-base .modal-header {
    padding: 16px 20px;
  }

  .modal-base .modal-header h2 {
    font-size: 20px;
  }

  .modal-base .modal-body {
    padding: 20px 16px;
  }

  .modal-base .card-item {
    padding: 20px 16px;
  }
}

/* Utility Classes */
.modal-base .hidden {
  display: none;
}

.modal-base .visible {
  display: block;
}

.modal-base .flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-base .text-center {
  text-align: center;
}

.modal-base .mb-0 { margin-bottom: 0; }
.modal-base .mb-1 { margin-bottom: 8px; }
.modal-base .mb-2 { margin-bottom: 16px; }
.modal-base .mb-3 { margin-bottom: 24px; }
.modal-base .mb-4 { margin-bottom: 32px; }

.modal-base .mt-0 { margin-top: 0; }
.modal-base .mt-1 { margin-top: 8px; }
.modal-base .mt-2 { margin-top: 16px; }
.modal-base .mt-3 { margin-top: 24px; }
.modal-base .mt-4 { margin-top: 32px; }
