:root {
  --bg: #ffffff;
  --fg: #0f172a;
  --muted: #64748b;
  --muted-bg: #f8fafc;
  --border: #e2e8f0;
  --card: #ffffff;
  --primary: #0b3b66;
  --primary-dark: #082a4a;
  --accent: #b91c1c;
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu,
    sans-serif;
  font-size: 14px;
  line-height: 1.5;
  animation: fadein 0.3s ease-out;
  @keyframes fadein {
    from {
      opacity: 0;
      transform: translateY(8px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
}
a {
  color: inherit;
  text-decoration: none;
}
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border);
}
@media (max-width: 640px) {
  .site-header {
    position: relative;
  }
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 24px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  border-radius: 12px;
  border: 1px solid rgba(11, 59, 102, 0.2);
  background: rgba(11, 59, 102, 0.08);
  color: var(--primary);
  font-weight: 700;
  font-size: 14px;
}
.brand-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--fg);
}
.brand-sub {
  font-size: 12px;
  color: var(--muted);
}
.nav {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  font-weight: 500;
}
.nav-link {
  padding: 8px 12px;
  border-radius: 6px;
  color: var(--muted);
}
@media (max-width: 768px) {
  .nav-link {
    padding: 0px;
  }
}
.nav-link:hover,
.nav-link.is-active {
  color: var(--fg);
}
.lang {
  margin-left: 8px;
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  font-size: 12px;
}
@media (max-width: 640px) {
  .lang {
    width: 85px;
  }
}
.lang a {
  padding: 5px 10px;
  color: var(--muted);
}
.lang a.is-active {
  background: var(--primary);
  color: #fff;
  font-weight: 600;
}

/* Hero */
.hero {
  background: var(--primary);
  color: #fff;
}
.hero-inner {
  padding: 48px 24px;
}
.hero h1 {
    margin: 0;
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -0.02em;
    text-align: center;
}
.hero p {
  margin: 8px 0 0;
  color: rgba(255, 255, 255, 0.8);
}
.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
  margin-top: 24px;
}
.stat-n {
  font-size: 32px;
  font-weight: 700;
}
.stat-l {
  margin-top: 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.7);
}

