:root {
  /* Override Bootstrap primary to a codish green */
  --bs-primary: #229652;
  --bs-primary-rgb: 34,
    150,
    82;
}

html {
  scroll-behavior: smooth;
  transition: color .2s ease, background-color .2s ease;
}

.navbar .nav-link.active {
  font-weight: 600;
}

/* Vertical spine for timeline (optional, but good to have) */
#timelineWrapper {
  position: relative;
}

#timelineWrapper::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: .6rem;
  width: 2px;
  background-color: var(--bs-border-color);
  display: none;
  /* Hidden by default, maybe show on larger screens if desired, but let's keep it hidden if it conflicts with cards */
}

/* Actually, let's omit the spine for now as the cards are full width in the current design */

/* Safety: ensure utility class picks up the new color */
.text-primary {
  color: var(--bs-primary) !important;
}

/* Buttons: ensure Bootstrap primary buttons use the codish green and have accessible focus/hover states */
.btn-primary {
  color: #fff;
  background-color: var(--bs-primary) !important;
  border-color: var(--bs-primary) !important;
}

.btn-primary:hover,
.btn-primary:focus {
  background-color: #1A7440 !important;
  /* slightly darker on hover/focus */
  border-color: #1A7440 !important;
  color: #fff;
}

.btn-primary:active,
.btn-primary.active,
.btn-check:checked+.btn-primary {
  background-color: #048538 !important;
  /* active state */
  border-color: #048538 !important;
}

.btn-primary:focus {
  box-shadow: 0 0 0 .25rem rgba(var(--bs-primary-rgb), .25);
}

/* Outline variant: use primary green for border/text and darken on hover */
.btn-outline-primary {
  color: var(--bs-primary) !important;
  border-color: var(--bs-primary) !important;
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
  color: #fff !important;
  background-color: var(--bs-primary) !important;
  border-color: var(--bs-primary) !important;
}

/* Theme switch (Bootstrap form-switch) and theme icon color
   - color the checked switch knob/background and focus ring using the primary variable
   - color the theme icon so it matches the site accent
*/
.form-check-input:checked {
  background-color: var(--bs-primary) !important;
  border-color: var(--bs-primary) !important;
}

.form-check-input:focus {
  box-shadow: 0 0 0 .25rem rgba(var(--bs-primary-rgb), .25) !important;
}

/* For the switch thumb on some browsers where background-image is used, force accent-color as fallback */
.form-check-input {
  accent-color: var(--bs-primary);
}

/* Theme icon (sun/moon) — neutral in light mode, green in dark mode */
#themeIcon {
  color: #6c757d;
  /* neutral / muted gray for light mode */
  transition: color .15s ease;
}

/* When the document is in dark mode, make the icon use the primary green */
[data-bs-theme="dark"] #themeIcon {
  color: var(--bs-primary) !important;
}

/* Timeline layout and card accents */
:root {
  /* Timeline accent colors (rgb form used for subtle colored shadows) */
  --timeline-academic-rgb: 163, 0, 0;
  /* red */
  --timeline-personal-rgb: 2, 40, 100;
  /* royal blue */
}

/* Grid wrapper for timeline cards: single column with comfortable vertical gap */
.timeline-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  /* increases spacing between cards */
  margin-top: 1rem;
}

/* Timeline item base styling: inherits from .custom-card, adds colored left accent via pseudo-element */
.timeline-item {
  position: relative;
  /* Ensure content is above the band if needed, though usually fine */
}

.timeline-item::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 6px;
  background-color: transparent;
  z-index: 1;
}

/* Type-specific accents - colored left band */
.timeline-item[data-type="academic"]::before {
  background-color: rgb(var(--timeline-academic-rgb));
}

.timeline-item[data-type="personal"]::before {
  background-color: rgb(var(--timeline-personal-rgb));
}

/* Make sure smaller cards / content have comfortable spacing inside */
.timeline-item .card-body {
  padding: 1rem 1rem;
}

/* Playlists page styles */
.playlist-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: 1fr;
}

@media (min-width: 768px) {
  .playlist-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 1100px) {
  .playlist-grid {
    grid-template-columns: 1fr 1fr 1fr;
  }
}

/* Unified Card Style */
.custom-card {
  border: 1px solid rgba(var(--bs-primary-rgb), 0.04);
  border-radius: 1rem;
  overflow: hidden;
  background: color-mix(in srgb, var(--bs-body-bg) 92%, white);
  transition: transform .15s ease, box-shadow .15s ease;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.06);
}

.custom-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.10);
}

.custom-card .card-body {
  padding: 1.25rem;
}

.custom-card .badge {
  font-weight: 500;
}

/* Playlist specific overrides if needed (e.g. media container) */
.playlist-media {
  border-radius: 1rem 1rem 0 0;
  overflow: hidden;
  position: relative;
  background: color-mix(in srgb, var(--bs-body-bg) 92%, white);
  height: 140px;
}

@media (min-width: 768px) {
  .playlist-media {
    height: 160px;
  }
}

@media (min-width: 1100px) {
  .playlist-media {
    height: 352px;
  }
}

.playlist-media .playlist-iframe {
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
  border-radius: 1rem 1rem 0 0;
}