/* ============================================================
   EPFL INFOSCIENCE THEME — DSpace CRDS Override
   Design reference: https://infoscience.epfl.ch/home
   ============================================================ */

/* ── 1. CSS Variables ──────────────────────────────────────── */
:root {
  --epfl-red:          #FF0000;
  --epfl-red-hover:    #CC0000;
  --epfl-dark:         #1C1C1C;
  --footer-bg:         #1C1C1C;
  --info-teal:         #00A9CE;
  --info-teal-hover:   #007FA3;
  --info-blue:         #1F3B5A;
  --dots-pink:         rgba(255, 100, 100, 0.12);
  --text-muted:        #666666;
  --border-light:      #E8E8E8;
}

/* ── 2. Global ─────────────────────────────────────────────── */
body {
  font-family: 'Source Sans Pro', 'Open Sans', 'Helvetica Neue', Arial, sans-serif !important;
  background: #FFFFFF !important;
  color: var(--epfl-dark) !important;
}

/* ── 3. NAVBAR — EPFL Red ──────────────────────────────────── */
.navbar,
.header-search-navbar .navbar,
ds-navbar .navbar,
nav.navbar {
  background-color: var(--epfl-red) !important;
  border-bottom: none !important;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2) !important;
  padding: 0 1rem !important;
  min-height: 48px !important;
}

/* Hide default DSpace logo image */
.navbar-brand img {
  display: none !important;
}

/* EPFL logo text replacement */
.navbar-brand::before {
  content: 'EPFL';
  color: #FFFFFF;
  font-size: 1.75rem;
  font-weight: 900;
  letter-spacing: -1px;
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1;
}

.navbar-brand {
  padding: 0.5rem 0 !important;
}

/* Nav links */
.navbar-nav .nav-link,
.navbar-nav .nav-item > a {
  color: rgba(255,255,255,0.92) !important;
  font-size: 0.875rem !important;
  font-weight: 400 !important;
  padding: 0.85rem 0.75rem !important;
  transition: color 0.15s ease !important;
}
.navbar-nav .nav-link:hover,
.navbar-nav .nav-item > a:hover {
  color: #FFFFFF !important;
  text-decoration: none !important;
  background: rgba(255,255,255,0.12) !important;
}
.navbar-nav .nav-link.active {
  color: #FFFFFF !important;
  font-weight: 600 !important;
}

/* Buttons and icons in navbar */
.navbar .btn,
.navbar button.btn {
  color: #FFFFFF !important;
  border-color: rgba(255,255,255,0.4) !important;
}
.navbar .btn:hover {
  background: rgba(255,255,255,0.15) !important;
}

/* Search input in header */
.header-search-navbar .form-control,
.navbar .form-control {
  border-radius: 2px !important;
}

/* ── 4. Header container ────────────────────────────────────── */
ds-header,
.header-search-navbar {
  background-color: var(--epfl-red) !important;
}

/* ── 5. Hero Section (injected by infoscience-inject.js) ────── */
#infoscience-hero {
  background: #FFFFFF;
  background-image: radial-gradient(circle, rgba(255,80,80,0.10) 1.5px, transparent 1.5px);
  background-size: 28px 28px;
  text-align: center;
  padding: 3.5rem 1rem 2.5rem;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--border-light);
}

#infoscience-hero .hero-logo-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 1rem;
  display: block;
}

#infoscience-hero .hero-title {
  font-size: 3rem;
  font-weight: 700;
  color: var(--info-blue);
  margin-bottom: 0.25rem;
  line-height: 1.1;
}

#infoscience-hero .hero-subtitle {
  font-size: 1.15rem;
  color: var(--text-muted);
  margin-bottom: 1.75rem;
  font-style: italic;
}

#infoscience-hero .btn-collections {
  display: inline-block;
  background-color: var(--info-teal);
  color: #FFFFFF !important;
  border: none;
  padding: 0.65rem 2.25rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 3px;
  text-decoration: none !important;
  cursor: pointer;
  transition: background 0.2s ease;
}
#infoscience-hero .btn-collections:hover {
  background-color: var(--info-teal-hover);
}

/* Stats row */
#infoscience-stats {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 3.5rem;
  margin-top: 2.25rem;
  flex-wrap: wrap;
}

#infoscience-stats .stat-item {
  text-align: center;
  min-width: 90px;
}

#infoscience-stats .stat-icon {
  width: 36px;
  height: 36px;
  margin: 0 auto 0.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

#infoscience-stats .stat-icon svg {
  width: 32px;
  height: 32px;
  fill: var(--info-blue);
  opacity: 0.75;
}

#infoscience-stats .stat-number {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--epfl-dark);
  display: block;
  line-height: 1;
}

#infoscience-stats .stat-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-top: 0.2rem;
  display: block;
}

