/* ===== Base Styles ===== */
body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  color: #333;
  background-color: #f9fafb;
  margin: 0;
  padding: 0;
}

/* ===== Wrapper and Form ===== */
.mvp-tech-stack-selector {
  width: 100%;
  margin: 0 auto;
  font-family: "Poppins", sans-serif;
  background: #fff;
  padding: 30px;
}

#tech-stack-form {
  width: 50%;
  margin: 0 auto;
}

.stack-selector-heading,
.mvp-tech-stack-selector h2 {
  color: #002f87;
  text-align: center;
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.mvp-tech-stack-selector p {
  font-size: 16px;
  margin-bottom: 20px;
  color: #002f87;
  text-align: center;
}

#view_stack {
  background-color: #002f87;
  color: white;
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.2s ease;
  margin-top: 10px;
}

#view_stack:hover {
  background-color: #0140b8;
}

/* ===== Modal Overlay ===== */
.modal {
  display: none;
  position: fixed;
  z-index: 3000;
  left: 0; top: 0;
  width: 100%; height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

/* ===== Modal Content ===== */
.stack-modal-content {
  background-color: #fff;
  margin: 8% auto;
  padding: 30px 40px;
  border-radius: 12px;
  max-width: 45%;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  position: relative;
  animation: fadeInScale 0.3s ease forwards;
  overflow-x: auto;
}

.stack-modal-content h3 {
  margin-bottom: 20px;
  font-weight: 700;
  font-size: 1.8rem;
  color: #002f87;
  border-bottom: 2px solid #002f87;
  padding-bottom: 8px;
  text-align: center;
}

/* ===== Modal Close Button ===== */
.modal-close {
  position: absolute;
  top: 18px;
  right: 25px;
  font-size: 28px;
  font-weight: bold;
  color: #888;
  cursor: pointer;
  transition: color 0.3s ease;
}

.modal-close:hover {
  color: #000;
}

/* ===== Table Styling ===== */
.stack-modal-content table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 12px;
  box-shadow: 0 0 8px rgba(0,0,0,0.1);
  background-color: #fafafa;
  border-radius: 3px;
  overflow: hidden;
  font-size: 1rem;
  color: #333;
  min-width: 450px;
  border: 1px #ccc;
}

.stack-modal-content thead tr {
  background-color: #002f87;
  color: white;
  font-weight: 600;
  text-align: left;
}

.stack-modal-content thead th {
  padding: 12px 15px;
  width: 13%;
  border: 1px solid #ccc;
}

.stack-modal-content tbody tr {
  background-color: #fff;
  transition: background-color 0.25s ease;
  border-radius: 8px;
  border: 1px solid #ccc;
}

.stack-modal-content tbody tr:hover {
  background-color: #f1f9f1;
}

.stack-modal-content tbody td {
  padding: 14px 15px;
  vertical-align: middle;
  border: 1px solid #ccc !important;
}

.stack-modal-content tbody tr.total-row {
  font-weight: 700;
  background-color: #e6f4ea;
  border-top: 2px solid #002f87;
}

.stack-modal-content tbody tr.total-row td:first-child {
  text-align: right;
  padding-right: 10px;
}

/* ===== Animation ===== */
@keyframes fadeInScale {
  0% {
    opacity: 0;
    transform: scale(0.8);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* ===== Responsive Fixes ===== */
@media (max-width: 768px) {
  #tech-stack-form {
    width: 100%;
    padding: 0 10px;
  }

  .stack-modal-content {
    max-width: 95%;
    padding: 20px 25px;
    margin: 15% auto;
  }

  .stack-modal-content h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
  }

  .stack-modal-content table {
    font-size: 0.9rem;
    min-width: unset;
    overflow-x: auto;
  }

  .stack-modal-content table thead th,
  .stack-modal-content table tbody td {
    padding: 10px 8px;
  }

  .modal-close {
    top: 12px;
    right: 15px;
    font-size: 24px;
  }
}

@media (max-width: 400px) {
  .stack-modal-content {
    padding: 15px;
    margin: 20% auto;
  }

  .stack-modal-content h3 {
    font-size: 1.3rem;
  }

  .stack-modal-content table {
    font-size: 0.85rem;
  }

  #view_stack {
    width: 100%;
    font-size: 15px;
    padding: 10px;
  }
}
