:root {
  --green: #79b445;
  --green-dark: #2f6d1d;
  --bg: #f6f8f5;
  --card: #ffffff;
  --text: #0f172a;
  --muted: rgba(15, 23, 42, .65);
  --border: rgba(15, 23, 42, .12);
  --shadow: 0 18px 50px rgba(0, 0, 0, .08);
  --shadow-sm: 0 10px 24px rgba(0, 0, 0, .06);
  --radius: 18px;
  --radius-sm: 14px;
}

/* Base Overrides for SLiMS */
body.bg-grey-lightest {
  background:
    radial-gradient(900px 420px at 15% 5%, rgba(121, 180, 69, .18), transparent 60%),
    radial-gradient(700px 380px at 85% 0%, rgba(121, 180, 69, .14), transparent 55%),
    var(--bg) !important;
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

.header-wrapper {
  position: sticky;
  top: 0;
  z-index: 9999;
  background: rgba(255, 255, 255, .82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(0, 0, 0, .06);
}

.top-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 5%;
  gap: 18px;
}

.usi-logo img {
  height: 54px;
  width: auto;
  display: block;
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, .10));
}

.header-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.usi-contact {
  font-size: 13px;
  font-weight: 700;
  color: rgba(15, 23, 42, .80);
  line-height: 1.35;
  padding: 10px 12px;
  border: 1px solid rgba(0, 0, 0, .06);
  border-radius: 999px;
  background: rgba(255, 255, 255, .65);
}

.usi-btn-primary {
  background: var(--green);
  color: #fff !important;
  padding: 10px 16px;
  border-radius: 999px;
  font-weight: 800;
  letter-spacing: .2px;
  transition: .18s ease;
  box-shadow: 0 14px 30px rgba(121, 180, 69, .25);
  border: 1px solid rgba(0, 0, 0, .06);
  display: inline-block;
}

.usi-btn-primary:hover {
  transform: translateY(-1px);
  background: #6aa83b;
  color: #fff !important;
  text-decoration: none;
}

.usi-btn-primary:active {
  transform: translateY(0);
}

.usi-nav {
  background: transparent;
  padding: 10px 5% 14px;
}

.menu-wrap {
  background: #fff;
  border: 1px solid rgba(0, 0, 0, .06);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 6px 10px;
}

.usi-menu {
  display: flex;
  gap: 6px;
  align-items: center;
  list-style: none;
  flex-wrap: wrap;
  margin: 0;
  padding: 0;
}

.usi-menu > li {
  position: relative;
}

.usi-menu > li > a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  font-weight: 800;
  color: rgba(15, 23, 42, .88);
  transition: .16s ease;
}

.usi-menu > li > a:hover {
  background: rgba(121, 180, 69, .14);
  text-decoration: none;
  color: var(--green-dark);
}

.usi-menu li:hover > a {
  color: rgba(15, 23, 42, .95);
}

.usi-has-dropdown > a::after {
  content: "▾";
  font-size: 12px;
  opacity: .8;
  margin-left: 6px;
}

.usi-dropdown {
  display: none;
  position: absolute;
  top: 48px;
  left: 0;
  min-width: 220px;
  padding: 8px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, .08);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  list-style: none;
  margin: 0;
  z-index: 100;
}

.usi-dropdown li a {
  display: block;
  padding: 10px 12px;
  border-radius: 12px;
  font-weight: 700;
  color: rgba(15, 23, 42, .9);
}

.usi-dropdown li a:hover {
  background: rgba(121, 180, 69, .16);
  text-decoration: none;
}

.usi-menu li:hover .usi-dropdown {
  display: block;
}

.usi-menu-toggle {
  display: none;
  font-size: 16px;
  font-weight: 900;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(121, 180, 69, .14);
  border: 1px solid rgba(0, 0, 0, .06);
  cursor: pointer;
}

/* Hero Section */
.usi-hero {
  margin: 16px 5% 0;
  border-radius: 24px;
  overflow: hidden;
  position: relative;
  box-shadow: var(--shadow);
  min-height: 420px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 90px 20px;
  color: #fff;
  background:
    linear-gradient(120deg, rgba(15, 23, 42, .55), rgba(15, 23, 42, .35)),
    url('../images/hero-bg.jpg'); /* Placeholder, will be replaced by user images or local */
  background-size: cover;
  background-position: center;
}

.usi-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(900px 420px at 20% 10%, rgba(121, 180, 69, .35), transparent 55%);
  pointer-events: none;
}