/* ── 6. Primary Button Override ─────────────────────────────── */
.btn-primary,
a.btn-primary,
button.btn-primary {
  background-color: var(--info-teal) !important;
  border-color: var(--info-teal) !important;
  color: #FFFFFF !important;
}
.btn-primary:hover,
a.btn-primary:hover,
button.btn-primary:hover {
  background-color: var(--info-teal-hover) !important;
  border-color: var(--info-teal-hover) !important;
}

.btn-outline-primary {
  color: var(--info-teal) !important;
  border-color: var(--info-teal) !important;
}
.btn-outline-primary:hover {
  background-color: var(--info-teal) !important;
  color: #FFFFFF !important;
}

/* ── 7. Links ───────────────────────────────────────────────── */
a {
  color: var(--info-blue) !important;
}
a:hover {
  color: var(--info-teal) !important;
}

/* ── 8. Cards & Panels ──────────────────────────────────────── */
.card {
  border: 1px solid var(--border-light) !important;
  border-radius: 4px !important;
  box-shadow: none !important;
}
.card:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.08) !important;
}
.card-header {
  background: #F8F9FA !important;
  border-bottom: 1px solid var(--border-light) !important;
  font-weight: 600 !important;
}

/* ── 9. Badges ───────────────────────────────────────────────── */
.badge-primary,
.badge.bg-primary {
  background-color: var(--info-teal) !important;
}

/* ── 10. Section Headings ───────────────────────────────────── */
ds-home-page h2,
ds-home-page h3,
.home-page-content h2,
.home-page-content h3,
.section-header {
  color: var(--info-blue) !important;
  font-weight: 700 !important;
  border-left: 4px solid var(--epfl-red) !important;
  padding-left: 0.75rem !important;
  margin-bottom: 1.25rem !important;
}

/* ── 11. Search Bar ─────────────────────────────────────────── */
.search-form .input-group,
ds-search-form .input-group {
  border-radius: 3px;
  overflow: hidden;
}

.search-form .btn-search,
ds-search-form .btn[type=submit],
.input-group .btn-primary {
  background-color: var(--info-teal) !important;
  border-color: var(--info-teal) !important;
}

/* ── 12. Footer — EPFL Dark ──────────────────────────────────── */
ds-footer,
ds-footer footer,
footer.footer,
.footer,
#footer {
  background-color: var(--footer-bg) !important;
  color: rgba(255,255,255,0.85) !important;
  padding: 2rem 0 !important;
}

ds-footer a,
footer.footer a,
.footer a {
  color: rgba(255,255,255,0.75) !important;
}
ds-footer a:hover,
footer.footer a:hover,
.footer a:hover {
  color: #FFFFFF !important;
  text-decoration: none !important;
}

/* Footer EPFL branding */
#epfl-footer-brand {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

#epfl-footer-brand .epfl-text {
  font-size: 1.5rem;
  font-weight: 900;
  color: #FFFFFF;
  letter-spacing: -1px;
  font-family: Arial, Helvetica, sans-serif;
}

/* ── 13. Pagination ─────────────────────────────────────────── */
.page-item.active .page-link {
  background-color: var(--info-teal) !important;
  border-color: var(--info-teal) !important;
}
.page-link {
  color: var(--info-teal) !important;
}

/* ── 14. Recent submissions panel ──────────────────────────── */
ds-recent-item-list .list-group-item,
.recent-items .list-group-item {
  border-left: 3px solid transparent !important;
  transition: border-color 0.15s ease !important;
}
ds-recent-item-list .list-group-item:hover,
.recent-items .list-group-item:hover {
  border-left-color: var(--epfl-red) !important;
}

/* ── 15. Sidebar ────────────────────────────────────────────── */
.sidebar .card-header,
ds-sidebar .card-header {
  background: var(--info-blue) !important;
  color: #FFFFFF !important;
}

/* ── 16. Dropdown menus ─────────────────────────────────────── */
.dropdown-item:hover,
.dropdown-item:focus {
  background-color: rgba(0, 169, 206, 0.1) !important;
  color: var(--info-teal) !important;
}
.dropdown-item.active {
  background-color: var(--info-teal) !important;
}

/* ── 17. Breadcrumb ─────────────────────────────────────────── */
.breadcrumb-item.active {
  color: var(--text-muted) !important;
}
.breadcrumb-item a {
  color: var(--info-teal) !important;
}

/* ── 18. Text highlight ─────────────────────────────────────── */
::selection {
  background: rgba(0, 169, 206, 0.25);
}

/* ── 19. Scrollbar ──────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f1f1f1; }
::-webkit-scrollbar-thumb { background: #ccc; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--info-teal); }

/* ── 20. Responsive adjustments ─────────────────────────────── */
@media (max-width: 768px) {
  #infoscience-hero .hero-title { font-size: 2rem !important; }
  #infoscience-stats { gap: 1.5rem !important; }
  #infoscience-stats .stat-number { font-size: 1.4rem !important; }
}
