@import url('https://fonts.googleapis.com/css2?family=Sora:wght@300;400;600;700&display=swap');

/* ══════════════════════════════════════════
   CSS VARIABLES
══════════════════════════════════════════ */
:root {
  --blue:      #4281aa;
  --blue-dark: #336690;
  --yellow:    #ffeda3;
  --white:     #ffffff;
  --black:     #000000;
  --border:    #d0d7de;
  --bg-row:    #f6f8fa;
  --text-muted:#888888;

  --radius:    6px;
  --shadow:    0 1px 8px rgba(0,0,0,0.07);

  /* spacing scale */
  --space-xs:  8px;
  --space-sm:  16px;
  --space-md:  24px;
  --space-lg:  40px;
  --space-xl:  64px;

  /* font scale */
  --text-xs:   11px;
  --text-sm:   13px;
  --text-base: 14px;
  --text-md:   16px;
  --text-lg:   20px;
  --text-xl:   24px;
  --text-2xl:  30px;
  --text-3xl:  32px;
}

/* ══════════════════════════════════════════
   RESET & BASE
══════════════════════════════════════════ */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Sora', sans-serif;
  background-color: var(--yellow);
  color: var(--blue);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  -webkit-text-size-adjust: 100%;
}

main { flex: 1; }

img, video {
  max-width: 100%;
  display: block;
}

/* ══════════════════════════════════════════
   HEADER
══════════════════════════════════════════ */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-sm) var(--space-lg);
  background-color: var(--blue);
  position: sticky;
  top: 0;
  z-index: 1000;
}

/* ══════════════════════════════════════════
   LOGO
══════════════════════════════════════════ */
.logo {
  font-size: var(--text-xl);
  font-weight: 700;
  letter-spacing: 4px;
  color: var(--yellow);
  text-transform: uppercase;
}

/* ══════════════════════════════════════════
   NAV LINKS
══════════════════════════════════════════ */
#main-nav {
  display: flex;
  gap: 32px;
}

#main-nav a {
  text-decoration: none;
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--yellow);
  letter-spacing: 2px;
  text-transform: uppercase;
  position: relative;
  transition: color 0.3s ease;
}

#main-nav a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0%;
  height: 2px;
  background-color: var(--yellow);
  transition: width 0.3s ease;
}

#main-nav a:hover::after { width: 100%; }

/* ══════════════════════════════════════════
   HAMBURGER BUTTON
══════════════════════════════════════════ */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background-color: var(--yellow);
  border-radius: 2px;
  transition: all 0.3s ease;
}

.hamburger.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ══════════════════════════════════════════
   PAGE HEADING
══════════════════════════════════════════ */
h1 {
  text-align: center;
  margin-top: var(--space-xl);
  font-size: var(--text-3xl);
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--blue);
}

/* ══════════════════════════════════════════
   INTERNS SECTION
══════════════════════════════════════════ */
.interns-section {
  padding: 32px var(--space-lg) 48px;
}

.section-title {
  font-size: var(--text-2xl);
  font-weight: 700;
  text-align: center;
  text-transform: uppercase;
  color: var(--black);
  margin-bottom: 20px;
}

/* ══════════════════════════════════════════
   TABLE WRAPPER
══════════════════════════════════════════ */
.interns-grid {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  background: var(--white);
  text-align: left;
  margin: 0 15%;
}

/* ══════════════════════════════════════════
   TABLE
══════════════════════════════════════════ */
.interns-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-lg);
  background: var(--white);
  min-width: 600px; /* prevents squishing on small screens */
}

.interns-table thead {
  background-color: #f0f3f6;
  border-bottom: 2px solid #c8d0db;
  position: sticky;
  top: 0;
  z-index: 10;
}

.interns-table th {
  text-align: center;
  padding: 11px 14px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--black);
  white-space: nowrap;
  border-right: 1px solid var(--border);
  user-select: none;
}

