* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: #f5f7fb;
  color: #222;
}

.app {
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  padding: 40px 20px;
}


/* Header */

header {
  text-align: center;
  margin-bottom: 30px;
}

.logo {
  font-size: 45px;
}

header h1 {
  margin: 5px 0 8px;
  font-size: 32px;
}

header p {
  margin: 0;
  color: #666;
}


/* ปุ่มเพิ่ม */

.add-btn {
  width: 100%;
  padding: 17px;
  border: none;
  border-radius: 14px;
  background: #111827;
  color: white;
  font-size: 17px;
  font-weight: bold;
  cursor: pointer;
}

.add-btn:hover {
  opacity: 0.9;
}


/* Summary */

.summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
  margin: 25px 0;
}

.summary-card {
  background: white;
  padding: 20px;
  border-radius: 16px;
  text-align: center;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.06);
}

.summary-card span {
  color: #666;
}

.summary-card strong {
  display: block;
  margin-top: 8px;
  font-size: 30px;
}


/* รายการมหาวิทยาลัย */

#universityList {
  display: grid;
  gap: 18px;
}


/* การ์ดมหาวิทยาลัย */

.university-card {
  background: white;
  padding: 24px;
  border-radius: 18px;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.06);
}

.university-card h2 {
  margin-top: 0;
  margin-bottom: 15px;
}

.university-card p {
  margin: 9px 0;
  line-height: 1.5;
}


/* สถานะ */

.status {
  display: inline-block;
  padding: 8px 14px;
  border-radius: 20px;
  background: #fff3cd;
  margin: 10px 0;
  font-weight: bold;
}


/* ปุ่มในการ์ด */

.card-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.card-actions button {
  border: none;
  padding: 10px 15px;
  border-radius: 9px;
  cursor: pointer;
  font-size: 14px;
}

.website-btn {
  background: #e0f2fe;
  color: #075985;
}

.delete-btn {
  background: #fee2e2;
  color: #991b1b;
}


/* Modal */

.modal {
  display: none;

  position: fixed;

  inset: 0;

  background: rgba(0, 0, 0, 0.45);

  justify-content: center;

  align-items: center;

  padding: 20px;

  z-index: 100;
}

.modal.show {
  display: flex;
}


/* กล่องฟอร์ม */

.modal-box {
  width: 100%;
  max-width: 550px;

  max-height: 90vh;

  overflow-y: auto;

  background: white;

  border-radius: 20px;

  padding: 30px;

  position: relative;
}

.modal-box h2 {
  margin-top: 0;
  margin-bottom: 8px;
}

.modal-description {
  color: #777;
  margin-bottom: 25px;
}


/* ปุ่ม X */

.close-btn {
  position: absolute;

  right: 18px;

  top: 12px;

  border: none;

  background: none;

  font-size: 30px;

  cursor: pointer;

  color: #666;
}


/* Form */

label {
  display: block;

  margin-top: 16px;

  margin-bottom: 7px;

  font-weight: bold;
}

input,
select,
textarea {
  width: 100%;

  padding: 12px;

  border: 1px solid #ddd;

  border-radius: 10px;

  font-size: 15px;

  font-family: inherit;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;

  border-color: #777;
}

textarea {
  min-height: 100px;

  resize: vertical;
}


/* วันที่ */

.date-section {
  margin-top: 5px;
}


/* ปุ่มฟอร์ม */

.form-buttons {
  display: flex;

  gap: 10px;

  margin-top: 25px;
}

.form-buttons button {
  flex: 1;

  padding: 14px;

  border: none;

  border-radius: 10px;

  font-size: 16px;

  cursor: pointer;
}

.cancel-btn {
  background: #eeeeee;
}

.save-btn {
  background: #111827;

  color: white;
}


/* มือถือ */

@media (max-width: 600px) {

  .app {
    padding: 25px 15px;
  }

  header h1 {
    font-size: 26px;
  }

  .summary {
    grid-template-columns: 1fr;
  }

  .modal-box {
    padding: 24px 20px;
  }

}