/* Modal Overlay */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 90%;
  background: rgba(10, 10, 35, 0.9);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  backdrop-filter: blur(8px);
}

/* Modal Content */
.modal-content {
  background: var(--dark-secondary);
  border-radius: 12px;
  max-width: 900px;
  width: 90%;
  display: flex;
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.4);
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Left Content */
.modal-left {
  flex: 1;
  padding: 40px;
  color: var(--light-text);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.modal-title {
  font-size: 2rem;
  margin-bottom: 20px;
  color: var(--primary);
}

.modal-text {
  font-size: 1rem;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 30px;
}

/* Right Image */
.modal-right {
  flex: 1;
  background: var(--card-bg);
}

.modal-right img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Close Button */
.modal-close {
  position: absolute;
  top: 15px;
  right: 15px;
  background: #f65c5c;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  border-radius: 50%;
  width: 40px;
  height: 40px;
}

@media (max-width: 650px) {
  .modal-overlay {
    align-items: flex-start;   /* Start from top */
    padding: 20px 0;
    height: 100%;
    overflow-y: auto;
  }
  .modal-content {
    flex-direction: column-reverse;
    margin: 20px auto;
  }

  .modal-close {
    position: fixed;     /* Make it fixed to viewport */
    top: 10px;           /* Stick to top */
    right: 10px;         /* Stick to right */
    z-index: 5000;       /* Always on top of everything */
  }
}