.interns-table th:last-child { border-right: none; }

.interns-table tbody tr {
  border-bottom: 1px solid #e8ecf0;
  transition: background-color 0.15s ease;
  animation: rowFade 0.3s ease forwards;
  opacity: 0;
}

.interns-table tbody tr:last-child { border-bottom: none; }
.interns-table tbody tr:nth-child(even) { background-color: var(--bg-row); }
.interns-table tbody tr:nth-child(odd)  { background-color: var(--white); }
.interns-table tbody tr:hover { background-color: #dbeafe !important; cursor: pointer; }

.interns-table td {
  padding: 10px 14px;
  color: var(--black);
  white-space: nowrap;
  border-right: 1px solid #e8ecf0;
}

.interns-table td:last-child { border-right: none; }

.td-name { text-align: left; color: var(--black); }

/* ══════════════════════════════════════════
   TABLE FOOTER
══════════════════════════════════════════ */
.table-footer {
  padding: 8px 14px;
  background-color: #f0f3f6;
  border-top: 1px solid var(--border);
  font-size: var(--text-xs);
  color: var(--text-muted);
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* ══════════════════════════════════════════
   STATUS MESSAGE
══════════════════════════════════════════ */
.status-msg {
  text-align: center;
  color: var(--text-muted);
  font-size: var(--text-sm);
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 48px 0;
}

/* ══════════════════════════════════════════
   FOOTER
══════════════════════════════════════════ */
footer {
  display: flex;
  flex-direction: column;
  background-color: var(--blue);
  padding: 48px var(--space-lg) 24px;
  border-top: 1px solid #2a2a2a;
  margin-top: auto;
}

.top {
  display: flex;
  justify-content: space-between;
  gap: 48px;
  padding-bottom: 32px;
  border-bottom: 1px solid #2a2a2a;
  margin: 0 25%;
}

.comment {
  flex: 1;
  line-height: 1.8;
  color: var(--yellow);
  font-size: var(--text-lg);
  max-width: 500px;
}

.comment h2,
.contact h2 {
  font-size: 25px;
  font-weight: 700;
  letter-spacing: 3px;
  color: var(--black);
  margin-bottom: 8px;
}

.contact {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 220px;
}

.contact p  { color: var(--yellow); font-size: var(--text-lg); }
.contact a  { text-decoration: none; color: var(--yellow); transition: color 0.3s ease; }
.contact a:hover { color: #0b23d2; }

.bottom { padding-top: 24px; text-align: center; }

.bottom p {
  font-size: var(--text-md);
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--black);
  line-height: 1.8;
}

/* ══════════════════════════════════════════
   ANIMATIONS
══════════════════════════════════════════ */
@keyframes rowFade {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ══════════════════════════════════════════
   MODAL & TOAST STYLES
══════════════════════════════════════════ */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.18s ease;
  padding: var(--space-sm);
}
.modal-overlay.open { display: flex; }

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.modal-box {
  background: var(--white);
  border-radius: 12px;
  width: 100%;
  max-width: 440px;
  margin: var(--space-sm);
  overflow: hidden;
  animation: slideUp 0.22s ease;
  font-family: 'Sora', sans-serif;
}

@keyframes slideUp {
  from { transform: translateY(24px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.modal-header {
  background: var(--blue);
  color: var(--yellow);
  padding: var(--space-sm) 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  font-size: var(--text-base);
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin: 0;
}

.modal-close {
  background: none;
  border: none;
  color: var(--yellow);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
  opacity: 0.8;
  transition: opacity 0.2s;
}
.modal-close:hover { opacity: 1; }

.modal-body { padding: 20px; }

.modal-body label {
  display: block;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 5px;
  margin-top: 14px;
}
.modal-body label:first-of-type { margin-top: 0; }

.modal-body input,
.modal-body select {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #c8d0db;
  border-radius: var(--radius);
  font-family: 'Sora', sans-serif;
  font-size: var(--text-base);
  color: var(--black);
  background: #fafafa;
  outline: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.modal-body input:focus,
.modal-body select:focus {
  border-color: var(--blue);
  background: var(--white);
}

.search-results {
  margin-top: 14px;
  max-height: 220px;
  overflow-y: auto;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.search-results table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

.search-results th {
  background: #f0f3f6;
  padding: 7px 10px;
  text-align: left;
  font-size: var(--text-xs);
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--blue);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.search-results td {
  padding: 7px 10px;
  border-bottom: 1px solid #f0f3f6;
  color: #222;
  white-space: nowrap;
}

.search-results tr:last-child td { border-bottom: none; }
.search-results tr:hover td { background: var(--bg-row); }
.search-results .no-result {
  padding: var(--space-sm);
  text-align: center;
  color: var(--text-muted);
  font-size: var(--text-sm);
}

.delete-confirm {
  background: #fff3f3;
  border: 1px solid #f5c1c1;
  border-radius: 8px;
  padding: 14px 16px;
  margin-top: 14px;
  font-size: var(--text-base);
  color: #7a0000;
  display: none;
}
.delete-confirm.visible { display: block; }
.delete-confirm strong  { font-weight: 700; }

.modal-footer {
  padding: 14px 20px 20px;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.btn-cancel {
  padding: 9px 20px;
  border: 1px solid #c8d0db;
  border-radius: var(--radius);
  background: var(--white);
  color: #555;
  font-family: 'Sora', sans-serif;
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-cancel:hover { background: #f0f3f6; }

.btn-submit {
  padding: 9px 22px;
  border: none;
  border-radius: var(--radius);
  background: var(--blue);
  color: var(--yellow);
  font-family: 'Sora', sans-serif;
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: 1px;
  cursor: pointer;
  transition: background 0.2s, opacity 0.2s;
}
.btn-submit:hover    { background: var(--blue-dark); }
.btn-submit:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-submit.danger       { background: #c0392b; color: var(--white); }
.btn-submit.danger:hover { background: #a53125; }

/* ── Toast notifications ── */
.toast-container {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  min-width: 260px;
  max-width: 340px;
  padding: 12px 16px;
  border-radius: 8px;
  font-family: 'Sora', sans-serif;
  font-size: var(--text-sm);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: all;
  animation: toastIn 0.25s ease;
  border-left: 4px solid transparent;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(40px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(40px); }
}

.toast.success { background: #eafaf1; border-color: #27ae60; color: #1a6b3a; }
.toast.error   { background: #fef0f0; border-color: #c0392b; color: #7a0000; }
.toast.info    { background: #eaf2fb; border-color: var(--blue); color: #1a3d5a; }

.toast-icon { font-size: 18px; flex-shrink: 0; }

/* ══════════════════════════════════════════
   RESPONSIVE — LARGE DESKTOP  (≥1440px)
══════════════════════════════════════════ */
@media (min-width: 1440px) {
  :root {
    --text-lg:   22px;
    --text-2xl:  34px;
    --text-3xl:  40px;
  }

  header { padding: var(--space-sm) 80px; }

  .interns-grid  { margin: 0 20%; }
  .interns-table { font-size: 18px; }

  .top    { margin: 0 30%; }
  .comment,
  .contact p { font-size: 22px; }
}

/* ══════════════════════════════════════════
   RESPONSIVE — DESKTOP  (1025px – 1439px)
   (default styles already target this)
══════════════════════════════════════════ */

/* ══════════════════════════════════════════
   RESPONSIVE — TABLET LANDSCAPE  (769px – 1024px)
══════════════════════════════════════════ */
@media (max-width: 1024px) {
  :root {
    --text-lg: 17px;
    --text-2xl: 26px;
    --text-3xl: 28px;
    --space-lg: 28px;
  }

  .interns-grid { margin: 0 5%; }

  .interns-table { font-size: 15px; }

  .interns-table th,
  .interns-table td { padding: 9px 11px; }

  .top    { margin: 0 10%; }
  .comment,
  .contact p { font-size: 17px; }
}

/* ══════════════════════════════════════════
   RESPONSIVE — TABLET PORTRAIT  (577px – 768px)
══════════════════════════════════════════ */
@media (max-width: 768px) {
  :root {
    --text-lg:   15px;
    --text-2xl:  22px;
    --text-3xl:  24px;
    --space-lg:  20px;
    --space-xl:  40px;
  }

  /* Header */
  header { padding: var(--space-sm) var(--space-md); }

  .logo { font-size: 18px; letter-spacing: 2px; }

  .hamburger { display: flex; }

  #main-nav {
    display: none;
    flex-direction: column;
    gap: 0;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: var(--yellow);
    border-bottom: 1px solid #2a2a2a;
    padding: var(--space-sm) 0;
  }

  #main-nav.open { display: flex; }

  #main-nav a {
    color: var(--blue);
    padding: 14px var(--space-lg);
    border-bottom: 1px solid #1a1a1a;
  }
  #main-nav a:last-child { border-bottom: none; }
  #main-nav a::after { background-color: var(--blue); }

  /* Page heading */
  h1 { margin-top: var(--space-xl); font-size: var(--text-3xl); }

  /* Interns section */
  .interns-section { padding: var(--space-sm) var(--space-md) 32px; }
  .interns-grid    { margin: 0; }

  .interns-table { font-size: 13px; }
  .interns-table th,
  .interns-table td { padding: 8px 10px; }

  /* Footer */
  footer { padding: 32px var(--space-md) 20px; }

  .top {
    flex-direction: column;
    gap: 24px;
    margin: 0;
  }

  .comment,
  .contact p { font-size: 16px; }

  .comment h2,
  .contact h2 { font-size: 20px; }

  /* Modal */
  .modal-box { margin: var(--space-xs); }

  /* Toast */
  .toast-container { right: 10px; left: 10px; }
  .toast { min-width: unset; max-width: 100%; }
}

/* ══════════════════════════════════════════
   RESPONSIVE — MOBILE  (≤576px)
══════════════════════════════════════════ */
@media (max-width: 576px) {
  :root {
    --text-3xl:  20px;
    --text-2xl:  18px;
    --space-xl:  32px;
  }

  header { padding: 12px var(--space-sm); }

  .logo { font-size: 16px; letter-spacing: 1px; }

  h1    { font-size: 20px; margin-top: var(--space-xl); }

  .section-title { font-size: 18px; }

  .interns-section { padding: 12px var(--space-xs) 24px; }

  .interns-table { font-size: 12px; }
  .interns-table th,
  .interns-table td { padding: 7px 8px; letter-spacing: 0.5px; }

  /* Footer */
  footer       { padding: 24px var(--space-sm) 16px; }
  .comment h2,
  .contact h2  { font-size: 17px; }
  .comment,
  .contact p   { font-size: 14px; }

  /* Modal full-width on small screens */
  .modal-box   { margin: 0; border-radius: 12px 12px 0 0; max-width: 100%; }
  .modal-overlay { align-items: flex-end; padding: 0; }

  .modal-footer { flex-direction: column-reverse; }
  .btn-cancel,
  .btn-submit   { width: 100%; text-align: center; }

  /* Toast */
  .toast-container { top: auto; bottom: 16px; right: 10px; left: 10px; }
}

/* ══════════════════════════════════════════
   RESPONSIVE — SMALL MOBILE  (≤375px)
══════════════════════════════════════════ */
@media (max-width: 375px) {
  .logo { font-size: 14px; }
  h1    { font-size: 18px; }

  .interns-table { font-size: 11px; }
  .interns-table th,
  .interns-table td { padding: 6px 6px; }

  .modal-header h3 { font-size: 12px; letter-spacing: 1px; }
}
