/* Color Scheme:

   Dark Green: #224C25
   Light Green: #CAE894
   Very Light (Background): #F9F9F9
   Lavender Purple: #AF95E2
   Dark Purple: #3E0B5E

*/

/* Global Styles */

body {
  background: #f9f9f9;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: #333;
  margin: 0;
  padding: 0;
}

/* Header */

#header {
  background: #224c25;
  padding: 20px 0;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

#header img {
  max-height: 80px;
  width: auto;
}

/* Main Container */

#container {
  display: flex;
  flex-direction: column;
  max-width: 100%;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  /* box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); */
}

/* Filters Sidebar */

#filters {
  background: #F6F0E4;
  padding: 30px 20px;
  color: #224c25;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  /* grid-template-columns: repeat(3, 1fr); */
  gap: 20px;
  border: solid 1.5px #af95e2;
  border-radius: 8px;
}

#filters h2 {
  margin-top: 0;
  font-size: 1.3em;
  color: #3e0b5e;
}

/* Filter Groups */

.filter-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #af95e2;
}

/* Multi-select Container */

.multi-select-container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  border: 1px solid #ccc;
  /* padding: 8px; */
  border-radius: 6px;
  background: #e2deea;
  position: relative;
  transition: border-color 0.2s;
}

.number-input-container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding-top: 4px;
  padding-bottom: 4px;
  border: 1px solid #ccc;
  border-radius: 6px;
  background: #e2deea;
  position: relative;
  transition: border-color 0.2s;
}

.number-input-container:focus-within {
  border-color: #af95e2;
}

.multi-select-container:focus-within {
  border-color: #af95e2;
}

.selected-options {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
}

.multi-select-input {
  flex: 1 1 auto;
  min-width: 100px;
  border: none!important;
  outline: none;
  padding: 5px;
  background: none;
  font-size: 1em;
}

.chip {
  background: #af95e2;
  color: #fff;
  padding: 4px 10px;
  border-radius: 5px;
  display: flex;
  align-items: center;
  font-size: 0.85em;
}

.chip .remove-chip {
  margin-left: 6px;
  cursor: pointer;
  font-weight: bold;
}

.dropdown-options {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  border: 1px solid #ccc;
  background: #fff;
  z-index: 1000;
  max-height: 180px;
  overflow-y: auto;
  display: none;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.dropdown-options div {
  padding: 8px 12px;
  cursor: pointer;
  transition: background 0.2s;
}

.dropdown-options div:hover {
  background: #af95e2;
  color: #fff;
}

/* Numeric Inputs */

input[type="number"] {
  width: 100%;
  padding: 8px 20px;
  /* margin-top: 5px; */
  border: none;
  border-radius: 6px;
  font-size: 1em;
  background: #e2deea;
}

input[type="number"]:focus {
  border: none;
  outline: none;
}

/* Results Area */

#results {
  padding: 30px 20px;
  background: #F6F0E4;
}

/* Program Grid */

#programList {
  display: grid;
  /* grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); */
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  /* margin-top: 20px; */
}

/* Program Card */

.program {
  background: #fff;
  border: 1px solid #af95e2;
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.2s ease;
}

.program:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Program Image and Overlay */

.program-image-container {
  position: relative;
}

.program-image-container img {
  width: 100%;
  height: auto;
  object-fit: cover;
}

.program-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #fff;
  font-size: 1.2em;
  font-weight: bold;
  text-align: center;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7);
}

/* Program Details */

.program-details {
  padding: 15px;
}

.program-details p {
  margin: 0;
  font-size: 0.95em;
  color: #555;
}

.program-details ul {
  list-style: none;
  padding: 0;
  margin: 10px 0 0 0;
  font-size: 0.9em;
}

.program-details li {
  margin-bottom: 5px;
}

/* Input Reset */

input[type="text"]::-webkit-clear-button,
input[type="text"]::-webkit-search-cancel-button,
input[type="text"]::-webkit-search-decoration,
input[type="text"]::-webkit-search-results-button,
input[type="text"]::-webkit-search-results-decoration {
  display: none;
}

input[type="text"]::-ms-clear,
input[type="text"]::-ms-reveal {
  display: none;
  width: 0;
  height: 0;
}

input[type="text"] {
  appearance: none;
}

/* Program Buttons */

#program-buttons {
  display: flex;
  justify-content: space-between;
  margin-top: 15px;
}

#program-buttons button {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  padding: 10px 16px;
  border: none;
  border-radius: 6px;
  color: #fff;
  cursor: pointer;
  font-size: 0.95em;
  transition: background-color 0.2s ease;
}

