/* ============================================================
   MODAL — Netflix-Style Project Detail Overlay
   ============================================================ */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  padding: 20px;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  background: var(--dark);
  border-radius: var(--radius-md);
  overflow: hidden;
  width: 100%;
  max-width: 900px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 10px 50px rgba(0, 0, 0, 0.9);
  transform: scale(0.9) translateY(20px);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.modal-overlay.open .modal {
  transform: scale(1) translateY(0);
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 10;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.7);
  border: none;
  color: var(--white);
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

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

.modal-hero {
  position: relative;
  padding: 60px 48px 40px;
  overflow: hidden;
}

.modal-hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(to top, var(--dark), transparent);
}

.modal-hero-title {
  position: relative;
  z-index: 1;
  font-size: clamp(1.8rem, 3vw, 2.8rem);
  font-weight: 900;
}

.modal-hero-subtitle {
  position: relative;
  z-index: 1;
  color: var(--muted);
  font-size: 1.1rem;
  margin-top: 8px;
}

.modal-body {
  padding: 0 48px 48px;
  margin-top: -20px;
  position: relative;
  z-index: 2;
}

.modal-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.modal-match {
  color: #46d369;
  font-weight: 700;
}

.modal-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 20px;
}

.modal-description {
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 24px;
}

.modal-section {
  margin-bottom: 24px;
}

.modal-section h3 {
  font-size: 1rem;
  margin-bottom: 8px;
  color: var(--white);
}

.modal-section p {
  font-size: 0.9rem;
}

.modal-buttons {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.modal-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.modal-detail-item h4 {
  font-size: 0.8rem;
  color: var(--subtle);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.modal-detail-item p {
  font-size: 0.9rem;
}

@media (max-width: 768px) {
  .modal-hero { padding: 40px 24px 30px; }
  .modal-body { padding: 0 24px 32px; }
}