.usi-hero > * {
  position: relative;
  z-index: 1;
}

.usi-hero h1 {
  font-size: clamp(26px, 3.2vw, 44px);
  line-height: 1.15;
  max-width: 980px;
  margin: 0 auto 14px;
  letter-spacing: .2px;
  color: #fff;
}

.usi-hero p {
  max-width: 980px;
  margin: 0 auto;
  font-size: 16px;
  color: rgba(255, 255, 255, .92);
}

/* Search Wrapper Home */
.usi-search-wrapper {
  display: flex;
  background: #fff;
  border-radius: 999px;
  padding: 8px;
  gap: 8px;
  overflow: hidden;
}

.usi-search-wrapper input {
  border: none !important;
  background: transparent !important;
  padding: 10px 24px !important;
  font-size: 16px !important;
  flex: 1;
  box-shadow: none !important;
}

.usi-btn-search {
  background: var(--green);
  color: #fff !important;
  border: none;
  padding: 10px 24px;
  border-radius: 999px;
  font-weight: 800;
  transition: 0.2s;
  white-space: nowrap;
}

.usi-btn-search:hover {
  background: var(--green-dark);
  color: #fff !important;
  text-decoration: none;
}

.usi-badge {
  display: inline-block;
  padding: 6px 16px;
  background: rgba(121, 180, 69, 0.14);
  color: var(--green-dark);
  font-weight: 900;
  font-size: 11px;
  letter-spacing: 1px;
  border-radius: 99px;
}

/* Sections */
.usi-section {
  padding: 70px 5%;
  text-align: center;
}

.usi-section h2 {
  font-size: 26px;
  margin-bottom: 8px;
  color: rgba(15, 23, 42, .95);
}

.usi-section h2::after {
  content: "";
  display: block;
  width: 110px;
  height: 6px;
  margin: 12px auto 0;
  border-radius: 99px;
  background: linear-gradient(90deg, rgba(121, 180, 69, .25), rgba(121, 180, 69, .95));
}

.usi-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 28px;
}

.usi-card {
  text-align: left;
  background: var(--card);
  border: 1px solid rgba(0, 0, 0, .06);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  transition: .16s ease;
}

.usi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.usi-card h3 {
  font-size: 18px;
  margin-bottom: 10px;
}

.usi-card p,
.usi-card li {
  color: rgba(15, 23, 42, .78);
  font-size: 14px;
}

.usi-prestasi {
  margin: 0 5% 70px;
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 18px;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: var(--shadow);
  background: #fff;
  border: 1px solid rgba(0, 0, 0, .06);
}

.usi-prestasi-left {
  padding: 34px;
  background:
    radial-gradient(900px 420px at 15% 20%, rgba(121, 180, 69, .25), transparent 60%),
    linear-gradient(180deg, rgba(121, 180, 69, .10), transparent);
}

.usi-prestasi-left h2 {
  color: rgba(15, 23, 42, .95);
  font-size: 22px;
  margin-bottom: 10px;
}

.usi-prestasi-left p {
  color: rgba(15, 23, 42, .78);
}

.usi-prestasi-right img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Footer */
.usi-footer {
  background: #111827;
  color: rgba(255, 255, 255, .92);
  padding: 44px 5% 18px;
  border-top: 1px solid rgba(255, 255, 255, .08);
  display: flex !important;
  flex-direction: column !important;
}

.usi-footer img {
  max-height: 92px;
  width: auto;
  display: block;
  filter: drop-shadow(0 10px 22px rgba(0, 0, 0, .25));
}

/* Responsive */
@media (max-width: 992px) {
  .usi-grid-3 {
    grid-template-columns: 1fr;
  }

  .usi-prestasi {
    grid-template-columns: 1fr;
  }

  .usi-prestasi-right {
    height: 320px;
  }

  .header-right .usi-contact {
    display: none;
  }
}

@media (max-width: 768px) {
  .header-right {
    display: none;
  }

  .top-header {
    justify-content: center;
  }

  .usi-nav {
    padding: 10px 5% 14px;
  }

  .usi-menu-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
  }

  .usi-menu {
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    padding: 8px 0;
  }

  .usi-menu.active {
    display: flex;
  }

  .usi-menu > li > a {
    justify-content: space-between;
  }

  .usi-dropdown {
    position: static;
    box-shadow: none;
    border: none;
    padding: 6px 0 0;
  }

  .usi-menu li:hover .usi-dropdown {
    display: none;
  }

  .usi-menu li.open .usi-dropdown {
    display: block;
  }
}

