/* CSS Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

@font-face {
  font-family: 'Jim Nightshade';
  src: url('../fonts/JimNightshade-Regular.ttf') format('woff');
}

@font-face {
  font-family: 'Joan Regular';
  src: url('../fonts/Joan-Regular.woff') format('woff');
}

:root {
  --font-family-jim-nightshade: 'Jim Nightshade', woff;
  --font-family-joan: 'Joan Regular', woff;
}

.wireframe {
  position: relative; 
  width: 100%;
  min-height: 100vh;
  background-color: rgba(116, 115, 115, 1);
  padding: 0 0 60px 0;
  margin-bottom: 100px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/**/
.overlay-1 {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(270deg, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0.9) 100%);
  z-index: 1;
}

.overlay-2 {
  position: fixed;
  top: 0;
  left: 0;
  width: 4500px;
  height: 100%;
  background-size: cover;
  background: url("../spa/images/cloud-overlay.png") repeat-x 0 100%;
  animation: cloudLoop 100s infinite linear;
  z-index: 2;
}

/**/
.TitleJuice {
  position: relative;
  width: 80%;
  max-width: 500px;
  margin: 20px auto 0;
  height: auto;
  font-size: 80px;
  font-family: var(--font-family-jim-nightshade), serif;
  font-weight: normal;
  text-align: center;
  color: rgba(255, 255, 255, 1);
  z-index: 3;
}

.RectangleAlbums {
  position: relative;
  width: 80%;
  max-width: 409px;
  margin: 20px auto;
  height: 30px;
  background-color: rgba(217, 217, 217, 1);
  border: 1px solid rgba(0, 0, 0, 1);
  animation: float 3s ease-in-out infinite;
  z-index: 3;
}

.TextAlbums {
  position: relative;
  width: 80%;
  max-width: 227px;
  margin: 4px auto;
  height: 22px;
  font-size: 18px;
  font-family: var(--font-family-joan), serif;
  font-weight: bold;
  text-align: center;
  color: rgba(0, 0, 0, 1);
}

/*==================*/

.RectangleSongs {
  position: relative;
  width: 90%;
  max-width: 1300px;
  margin: 30px auto;
  height: auto;
  padding: 20px;
  background-color: rgba(217, 217, 217, 1);
  border-radius: 20px;
  box-shadow: 1px 2px 10px rgba(63, 98, 150, 0.95),
              44px 44px 24px rgba(204, 204, 204, 0.25);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  z-index: 3;
}

.album-item {
  perspective: 1000px;
  width: 300px;
  height: 400px;
  margin: 15px;
  cursor: pointer;
}

.album-inner {
  /* Stuff IOS */
  -webkit-transform-style: preserve-3d;
  -webkit-perspective: 1000px;
  perspective: 1000px;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  /* Stuff IOS */
  position: relative;
  width: 100%;
  height: 100%;
  text-align: center;
  transition: transform 0.8s;
  transform-style: preserve-3d;
}

.album-item:hover .album-inner {
  transform: rotateY(180deg);
}

.album-front, .album-back {
  /* Stuff IOS */
  -webkit-backface-visibility: hidden;
  /* Stuff IOS */
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 20px;
  border-radius: 10px;
}

.album-front {
  background-color: rgba(217, 217, 217, 1);
  color: white;
}

.album-back {
  background-color: rgba(0, 0, 0, 0.9);
  color: white;
  transform: rotateY(180deg);
}

.album-back h3 {
  margin-bottom: 15px;
  color: #ff6b6b;
}

.album-back p {
  margin: 5px 0;
}

.album-back ul {
  list-style-type: none;
  padding: 0;
  margin: 10px 0;
}

.album-back li {
  margin: 5px 0;
  color: #a8a8a8;
}

.RectangleSongs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  padding: 20px;
}

.album-front figure {
  width: 100%;
  height: auto;
  margin: 0;
}

.album-front img {
  max-width: 100%;
  height: auto;
  object-fit: cover;
}

.albumGBGR,
.albumWOD,
.albumDRForLove,
.albumLegNDies,
.albumFightDeamon,
.albumPartyNEnds {
  width: 100%;
  height: auto;
  max-width: 230px;
}

/* ====================================== */

