/* --== Global Styles ==-- */

html {
  font-family: "Times New Roman", Times, serif;
  overflow-x: hidden;
}

html::-webkit-scrollbar {
  width: 10px;
}

html::-webkit-scrollbar-track {
  background: transparent;
}

html::-webkit-scrollbar-thumb {
  border-radius: 0px;
}

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

/* --== Utility Classes ==-- */

.clickable {
  cursor: pointer;
}

.divider {
  height: 6.5vh;
}

.inactive {
  display: none !important;
}

.page {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
}

/* --== Main Page Layout ==-- */

#mainPage {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: stretch;
}

/* --== Introduction Sections ==-- */

#marIntroduction,
#ourIntroduction,
#merIntroduction {
  width: 100vw;
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
  background-size: cover;
  background-position: center;
  transition: height 1s ease-in;
}

#marIntroduction,
#merIntroduction {
  height: 35vh;
}

#ourIntroduction {
  height: 20vh;
}

#marIntroduction {
  background-image: url(Assets/Images/MarBackdrop.png);
}

#ourIntroduction {
  background-image: url(Assets/Images/OurBackdrop.png);
}

#merIntroduction {
  background-image: url(Assets/Images/MerBackdrop.png);
}

#marIntroduction:hover {
  height: 48vh;
  transition: height 1s ease-out;
}

#marIntroduction.shrink {
  height: 32vh;
  transition: height 1s ease-out;
}

#marIntroduction:hover #marTextSlider {
  transform: translateY(-50%) translateX(15vw);
  opacity: 1;
  transition:
    transform 1s ease-out,
    opacity 1s ease-out;
}

#ourIntroduction:hover {
  height: 25vh;
  transition: height 1s ease-out;
}

#ourIntroduction:hover #ourTextSlider {
  transform: translateY(-50%) translateX(-50%);
  opacity: 1;
  transition:
    transform 1s ease-out,
    opacity 1s ease-out;
}

#ourIntroduction.shrink {
  height: 10vh;
  transition: height 1s ease-out;
}

#merIntroduction:hover {
  height: 48vh;
  transition: height 1s ease-out;
}

#merIntroduction.shrink {
  height: 32vh;
  transition: height 1s ease-out;
}

#merIntroduction:hover #merTextSlider {
  transform: translateY(-50%) translateX(40vw);
  opacity: 1;
  transition:
    transform 1s ease-out,
    opacity 1s ease-out;
}

/* --== Image Positioning ==-- */

#marImage {
  pointer-events: none;
  position: absolute;
  bottom: 0px;
  right: 0%;
  height: 115%;
  width: auto;
  z-index: 10;
}

#ourImage {
  pointer-events: none;
  position: absolute;
  left: 50%;
  transform: translateX(-50%) translateY(-17%);
  height: 150%;
  width: auto;
  z-index: 10;
}

#merImage {
  pointer-events: none;
  position: absolute;
  bottom: 0px;
  left: 0%;
  height: 115%;
  width: auto;
  z-index: 10;
}

/* --== Text Sliders ==-- */

#marTextSlider,
#merTextSlider {
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: absolute;
  top: 50%;
  left: 5%;
  align-items: center;
  width: 35%;
  z-index: 20;
  transition:
    transform 1s ease-in,
    opacity 1s ease-in;
  opacity: 0;
}

#ourTextSlider {
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: absolute;
  top: 50%;
  left: 50%;
  align-items: center;
  width: 100%;
  z-index: 20;
  transition:
    transform 1s ease-in,
    opacity 1s ease-in;
  opacity: 0;
}

#marTextSlider {
  transform: translateY(-50%) translateX(-25vw);
}

#merTextSlider {
  transform: translateY(-50%) translateX(75vw);
}

#ourTextSlider {
  transform: translateY(calc(-50%)) translateX(-50%);
}

/* --== Typography ==-- */

#marName,
#ourName,
#merName {
  font-size: clamp(2rem, 7vh, 70vw);
  font-weight: bold;
  margin-bottom: 0.5rem;
}

#marAlias,
#ourAlias,
#merAlias {
  font-size: clamp(1rem, 4vh, 50vw);
  text-align: center;
  line-height: 1.5;
}

#websiteTitle {
  font-size: 2.5rem;
  font-weight: bold;
  margin-bottom: 1rem;
  text-align: center;
}

/* --== Overlay ==-- */

.overlay-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
}

.overlay-divider {
  position: absolute;
  top: 0;
  height: 100vh;
  width: 50vw;
  transition:
    transform 1s ease-in-out,
    opacity 1s ease-in;
}

.overlay-left {
  left: 0;
  transform: translateX(0);
}

.overlay-right {
  right: 0;
  transform: translateX(0);
}

.overlay-container.overlayHidden .overlay-left {
  transform: translateX(-50vw);
}