/* Biblio Search Results */
.biblioResult {
  margin-top: 20px;
}

.biblioResult .card.item {
  border-radius: var(--radius) !important;
  border: 1px solid var(--border) !important;
  box-shadow: var(--shadow-sm) !important;
  overflow: hidden;
  transition: 0.2s;
  background: #fff;
}

.biblioResult .card.item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow) !important;
}

.biblioResult .card-link {
  color: var(--text) !important;
  font-weight: 800;
  font-size: 1.1rem;
  transition: 0.2s;
}

.biblioResult .card-link:hover {
  color: var(--green) !important;
  text-decoration: none;
}

.biblioResult .authors a {
  background: rgba(121, 180, 69, 0.08) !important;
  border: 1px solid rgba(121, 180, 69, 0.15) !important;
  color: var(--green-dark) !important;
  font-weight: 700 !important;
  font-size: 12px !important;
  padding: 4px 12px !important;
  margin-right: 6px !important;
  margin-bottom: 6px !important;
  transition: 0.2s;
}

.biblioResult .authors a:hover {
  background: var(--green) !important;
  color: #fff !important;
  text-decoration: none;
}

.biblioResult img.rounded {
  border-radius: 12px !important;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.biblioPaging {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 30px 0;
}

.biblioPaging a, 
.biblioPaging span {
  padding: 8px 16px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid var(--border);
  color: var(--text);
  font-weight: 700;
  transition: 0.2s;
}

.biblioPaging a:hover {
  background: var(--green);
  color: #fff;
  border-color: var(--green);
  text-decoration: none;
}

.biblioPaging .current {
  background: var(--green);
  color: #fff;
  border-color: var(--green);
}

/* Search Info area */
.search-found-info {
  font-size: 15px;
  color: var(--muted);
}

.search-found-info strong {
  color: var(--text);
}

.search-found-info-keywords {
  color: var(--green-dark) !important;
}

/* Detail Page 3-Section Layout */
.detail-container {
  display: flex;
  flex-direction: row;
  width: 100%;
  min-height: 85vh;
  gap: 20px;
  padding: 24px 5%;
  background: var(--bg);
}

.detail-left {
  flex: 0 0 22%;
  max-width: 22%;
  min-width: 0; /* Prevents overflow in flex */
  background: #fff;
  padding: 24px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  height: fit-content;
  position: sticky;
  top: 100px;
  overflow-wrap: break-word;
}

.detail-middle {
  flex: 1;
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 700px;
}

.detail-right {
  flex: 0 0 20%;
  max-width: 20%;
  background: #fff;
  padding: 24px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  height: fit-content;
  position: sticky;
  top: 100px;
}

.pdf-viewer {
  width: 100%;
  height: 100%;
  min-height: 800px;
  border: none;
}

.bib-title {
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 12px;
  color: var(--text);
  line-height: 1.3;
  overflow-wrap: break-word;
  word-break: break-word;
  hyphens: auto;
}

.bib-author {
  font-size: 0.95rem;
  color: var(--green-dark);
  font-weight: 700;
  margin-bottom: 20px;
  overflow-wrap: break-word;
  word-break: break-word;
}

.abstract-content {
  font-size: 0.92rem;
  color: rgba(15, 23, 42, 0.8);
  line-height: 1.7;
  text-align: justify;
}

.recommendation-item {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.recommendation-item:last-child {
  border-bottom: none;
}

.recommendation-info a {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.4;
  display: block;
  margin-bottom: 4px;
  transition: 0.2s;
}

.recommendation-info a:hover {
  color: var(--green);
  text-decoration: none;
}

/* Responsive Detail */
@media (max-width: 1200px) {
  .detail-container {
    flex-direction: column;
    padding: 20px 5%;
    gap: 20px;
  }
  .detail-left, .detail-middle, .detail-right {
    max-width: 100%;
    flex: none;
    position: static;
    width: 100%;
  }
}

@media (max-width: 576px) {
  .detail-container {
    padding: 15px 12px;
    gap: 15px;
  }
  .detail-left, .detail-middle, .detail-right {
    padding: 18px;
  }
  .bib-title {
    font-size: 1.25rem;
  }
}

.usi-search-bar {
  transition: 0.3s ease;
}

.usi-select-branded {
  cursor: pointer;
  background-color: #fff !important;
  transition: 0.2s;
}

.usi-select-branded:hover {
  border-color: var(--green) !important;
}