/* Filters */
.filters {
  background: var(--card);
  border-bottom: 1px solid var(--border);
}
.filters-inner {
  padding: 20px 24px;
}
.filters form {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}
.filters .field-search {
  grid-column: span 1;
}
@media (max-width: 1024px) {
  .filters form {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (max-width: 640px) {
  .filters form {
    grid-template-columns: repeat(2, 1fr);
  }
  .filters .field-search {
    grid-column: span 2;
  }
}
.input,
.select {
  height: 40px;
  width: 100%;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  font-size: 14px;
  color: var(--fg);
}
.input:focus,
.select:focus {
  outline: none;
  border-color: var(--primary);
}
.field-search {
  position: relative;
}
.field-search .input {
  padding-left: 36px;
}
.field-search svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
}
.btn {
  height: 42px;
  padding: 0 18px;
  border: 1px solid #0B3B66;
  background: #0B3B66;
  color: #fff;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;

  transition: all .25s ease;
  box-shadow: 0 2px 8px rgba(11, 59, 102, .08);
}

.btn:hover {
  background: #f3f7fb;
  color: #0B3B66;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(11, 59, 102, .15);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: linear-gradient(135deg, #0B3B66, #16507f);
  color: #fff;
  border: none;
  box-shadow: 0 4px 14px rgba(11, 59, 102, .25);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #16507f, #0d4d85);
  box-shadow: 0 8px 20px rgba(11, 59, 102, .35);
  transform: translateY(-2px);
}

.btn-primary:active {
  transform: scale(.98);
}

.btn-outline {
  background: transparent;
  color: #0B3B66;
  border: 1.5px solid #0B3B66;
}

.btn-outline:hover {
  background: #0B3B66;
  color: #fff;
}

.btn-sm {
  height: 36px;
  padding: 0 14px;
  font-size: 13px;
}

.btn-lg {
  height: 48px;
  padding: 0 24px;
  font-size: 15px;
}
.view-bar {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.view-toggle {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}
.view-toggle a {
  padding: 6px 12px;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.view-toggle a + a {
  border-left: 1px solid var(--border);
}
.view-toggle a.is-active {
  background: var(--primary);
  color: #fff;
}
.results-count {
  font-size: 14px;
  color: var(--muted);
}

/* Main */
main.container {
  padding-top: 24px;
  padding-bottom: 24px;
  min-height: 50vh;
}

/* List */
.grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
@media (max-width: 1100px) {
  .grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (max-width: 800px) {
  .grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 520px) {
  .grid {
    grid-template-columns: 1fr;
  }
}
.card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: 12px;
  padding: 20px;
  transition: 0.15s;
}
.card:hover {
  transform: translateY(-2px);
  border-color: rgba(11, 59, 102, 0.4);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}
.card-title {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--fg);
}
.card:hover .card-title {
  color: var(--primary);
}
.card-country {
  margin-top: 4px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  font-size: 11px;
  font-weight: 500;
  margin-top: 12px;
}
.detail-btn {
  margin-top: 16px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
}
.card:hover .detail-btn {
  background: var(--primary-dark);
}

.empty {
  border: 1px dashed var(--border);
  background: var(--card);
  border-radius: 12px;
  padding: 48px;
  text-align: center;
  color: var(--muted);
}

/* Map */
.map-wrap {
  height: 70vh;
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}
#map {
  height: 100%;
  width: 100%;
  background: var(--muted-bg);
}
.home-pin {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 11px;
  border: 3px solid #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Detail page */
.detail-bg {
  background: var(--muted-bg);
  min-height: calc(100vh - 200px);
}
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: 999px;
  font-weight: 500;
  color: var(--fg);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.back-btn:hover {
  border-color: rgba(11, 59, 102, 0.4);
  color: var(--primary);
}
.hero-card {
  margin-top: 20px;
  border-radius: 16px;
  padding: 32px;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}
.hero-card .country {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.7);
}
.hero-card h1 {
  margin: 8px 0 0;
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.hero-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 16px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-weight: 500;
}
.hero-link:hover {
  background: rgba(255, 255, 255, 0.25);
}
.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 20px;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  font-size: 14px;
}
.hero-pill b {
  font-weight: 700;
}
.hero-pill span {
  color: rgba(255, 255, 255, 0.8);
}

.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 20px;
  font-weight: 600;
  margin: 32px 0 16px;
}
.section-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 24px;
  min-width: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}
.table-wrap {
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: 16px;
  overflow: hidden;
}
.table-scroll {
  overflow-x: auto;
}
table.agreements {
  width: 100%;
  min-width: 800px;
  border-collapse: collapse;
  font-size: 14px;
}
table.agreements thead {
  background: var(--muted-bg);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.05em;
  color: var(--muted);
}
table.agreements th {
  text-align: left;
  padding: 12px 16px;
  font-weight: 600;
}
table.agreements td {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  color: var(--muted);
}
table.agreements td.strong {
  color: var(--fg);
  font-weight: 500;
}
table.agreements tr:hover td {
  background: rgba(248, 250, 252, 0.6);
}
.type-pill {
  display: inline-flex;
  padding: 2px 10px;
  border-radius: 999px;
  border: 1px solid;
  font-size: 11px;
  font-weight: 500;
}
.type-erasmus {
  background: #fef3c7;
  color: #92400e;
  border-color: #fde68a;
}
.type-exchange {
  background: #e0f2fe;
  color: #075985;
  border-color: #bae6fd;
}
.type-default {
  background: #f1f5f9;
  color: #334155;
  border-color: #e2e8f0;
}