.overlay-container.overlayHidden .overlay-right {
  transform: translateX(50vw);
}

#overlayContainer {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 300;
  opacity: 1;
  transition: opacity 1s ease-out;
}

#overlayContainer img {
  width: clamp(50vh, 25vw, 80vw);
  max-width: 80vh;
  height: auto;
}

#overlayContainer p {
  font-size: 2vh;
}

.overlay-container.overlayHidden #overlayContainer {
  opacity: 0;
  pointer-events: none;
}

.overlayHidden {
  pointer-events: none;
}

/* --== Footer & Music ==-- */

footer {
  position: fixed;
  display: flex;
  justify-content: space-between;
  bottom: 0;
  width: 100vw;
  height: fit-content;
  text-align: center;
  padding: 5px;
  z-index: 100;
  backdrop-filter: blur(4px);
}

#musicContainer {
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: left;
}

#infoContainer {
  display: flex;
  align-items: center;
  justify-content: center;
}

.medIcon {
  height: 50px;
  padding: 5px;
  padding-right: 10px;
  padding-left: 10px;
}

.miniIcon {
  height: 30px;
  margin: 5px;
}

.tinyIcon {
  height: 25px;
  padding: 5px;
}

@media (max-width: 768px) {
  .medIcon {
    height: 40px;
    padding: 4px;
    padding-right: 5px;
    padding-left: 5px;
  }

  .miniIcon {
    height: 25px;
    margin: 4.5px;
  }

  .tinyIcon {
    height: 20px;
    padding: 3.75px;
  }

  #currentTitle {
    font-size: 0.8rem;
  }
  #currentArtist {
    height: 0;
    width: 0;
    font-size: 0;
  }
  .MarMerName {
    height: 0;
    width: 0;
    font-size: 0;
  }
}

/* --== Settings Panels ==-- */

.settings {
  position: fixed;
  backdrop-filter: blur(5px);
  opacity: 1;
  z-index: 70;
  bottom: 0;
  left: 0;
  transition:
    bottom 1s ease-out,
    opacity 1s ease-out;
}

.hidden {
  pointer-events: none;
  opacity: 0;
  bottom: -110vh;
  transition:
    bottom 1s ease-in,
    opacity 1s ease-in,
    height 1s ease-in,
    width 1s ease-in;
  height: 0;
  width: 0;
}

#generalSettings {
  margin-left: 2.5vw;
  margin-right: 2.5vw;
  margin-top: 2.5vh;
  margin-bottom: 2.5vh;
  height: 95vh;
  width: 95vw;
}

#musicSettings {
  display: flex;
  margin-left: 1.5vw;
  margin-right: 1.5vw;
  margin-top: 1.5vh;
  margin-bottom: clamp(60px, 4vh, 200px);
  height: fit-content;
  width: fit-content;
}

.audioSetting {
  display: flex;
  flex-direction: column;
}

.audioSlider {
  writing-mode: vertical-lr;
  direction: rtl;
}

/* --== Home Button ==-- */

.homeButton {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: flex-end;

  height: 10vh;
  width: 100vw;

  background-size: cover;
  background-position: center;
  overflow: visible;

  transition: height 1s ease-in;
}

.homeButton:hover {
  height: 18vh;
  transition: height 1s ease-out;
}

#ourHomeButton,
#connectHomeButton {
  background-image: url(Assets/Images/OurBackdrop.png);
}

#marHomeButton {
  background-image: url(Assets/Images/MarBackdrop.png);
}

#merHomeButton {
  background-image: url(Assets/Images/MerBackdrop.png);
}

.homeButtonImage {
  position: relative;
  bottom: -28.75%;
  height: 150%;
  width: auto;

  transition: transform 0.75s ease;
}

.homeButtonTextSlider {
  position: absolute;
  left: 50%;
  bottom: 0;

  display: flex;
  justify-content: center;
  align-items: center;

  width: 100%;
  z-index: 20;

  opacity: 0;
  transform: translateX(-50%) translateY(-100%);

  transition:
    transform 1s ease-out,
    opacity 1s ease-out;
}

.homeButton:hover .homeButtonTextSlider {
  opacity: 1;
  transform: translateX(-50%) translateY(-70%);
}

.homeButtonText {
  font-size: clamp(2rem, 6vh, 70vw);
  font-weight: bold;
  margin: 0;
}

/* --== Card Grid ==-- */

.cardGrid {
  display: grid;
  gap: 2.5vw;
  padding: 2.5vw;

  grid-template-columns: repeat(auto-fill, minmax(20vw, 1fr));
}

.card {
  position: relative;
  aspect-ratio: 3 / 4;
  transition: transform 0.15s ease;
  background-image: url(Assets/Images/OurBackdrop.png);
  background-size: cover;
  background-position: center;
}

.card:hover {
  transform: scale(1.08);
  z-index: 10;
}

