/* Modern refresh - Updated color palette with gradient background */
body {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  background-attachment: fixed;
  color: white;
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
}

.thin {
  max-width: 1000px;
}

a:link {
  text-decoration: none;
}

/* Responsive image sizing for thumbnails only */
.year img, .month img, .day img {
  width: 100%;
  height: auto;
  aspect-ratio: 4/3;
  object-fit: cover;
}

/* Responsive thumbnail containers */
.year, .month, .day {
  height: auto;
  min-height: 110px;
  width: clamp(120px, 30vw, 160px);
  position: relative; /* Required for absolute positioned .when labels */
}

/* Card styling with modern shadows and transitions */
.wiki, .prev, .next, .year, .month, .day, .live-box {
  background: linear-gradient(145deg, #2a2a3e, #1e1e2e);
  margin: 0.2em;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

/* Hover effects for cards */
.year:hover, .month:hover, .day:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.4);
  border-color: rgba(255,255,255,0.2);
}

.year, .month {
  width: clamp(120px, 30vw, 160px);
  color: white;
}

/* Text overlay with gradient background */
.when {
  font-size: 1.2em;
  margin: 0;
  text-align: center;
  padding: 0.6em 0.3em 0.3em;
  position: absolute;
  width: 100%;
  color: white;
  text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
  background: linear-gradient(to bottom, rgba(0,0,0,0.7), transparent 80%);
  border-radius: 12px 12px 0 0;
  box-sizing: border-box;
}

/*
.wiki {
  background-color: #353333;
  margin: 0.2em;
  border: 1px solid black;
  border-radius: 2em;
  display: inline-block;
  padding: 0.3em 1em;
}

.wiki > a {
  text-decoration: none;
  color: white;
}
*/

.nav, .top {
  color: white;
  margin: 0.1em;
  display: inline-block;
  text-align: center;
  padding: 0.3em 0.5em;
}

/* Navigation header buttons */
.top {
  background: linear-gradient(145deg, #3a3a4e, #2a2a3e);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  font-size: 2em;
  vertical-align: middle;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.top:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

/* Tree icon inside h1.top matches text height */
h1.top img {
  height: 1em;
  width: auto;
  vertical-align: middle;
}

.nav {
  font-size: unset;
  width: 60%;
  max-width: 450px;
  margin: 0;
  padding: 0;
}

.lapse {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-content: center;
  align-items: center;
  gap: 0.3em;
}

.stats {
  margin-top: 1em;
  margin-bottom: 1em;
  margin-left: auto;
  margin-right: auto;
  max-width: 90%;
}

/* Modernized stats table */
table {
  margin: 0 auto;
  min-width: 50%;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  letter-spacing: 1px;
  font-size: 0.8rem;
  background: rgba(40,40,60,0.8);
  overflow: hidden;
}

th {
  background: rgba(60,60,80,0.9);
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

td, th {
  border: none;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  padding: 10px 20px;
}

tr:last-child td {
  border-bottom: none;
}

td {
  text-align: center;
}

/* Navigation arrows */
.prev, .next, .wiki {
  color: white;
  display: inline-block;
  padding: 0.5em 0.8em;
  margin: 0.1em 0;
  transition: transform 0.2s ease;
}

.prev:hover, .next:hover {
  transform: scale(1.1);
}

.prev {
  float: left;
}

.next {
  float: right;
}

.welcome {
  max-width: 90%;
  margin: 0 auto;
}

.welcome > p {
  text-align: left;
  line-height: 1.6;
}

.welcome a:link {
  color: #5dade2;
  text-decoration: underline;
}

.welcome a:visited {
  color: #82e0aa;
  text-decoration: underline;
}

/* Zoomed video state */
.zoomed {
  border: none;
  position: fixed;
  width: 90%;
  height: auto;
  max-width: 800px;
  z-index: 100;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border-radius: 8px;
  box-shadow: 0 0 60px rgba(0,0,0,0.8);
}

/* Desktop styles */
@media (min-width: 700px) {
  .welcome > p {
    text-align: justify;
  }

  #stats {
    visibility: hidden;
  }
}

/* Mobile styles */
@media (max-width: 480px) {
  /* Larger thumbnails on mobile for easier tapping */
  .year, .month, .day {
    width: clamp(140px, 45vw, 180px);
  }

  /* Larger navigation buttons for touch */
  .prev, .next {
    font-size: 1.2em;
  }

  /* Responsive table */
  table {
    font-size: 0.7rem;
  }

  td, th {
    padding: 8px 12px;
  }

  /* Full-width zoomed video on mobile */
  .zoomed {
    width: 100%;
    max-width: none;
    border-radius: 0;
  }

  /* Larger header buttons */
  .top {
    font-size: 1.5em;
    padding: 0.4em 0.6em;
  }
}

/* Small mobile screens */
@media (max-width: 360px) {
  .year, .month, .day {
    width: clamp(130px, 42vw, 160px);
  }

  td, th {
    padding: 6px 8px;
  }
}