.toggle-info {
  background-color: #af95e2;
  width: 150px;
}

.toggle-info:hover {
  background-color: #9c82d0;
}

.apply-button {
  background-color: #3e0b5e;
  width: 100px;
}

.apply-button:hover {
  background-color: #2f0846;
}

.mobile-toggle-btn {
  display: none;
  position: fixed;
  bottom: 20px;
  right: 20px;
  background-color: #af95e2;
  color: white;
  border: none;
  border-radius: 50px;
  padding: 12px 16px;
  font-size: 14px;
  z-index: 9999;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  cursor: pointer;
}

.mobile-filters {
  display: none;
  position: fixed;
  /* top: 0; */
  left: 0;
  right: 0;
  bottom: 0;
  background: #fff;
  z-index: 9998;
  padding: 16px;
  overflow-y: auto;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.3);
}

.mobile-filters.active {
  display: block;
}

.mobile-filters-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.mobile-filters-header h3 {
  margin: 0;
}

#closeMobileFilters {
  background: none;
  border: none;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  color: #444;
}

@media (max-width: 768px) {
  .mobile-toggle-btn {
    display: block;
  }
}

@media (max-width: 768px) {
  .mobile-toggle-btn {
    display: block;
  }

  #filters {
    display: none;
  }

  .filter-group {
    margin-bottom: 15px;
  }

  #programList {
    grid-template-columns: 1fr;
  }

  .program {
    margin: 0 auto;
    max-width: 95%;
  }
}

.program-card {
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  padding: 16px;
  margin: 16px 0;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
  background: #fff;
  max-width: 700px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.program-top-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 10px;
}

.program-image img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
}

.program-header-text {
  flex: 1;
}

.header-line {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.application-badge {
  background: #d2f0cb;
  color: #2b7a0b;
  padding: 4px 8px;
  border-radius: 5px;
  font-size: 0.75rem;
  font-weight: bold;
}

.university-name {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 600;
  color: #333;
}

.location {
  margin: 4px 0 0;
  font-size: 0.9rem;
  color: #666;
}

.description {
  font-size: 0.9rem;
  color: #444;
  margin: 12px 0;
  line-height: 1.5;
}

.buttons {
  display: flex;
  gap: 10px;
}

.info-btn,
.apply-btn {
  font-weight: 700!important;
  width: 50%!important;
  border: none!important;
  padding: 8px 16px!important;
  border-radius: 6px!important;
  font-weight: 500!important;
  cursor: pointer!important;
  font-size: 0.9rem!important;
}

.info-btn {
  background: #f3f3f3!important;
  color: #8e62f2!important;
  border: solid 1px #8e62f2!important;
}

.info-btn:hover {
  background: #8e62f2!important;
  color: white!important;
  border-color: #8e62f2!important;
}

.apply-btn {
  background: #8e62f2!important;
  color: white!important;
}

.apply-btn:hover {
  background: #754fd1!important; /* Slightly darker purple */
}

/* Overlay and base modal styles */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  font-family: 'Arial', sans-serif;
}
.modal.show {
  display: flex;
}
.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
}
.modal-box {
  background: #fff;
  z-index: 1001;
  max-width: 600px;
  width: 90%;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
  animation: fadeIn 0.3s ease;
}
@keyframes fadeIn {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.modal-header {
  display: flex;
  gap: 15px;
  padding: 20px;
  background: #f8f8f8;
  align-items: center;
  position: relative;
  flex-wrap: wrap;
}

.modal-header img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 10px;
}

.modal-title-area {
  flex: 1;
  min-width: 150px;
}
.modal-header h2 {
  margin: 0;
  font-size: 1.2rem;
}
.modal-body {
  padding: 20px;
}
.modal-body p {
  margin: 10px 0;
  line-height: 1.4;
}
.modal-description {
  background: #f3f3f3;
  padding: 10px;
  border-radius: 6px;
  font-size: 0.95rem;
}
.modal-footer {
  padding: 15px 20px;
  text-align: right;
  background: #fafafa;
}
.modal-close {
  font-size: 24px;
  background: none;
  border: none;
  cursor: pointer;
  color: #666;
  position: absolute;
  right: 20px;
  top: 20px;
  line-height: 1;
  padding: 5px;
}

.modal-close:hover {
  color: red;
}
@media (max-width: 500px) {
  .modal-box {
      width: 95%;
  }
  .modal-header {
      flex-direction: column;
      text-align: center;
  }
  .modal-header img {
      width: 60px;
      height: 60px;
  }
}