.RectangleTimeline {
  position: relative;
  width: 80%;
  max-width: 400px;
  margin: 40px auto;
  height: 30px;
  background-color: rgba(217, 217, 217, 1);
  border: 1px solid rgba(0, 0, 0, 1);
  animation: float 3s ease-in-out infinite;
  z-index: 3;
}

.TextTimeline {
  position: relative;
  width: 80%;
  max-width: 220px;
  margin: 4px auto;
  height: 20px;
  font-size: 18px;
  font-family: var(--font-family-joan), serif;
  font-weight: bold;
  text-align: center;
  color: rgba(0, 0, 0, 1);
}

/* ====================================== */

.RectangleAges {
  position: relative;
  width: 90%;
  max-width: 1300px;
  margin: 30px auto;
  height: auto;
  padding: 20px;
  background-color: rgba(217, 217, 217, 1);
  border: 1px solid rgba(0, 0, 0, 1);
  border-radius: 24px;
  box-shadow: 1px 2px 10px rgba(79, 151, 118, 0.95),
              -44px 44px 24px rgba(204, 204, 204, 0.25);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-evenly;
  gap: 10px;
  z-index: 3;
}

.age-item {
  width: calc(50% - 20px);
  max-width: 300px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
  border-radius: 15px;
  padding: 25px;
  margin: 15px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
}

.age-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
}

.age-item p {
  font-size: 1.2em;
  color: rgba(28, 25, 25, 0.9);
  line-height: 1.6;
  margin: 10px 0;
  font-weight: 400;
}