/* Footer */
.site-footer {
  margin-top: 48px;
  background: var(--primary);
  color: #fff;
}
.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
}
@media (min-width: 640px) {
  .footer-inner {
    flex-direction: row;
  }
}
.footer-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.footer-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.6);
  font-size: 10px;
  font-weight: 700;
  text-align: center;
  line-height: 1.1;
}
.footer-dept {
  font-size: 14px;
  font-weight: 600;
}
.footer-dept-en {
  font-size: 12px;
  font-style: italic;
  color: rgba(255, 255, 255, 0.8);
}
.footer-right {
  text-align: center;
  font-size: 14px;
}
@media (min-width: 640px) {
  .footer-right {
    text-align: right;
  }
}
.footer-uni {
  font-weight: 600;
}
.footer-addr {
  color: rgba(255, 255, 255, 0.8);
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin: 40px auto 16px;
  flex-wrap: wrap;
  padding: 10px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  box-shadow: 0 4px 14px -8px rgba(11, 59, 102, 0.18);
  width: fit-content;
  max-width: 100%;
}
.pagination .pg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 14px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  color: #475569;
  text-decoration: none;
  background: transparent;
  border: 1px solid transparent;
  transition: all 0.18s ease;
}
.pagination .pg:hover {
  background: #f1f5f9;
  color: #0b3b66;
}
.pagination .pg.is-active {
  background: linear-gradient(135deg, #0b3b66, #1361a8);
  color: #fff;
  border-color: #0b3b66;
  box-shadow: 0 4px 12px -4px rgba(11, 59, 102, 0.55);
}
.pagination .pg.is-active:hover {
  color: #fff;
}
.pagination .pg.is-disabled {
  opacity: 0.35;
  pointer-events: none;
  background: transparent;
}
.pagination .pg-gap {
  color: #94a3b8;
  cursor: default;
  min-width: 24px;
  font-weight: 700;
  letter-spacing: 1px;
}
.pagination .pg-nav {
  font-size: 18px;
  line-height: 1;
  padding: 0 12px;
  color: #0b3b66;
}
@media (prefers-reduced-motion: no-preference) {
  @view-transition {
    navigation: auto;
  }
}

/* ===== Hero stats — animated tiles ===== */
.stats-anim {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 28px;
}

.stats-anim .stat-tile {
  position: relative;
  padding: 14px 22px 12px;.stats-anim {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 28px;
}
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  min-width: 120px;
  overflow: hidden;
  transition:
    transform 0.25s ease,
    background 0.25s ease,
    border-color 0.25s ease;
  opacity: 0;
  transform: translateY(8px);
  animation: statRise 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
}
.stats-anim .stat-tile:nth-child(1) {
  animation-delay: 0.05s;
}
.stats-anim .stat-tile:nth-child(2) {
  animation-delay: 0.18s;
}
.stats-anim .stat-tile:nth-child(3) {
  animation-delay: 0.31s;
}
.stats-anim .stat-tile:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.22);
}
.stats-anim .stat-tile::before {
  content: "";
  position: absolute;
  inset: auto -20px -28px auto;
  width: 90px;
  height: 90px;
  background: radial-gradient(
    closest-side,
    rgba(255, 255, 255, 0.18),
    rgba(255, 255, 255, 0) 70%
  );
  pointer-events: none;
}
.stats-anim .stat-n {
  font-size: 34px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.5px;
  line-height: 1;
  background: linear-gradient(180deg, #ffffff 0%, #cfe1f5 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  transition: transform 0.3s ease;
  text-align: center;
}
.stats-anim .stat-n.is-done {
  animation: statPop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.stats-anim .stat-l {
  margin-top: 6px;
  font-size: 11px;
  text-align: center;
}

@keyframes statRise {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes statPop {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.08);
  }
  100% {
    transform: scale(1);
  }
}

@media (max-width: 640px) {
  .stats-anim {
    gap: 10px;
  }
  .stats-anim .stat-tile {
    flex: 1 1 calc(33.333% - 10px);
    min-width: 0;
    padding: 12px 14px 10px;
    text-align: center;
  }
  .stats-anim .stat-n {
    font-size: 24px;
  }
}

/* ===== Results pill ===== */
.results-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 14px 7px 12px;
  background: linear-gradient(180deg, #ffffff 0%, #f6f9fd 100%);
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  box-shadow:
    0 1px 0 rgba(15, 23, 42, 0.03),
    0 6px 16px -10px rgba(15, 23, 42, 0.18);
  font-size: 13px;
  color: #475569;
  line-height: 1;
}
.results-pill__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6);
  animation: pillPulse 2s ease-out infinite;
  flex-shrink: 0;
}
.results-pill__text strong {
  color: #0b3b66;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
@keyframes pillPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.55);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(16, 185, 129, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}
