/* Resource Grid */
.resource-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 3rem;
}

.resource-section {
  text-align: center;
  overflow-y: scroll;
  padding: 0rem;
}

.resource-title {
  font-size: 1.8rem;
  position: sticky;
  top: 0;
  font-weight: 600;
  color: #1e6091;
  padding: 1.5rem;
  background: rgba(255, 255, 255, 0.87);
  z-index: 10;
}

.resource-items {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin: 1.5rem;
  margin-top: 0;
}

#page-4 .page-content {
  justify-content: center;
  align-items: normal;
}

.apps {
  grid-row: 1 / 3;
}

.apps .resource-items {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.resource-btn {
  width: 100%;
  text-align: center;
  background: rgba(30, 96, 145, 0.1);
  border-color: rgba(30, 96, 145, 0.3);
  color: #1e6091;
}

.resource-btn > i {
  margin-right: 0.5rem;
}

.resource-btn:hover {
  background: rgba(30, 96, 145, 0.2);
  color: #4682b4;
  cursor: pointer;
}

.breathing-area {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gradient-animation {
  position: absolute;
  width: 10vh;
  height: 10vh;
  background: radial-gradient(
    circle,
    rgba(214, 234, 102, 0.4) 0%,
    rgba(255, 230, 0, 0.3) 30%,
    rgba(255, 153, 0, 0.295) 60%,
    rgba(255, 0, 0, 0.1) 100%
  );
  border-radius: 50%;
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 0, 0, 0.2);
}

.gradient-animation.inhale {
  width: 25vh;
  height: 25vh;
  transition: all 4s cubic-bezier(0.4, 0, 0.6, 1);
}

.gradient-animation.exhale {
  width: 10vh;
  height: 10vh;
  transition: all 4s cubic-bezier(0.4, 0, 0.6, 1);
}

.timer-content {
  position: relative;
  z-index: 10;
  text-align: center;
  color: #2c3e50;
}

.timer-display {
  font-size: clamp(2rem, 5vh, 4rem);
  font-weight: 200;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  margin-bottom: 1rem;
}

.phase-text {
  font-size: clamp(1.2rem, 3vh, 2rem);
  font-weight: 300;
  opacity: 0.8;
  min-height: 2.5rem;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  color: #555;
}

.controls-section {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
}

.play-pause-btn {
  width: 8vh;
  height: 8vh;
  border: none;
  border-radius: 50%;
  background: rgba(102, 126, 234, 0.15);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(102, 126, 234, 0.3);
  color: #2c3e50;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  box-shadow: 0 8px 32px rgba(102, 126, 234, 0.1);
}

.play-pause-btn:hover {
  background: rgba(102, 126, 234, 0.25);
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(102, 126, 234, 0.2);
}

.play-pause-btn:active {
  transform: translateY(-1px);
}

.play-icon,
.pause-icon {
  transition: opacity 0.3s ease;
}

.pause-icon {
  display: none;
}

.play-pause-btn.playing .play-icon {
  display: none;
}

.play-pause-btn.playing .pause-icon {
  display: block;
}

.presets {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1rem;
  width: 100%;
  max-width: 600px;
  overflow-x: show;
}

.preset-btn {
  padding: 0.2rem;
}

.preset-btn.active {
  background: rgba(102, 126, 234, 0.25);
  border-color: rgba(102, 126, 234, 0.5);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.2);
  color: #1a252f;
}

.preset-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

@media (max-width: 800px) {
  body {
    padding: 1rem;
  }

  h1 {
    font-size: 2.2rem;
  }

  .subtitle {
    font-size: 1rem;
  }

  .breathing-area {
    height: 15vh;
  }

  .gradient-animation {
    width: 8vh;
    height: 8vh;
  }

  .gradient-animation.inhale {
    width: 15vh;
    height: 15vh;
  }

  .gradient-animation.exhale {
    width: 120px;
    height: 120px;
  }

  .play-pause-btn {
    position: relative;
    width: 8vh;
    height: 8vh;
  }

  .phase-text {
    font-size: 1rem;
  }

  .presets {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
  }

  .presets > button {
    border-radius: 50%;
    padding: 0.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .presets > button > span {
    display: none;
  }
}

@media (max-width: 700px) {
  .resource-grid {
    grid-template-columns: 1fr;
    grid-template-rows: repeat(4, 1fr);
  }

  .breathe {
    height: 40vh;
  }

  .apps {
    grid-row: 2 / 5;
    height: 70vh;
  }

  .additional {
    height: 40vh;
  }

  .gradient-animation.inhale {
    width: 25vh;
    height: 25vh;
  }

  .apps .resource-items {
    grid-template-columns: 1fr;
  }
}