.cardTextSlider {
  position: absolute;
  left: 50%;
  bottom: 50%;

  display: flex;
  justify-content: center;
  align-items: center;

  width: 100%;
  z-index: 20;

  opacity: 0;
  transform: translateX(-50%) translateY(100%);

  transition:
    transform 1s ease-in,
    opacity 1s ease-in;
}

.card:hover .cardTextSlider {
  opacity: 1;
  transform: translateX(-50%) translateY(50%);

  transition:
    transform 1s ease-out,
    opacity 1s ease-out;
}

.cardText {
  font-size: clamp(2rem, 6vh, 70vw);
  font-weight: bold;
  margin: 0;
  text-align: center;
}

@media (max-width: 768px) {
  .cardGrid {
    grid-template-columns: repeat(auto-fill, minmax(42.5vw, 1fr));
  }
}

/* --== Journal Header ==-- */

#movieJournalPage,
#gameJournalPage {
  padding: 2rem clamp(1rem, 3vw, 2rem) 6rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  min-height: 100vh;
}

.moviePageHeader,
.gamePageHeader {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.moviePageHeader h1,
.gamePageHeader h1 {
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: bold;
  margin-bottom: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.moviePageHeader p,
.gamePageHeader p {
  font-size: 0.95rem;
}

.moviePageActions,
.gamePageActions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.35rem;
}

.movieActionButton,
.gameActionButton,
.authModalActions button {
  border: none;
  border-radius: 999px;
  padding: 0.7rem 1.15rem;
  font: inherit;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.movieActionButton:hover,
.gameActionButton:hover,
.authModalActions button:hover {
  transform: translateY(-1px);
}

.authStatus {
  font-size: 0.95rem;
}

/* --== Journal Search ==-- */

.movieSearchContainer,
.gameSearchContainer {
  position: relative;
}

.gameSearchRow {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

#movieSearch,
#gameSearch {
  width: 100%;
  padding: 0.9rem 1rem;
  border-radius: 999px;
  font: inherit;
}

.gameSearchRow #gameSearch {
  flex: 1;
  min-width: 0;
}

.sourceToggle {
  display: flex;
  flex-shrink: 0;
  border-radius: 999px;
  padding: 0.25rem;
  gap: 0.25rem;
}

.sourceToggleOption {
  border: none;
  border-radius: 999px;
  padding: 0.6rem 1rem;
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  white-space: nowrap;
  transition:
    background 0.2s ease,
    color 0.2s ease;
}

@media (max-width: 768px) {
  .gameSearchRow {
    flex-wrap: wrap;
  }

  .gameSearchRow #gameSearch {
    flex-basis: 100%;
  }

  .sourceToggle {
    flex: 1;
  }

  .sourceToggleOption {
    flex: 1;
    text-align: center;
    padding: 0.55rem 0.75rem;
  }
}

.searchResults {
  position: absolute;
  top: calc(100% + 0.35rem);
  left: 0;
  right: 0;
  display: none;
  flex-direction: column;
  gap: 0.5rem;
  backdrop-filter: blur(10px);
  border-radius: 1rem;
  padding: 0.75rem;
  z-index: 80;
  max-height: 55vh;
  overflow-y: auto;
}

.searchResultItem {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  text-align: left;
  padding: 0.5rem;
  border-radius: 0.75rem;
  cursor: pointer;
  transition: background 0.2s ease;
}

.searchResultItem img {
  width: 54px;
  height: 81px;
  object-fit: cover;
  border-radius: 0.4rem;
}

/* --== Journal Grid ==-- */

.movieJournalMessage,
.gameJournalMessage {
  min-height: 1.4rem;
  font-size: 0.95rem;
}