.age-item span {
  display: inline-block;
  background: linear-gradient(135deg, #2193b0, #6dd5ed);
  padding: 8px 15px;
  border-radius: 8px;
  font-weight: 600;
  margin: 5px;
  color: white;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.age-item span:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.age-item .tags-container {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 15px;
}

.age-item {
  animation: fadeInUp 0.5s ease-out forwards;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ====================================== */

/* Stuff IOS */
.content-overlay {
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
}
/* Stuff IOS */

.Image2017,
.Image2018,
.Image2019,
.ImageInfinity {
  width: 100%;
  height: auto;
  max-width: 260px;
  position: relative;
}

.Image2017 .content-overlay,
.Image2018 .content-overlay,
.Image2019 .content-overlay,
.ImageInfinity .content-overlay {
  background: rgba(0, 0, 0, 0.7);
  position: absolute;
  border-radius: 10%;
  height: 100%;
  width: 100%;
  left: 0;
  top: 0;
  opacity: 0;
  transition: all 0.5s ease-in-out 0s;
}

.Image2017:hover .content-overlay,
.Image2018:hover .content-overlay,
.Image2019:hover .content-overlay,
.ImageInfinity:hover .content-overlay,
.Image2017:active .content-overlay,
.Image2018:active .content-overlay,
.Image2019:active .content-overlay,
.ImageInfinity:active .content-overlay,
.Image2017.touch-active .content-overlay,
.Image2018.touch-active .content-overlay,
.Image2019.touch-active .content-overlay,
.ImageInfinity.touch-active .content-overlay {
  opacity: 1;
}

.Image2017 .content-details,
.Image2018 .content-details,
.Image2019 .content-details,
.ImageInfinity .content-details {
  position: absolute;
  text-align: center;
  padding: 1em;
  width: 100%;
  top: 50%;
  left: 50%;
  opacity: 0;
  transform: translate(-50%, -50%);
  transition: all 0.5s ease-in-out 0s;
}

.Image2017 .content-details p,
.Image2018 .content-details p,
.Image2019 .content-details p,
.ImageInfinity .content-details p {
  color: #fff;
  font-size: 0.9em;
  font-family: var(--font-family-joan), serif;
  font-weight: normal;
}

.Image2017:hover .content-details,
.Image2018:hover .content-details,
.Image2019:hover .content-details,
.ImageInfinity:hover .content-details,
.Image2017:active .content-details,
.Image2018:active .content-details,
.Image2019:active .content-details,
.ImageInfinity:active .content-details,
.Image2017.touch-active .content-details,
.Image2018.touch-active .content-details,
.Image2019.touch-active .content-details,
.ImageInfinity.touch-active .content-details {
  opacity: 1;
}

.fadeIn-bottom {
  top: 80%;
}

.content-image {
  width: 100%;
  display: block;
}

.RectangleFigma {
  position: relative;
  width: 90px;
  height: 35px;
  margin: 50px 0 0 15%;
  background-color: rgb(69, 95, 151);
  border: 2px solid rgba(0, 0, 0, 1);
  text-align: center;
  line-height: 35px;
  z-index: 3;
}

.RectangleFigma a {
  color: white;
  text-decoration: none;
  font-family: var(--font-family-joan), serif;
  font-size: 14px;
}

@keyframes float {
  0% {
      transform: translateY(0px);
  }
  50% {
      transform: translateY(-10px); 
  }
  100% {
      transform: translateY(0px);
  }
}

@keyframes cloudLoop {
  0% {
      transform: translateX(0%);
  }

  100% {
      transform: translateX(-50%);
  }
}

@media (hover: none) {
  .Image2017 .content-overlay,
  .Image2018 .content-overlay,
  .Image2019 .content-overlay,
  .ImageInfinity .content-overlay {
    opacity: 0.5;
  }
  
  .Image2017 .content-details,
  .Image2018 .content-details,
  .Image2019 .content-details,
  .ImageInfinity .content-details {
    opacity: 1;
  }

  /* Stuff IOS */
  .content-overlay {
    opacity: 0.0; /* Make overlay slightly visible by default on touch devices */
  }

  .age-item:active .content-overlay {
    opacity: 1;
  }

  .age-item:active .content-details {
    opacity: 1;
  }
  /* Stuff IOS */
}

@media screen and (max-width: 775px) {
  .wireframe {
    padding: 0 0 100px 0;
  }
  
  .TitleJuice {
      font-size: 48px;
      margin-top: 20px;
  }

  .RectangleAlbums {
      margin-top: 15px;
      margin-bottom: 15px;
      width: 90%;
  }

  .RectangleSongs {
      margin-top: 15px;
      width: 95%;
      padding: 15px 10px;
  }

  .album-item {
      width: 100%;
      max-width: none;
      margin-bottom: 15px;
  }

  .RectangleTimeline {
      margin-top: 30px;
      margin-bottom: 30px;
      width: 90%;
  }

  .RectangleAges {
      width: 95%;
      padding: 15px 10px;
      position: relative;
      text-align: center;
      margin: 20px auto;
      max-width: 800px;
  }

  .age-item {
      width: 100%;
      max-width: none;
  }

  .content-details p {
      font-size: 0.8em;
  }
  
  .RectangleFigma {
    margin: 30px auto 0;
  }
}

@media screen and (max-width: 475px) {
  .TitleJuice {
      font-size: 32px;
  }

  .TextAlbums,
  .TextTimeline {
      font-size: 16px;
  }

  .overlay-2 {
    background-size: auto 100%;
  }
  
  .albumGBGR,
  .albumWOD,
  .albumDRForLove,
  .albumLegNDies,
  .albumFightDeamon,
  .albumPartyNEnds {
    max-width: 100px;
  }
  
  .Image2017,
  .Image2018,
  .Image2019,
  .ImageInfinity {
    max-width: 200px;
  }
}
/* Base styles that apply to all devices */
.age-item figure {
    position: relative;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent; /* Removes the default tap highlight on iOS */
    touch-action: manipulation; /* Optimizes touch handling */
}

/* Base styles */
.content-overlay,
.content-details {
    position: absolute;
    opacity: 0; /* Start with everything hidden */
    transition: opacity 0.3s ease;
}

.content-overlay {
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
}

.content-details {
    text-align: center;
    padding: 1em;
    width: 100%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
}

/* Desktop styles */
@media (hover: hover) and (pointer: fine) {
    .age-item figure:hover .content-overlay,
    .age-item figure:hover .content-details {
        opacity: 1;
    }
}

/* Mobile/Touch styles */
@media (hover: none) {
    .content-overlay,
    .content-details {
        opacity: 0;
        visibility: hidden; /* Add visibility property */
    }

    .age-item figure.active .content-overlay,
    .age-item figure.active .content-details {
        opacity: 1;
        visibility: visible;
    }
}

/* Additional iOS specific fixes */
@supports (-webkit-touch-callout: none) {
    .content-details {
        opacity: 0;
        visibility: hidden;
    }
    
    .age-item figure.active .content-details {
        opacity: 1;
        visibility: visible;
    }
}