.movieSection,
.gameSection {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.movieSection h2,
.gameSection h2 {
  font-size: 1.35rem;
}

.movieGrid,
.gameGrid {
  display: grid;
  gap: 0.5rem;
  grid-template-columns: repeat(auto-fill, minmax(200px, 10vw));
  justify-content: space-evenly;
}

@media (max-width: 768px) {
  .movieGrid,
  .gameGrid {
    grid-template-columns: repeat(auto-fill, minmax(50px, 43vw));
  }
}

.movieCardWrapper,
.gameCardWrapper {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.movieCardWrapper.expanded,
.gameCardWrapper.expanded {
  grid-column: 1 / -1;
}

.movieCardWrapper.expanded .movieCard,
.gameCardWrapper.expanded .gameCard {
  width: 100%;
  height: clamp(220px, 34vh, 320px);
  aspect-ratio: auto;
}

.movieCard,
.gameCard {
  position: relative;
  overflow: hidden;
  border-radius: 1rem;
  aspect-ratio: 2 / 3;
  cursor: pointer;
  background-image: url(Assets/Images/OurBackdrop.png);
  background-size: cover;
  background-position: center;
  transition: transform 0.15s ease;
}

.movieCard:hover,
.gameCard:hover {
  transform: scale(1.04);
}

.movieCard img,
.gameCard img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.movieCardBadge {
  position: absolute;
  top: 0.7rem;
  right: 0.7rem;
  padding: 0.3rem 0.6rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  backdrop-filter: blur(6px);
}

.cardFavoriteStars {
  position: absolute;
  top: 0.7rem;
  left: 0.7rem;
  display: flex;
  gap: 0.3rem;
  z-index: 1;
}

.merFavoriteStar,
.marFavoriteStar {
  width: 3cqh !important;
  height: auto;
  object-fit: contain;
}

.starRating {
  position: relative;
  display: inline-block;
  font-size: 1rem;
  line-height: 1;
  white-space: nowrap;
  vertical-align: middle;
  width: fit-content;
}

.starRatingTrack,
.starRatingFill {
  display: block;
}

.starRatingFill {
  position: absolute;
  top: 0;
  left: 0;
  width: var(--star-fill, 0%);
  overflow: hidden;
}

.movieCardOverlay,
.gameCardOverlay {
  position: absolute;
  inset: auto 0 0 0;
  padding: 0.75rem;
}

.movieCardTitle,
.gameCardTitle {
  font-weight: 700;
  line-height: 1.2;
}

.movieCardYear,
.gameCardYear {
  font-size: 0.9rem;
  opacity: 0.85;
}

/* --== Journal Detail Panel ==-- */

.movieDetailPanel,
.gameDetailPanel {
  display: grid;
  grid-template-columns: minmax(25vw, 35vw) minmax(65vw, 75vw);
  gap: 1rem;
  padding: 1rem;
  border-radius: 1rem;
}

@media (max-width: 768px) {
  .movieDetailPanel,
  .gameDetailPanel {
    grid-template-columns: minmax(0, 0) minmax(100%, 100%);
    gap: 0;
  }
}

.movieDetailPanel img,
.gameDetailPanel img {
  width: 100%;
  border-radius: 0.9rem;
  object-fit: cover;
}

.movieDetailBody,
.gameDetailBody {
  display: grid;
  gap: 0.5rem;
  align-content: stretch;
  align-items: center;
}

.movieDetailHeader,
.gameDetailHeader {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  height: fit-content;
  padding: 15px;
}

.movieDetailHeader h3,
.gameDetailHeader h3 {
  font-size: 1.2rem;
  margin-bottom: 0.35rem;
}

.movieDetailMeta,
.gameDetailMeta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.95rem;
}

.movieDetailDescription,
.gameDetailDescription {
  display: grid;
  gap: 0.35rem;
  height: fit-content;
}

.movieDetailDescription h4,
.movieDetailCard h4,
.gameDetailDescription h4,
.gameDetailCard h4 {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  height: fit-content;
}

.movieDetailSplitGrid,
.gameDetailSplitGrid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  height: stretch;
}

.movieDetailCard,
.gameDetailCard {
  display: grid;
  gap: 0.6rem;
  padding: 0.8rem;
  border-radius: 0.9rem;
}

.movieDetailBottomRow,
.gameDetailBottomRow {
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: 0.75rem;
}

.movieDetailBody textarea,
.movieDetailBody input,
.movieDetailBody select,
.gameDetailBody textarea,
.gameDetailBody input,
.gameDetailBody select {
  width: 100%;
  border-radius: 0.6rem;
  padding: 0.55rem 0.7rem;
  font: inherit;
}

.movieDetailBody textarea,
.gameDetailBody textarea {
  min-height: 90px;
  height: stretch;
  overflow: hidden;
  resize: vertical;
}

.movieDetailBody label,
.gameDetailBody label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.95rem;
}

.movieActionRow,
.gameActionRow {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.45rem;
}

.movieActionButtonCompact,
.movieDeleteButton,
.gameActionButtonCompact,
.gameDeleteButton {
  border: none;
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  font: inherit;
  cursor: pointer;
  white-space: nowrap;
  width: fit-content;
  height: fit-content;
}

/* --== Auth Modal ==-- */

.authModal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(6px);
  z-index: 200;
}

.authModal.hidden {
  display: none;
}

.authModalCard {
  width: min(92vw, 380px);
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  padding: 1.2rem;
  border-radius: 1rem;
}

.authModalCard input {
  border-radius: 0.75rem;
  padding: 0.7rem 0.8rem;
  font: inherit;
}

.authModalActions {
  display: flex;
  gap: 0.6rem;
  justify-content: flex-end;
}

.authMessage {
  min-height: 1.1rem;
  font-size: 0.95rem;
}

/* --== Habitat Page ==-- */

#habitatPage {
  position: relative;
  width: 100vw;
  height: stretch;
}
