@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:ital,wght@0,100..700;1,100..700&display=swap");

/* Global Resets and Box Sizing */
html {
  box-sizing: border-box;
}

*,
*::before,
*::after {
  box-sizing: inherit;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  font-family: "IBM Plex Sans", sans-serif;
  font-optical-sizing: auto;
}

/* Canvas (if used) */
canvas {
  display: block;
}

/* (Optional) Unity container & canvas styles */
#unity-container,
#unity-canvas {
  width: 100%;
  height: 100%;
  background: #000;
  background-image: url("./backgroundImage.jpg"); /* Replace with your image URL */
  background-repeat: repeat; /* Repeats both horizontally and vertically */
  background-size: auto; /* Keeps original size */
}

.top-bar {
  position: fixed;
  bottom: 0;
  display: flex;
  justify-content: space-around;
  z-index: 1000;
  opacity: 0.4;
  font-size: 12px;
  flex-direction: row;
  text-align: right;
  width: 400px;
}

.left-link,
.right-link {
  text-decoration: none;
  font-weight: bold;
  color: gray;
  margin: 2px 0px;
}

.left-link:hover,
.right-link:hover {
  text-decoration: underline;
}

/* Loading Screen */
#loading-screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

#loading-cover {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 10;
  transform: scale(0.88);
}

#orientation-element {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 10;
  padding: 4vw;
  box-sizing: border-box;
}

/* Portrait View (default) */
.portrait-view {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  color: white;
  width: 100%;
  max-width: 500px;
}

#orientation-text1 {
  font-size: 35px;
  font-weight: bold;
}

#orientation-text2 {
  font-size: clamp(14px, 3.5vw, 20px);
  margin-bottom: 2vh;
  padding: 0 5vw;
}

#orientation-logo {
  width: 40vw;
  max-width: 250px;
  margin-bottom: 4vh;
}

#orientation-logo img {
  width: 100%;
  height: auto;
  display: block;
}

.orientation-button {
  padding: 1.2em 2em;
  background: linear-gradient(to bottom, #9e0000, #4a0000);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: clamp(14px, 4vw, 18px);
  cursor: pointer;
  transition: background 0.3s ease;
}

.orientation-button:hover {
  background: linear-gradient(to bottom, #b30000, #5a0000);
}

/* Landscape View */
.landscape-view {
  display: none;
  flex-direction: row;
  width: 100%;
  max-width: 1000px;
  height: 100%;
  color: white;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

.landscape-image {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 3vw;
}

.landscape-image img {
  width: 100%;
  height: auto;
  max-height: 100%;
  object-fit: contain;
}

.landscape-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 5vw;
  gap: 2vh;
  box-sizing: border-box;
}

.landscape-text1 {
  font-size: clamp(20px, 4vw, 28px);
  font-weight: bold;
}

.landscape-text2 {
  font-size: 16px;
}

.landscape-content .orientation-button {
  align-self: flex-start;
  margin-top: 3vh;
}

/* Responsive Orientation Handling */
@media (orientation: portrait) {
  .portrait-view {
    display: flex;
  }
  .landscape-view {
    display: none;
  }
  .orientation-button {
    position: absolute;
  }
}

@media (orientation: landscape) {
  .portrait-view {
    display: none;
  }
  .landscape-view {
    display: flex;
  }
  .orientation-button {
    position: inherit;
  }
}

/* Unity Loading Bar and Info */
#unity-loading-bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: #fff;
  padding: 20px;
}

.loading-info {
  display: flex;
  justify-content: space-between;
  width: 90%;
  font-size: 16px;
  margin-bottom: 10px;
}

.loading-percentage,
.loading-size {
  /* Additional styling can be added here if needed */
  font-weight: bold;
}

/* Progress Bar */
#progress {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 100px;
  display: none;
  align-items: center;
  height: 10px;
  width: 90%;
  margin: 10px 0;
}

#progress-value {
  background: #ffffff;
  border-radius: 100px;
  height: 100%;
  width: 0; /* Will be updated via JavaScript */
  transition: width 0.3s;
}

.orientation-button {
  background-color: initial;
  background-image: linear-gradient(#a32727 0, #181818 100%);
  border-radius: 5px;
  border-style: none;
  box-shadow: rgba(245, 244, 247, 0.25) 0 1px 1px inset;
  color: #fcfcfc;
  cursor: pointer;
  display: inline-block;
  font-family: Inter, sans-serif;
  font-size: 16px;
  font-weight: 500;
  margin-left: -4px;
  outline: 0;
  text-align: center;
  transition: all 0.3s cubic-bezier(0.05, 0.03, 0.35, 1);
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  vertical-align: bottom;
  width: 190px;
  bottom: 20px;
  padding: 10px 20px;
}

.orientation-button:hover {
  opacity: 0.7;
}

/* Loading Time */
#unity-loading-time {
  width: 90%;
  text-align: right;
  opacity: 0.3;
  margin-bottom: 10px;
}

/* Video Styling */
video {
  width: 60vw;
  background-color: #000;
  object-fit: cover;
  margin: 15px 0;
}

/* Button Styling */
.button {
  font-size: 17px;
  border-radius: 12px;
  background: linear-gradient(
    180deg,
    rgb(88, 88, 88) 0%,
    rgb(80, 80, 80),
    rgb(82, 82, 82) 100%
  );
  color: rgb(255, 255, 255);
  border: none;
  padding: 2px;
  font-weight: 700;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  width: 100%;
  max-width: 500px;
  margin: 13.5px 0;
}

.button span {
  border-radius: 10px;
  padding: 0.8em 1.3em;
  padding-right: 1.2em;
  text-shadow: 0px 0px 20px #4b4b4b;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  transition: all 0.3s;
  background-color: rgb(29, 29, 29);
  background-image: radial-gradient(
      at 95% 89%,
      rgb(15, 15, 15) 0px,
      transparent 50%
    ),
    radial-gradient(at 0% 100%, rgb(17, 17, 17) 0px, transparent 50%),
    radial-gradient(at 0% 0%, rgb(29, 29, 29) 0px, transparent 50%);
  justify-content: center;
}

.button:hover span {
  background-color: rgb(65, 61, 61);
}

.button-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-conic-gradient(
      rgb(48, 47, 47) 0.0000001%,
      rgb(51, 51, 51) 0.000104%
    )
    60% 60%/600% 600%;
  filter: opacity(10%) contrast(105%);
  -webkit-filter: opacity(10%) contrast(105%);
}

.button svg {
  width: 15px;
  height: 15px;
}

/* Spinner */
.spinner {
  border-radius: 50%;
  width: 3em;
  height: 3em;
  border: 4px solid rgba(255, 255, 255, 0.2);
  border-top: 4px solid #fff;
  animation: spinner-spin 1s infinite linear;
  margin-top: 15px;
  display: none;
}

@keyframes spinner-spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Base container styles */
/* Base styles for the logo container */
#unity-logo {
  display: flex;
  width: 100%;
  box-sizing: border-box;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

/* Portrait orientation (default) */
#unity-logo {
  text-align: center;
}

#unity-logo > img {
  max-width: 100%;
}

#unity-logo > div {
  display: flex;
  align-items: center;
  width: 100%;
  flex-direction: column;
  justify-content: center;
}

#unity-logo > hr {
  color: #3d3d3d;
  background-color: #3d3d3d;
  border: none;
}

#unity-logo > div > img {
  max-width: 200px;
  height: auto;
}

/* Landscape orientation */
@media (orientation: landscape) {
  #unity-logo {
    flex-direction: row;
    text-align: center;
  }

  #unity-logo > hr {
    width: 1px;
    height: 110px;
  }

  #unity-logo > img {
    max-width: 60%;
    margin-bottom: 0;
    margin-right: 20px;
  }

  #unity-logo > div > img {
    max-width: 220px;
  }

  #unity-logo > div > div {
    font-size: 15px;
    font-weight: bold;
    margin-left: 20px;
    margin-top: 10px;
  }
}

/* Additional responsiveness for very small screens */
/* For very narrow mobile screens */
@media (max-width: 360px) {
}

@media (max-width: 480px) {
  #unity-logo {
    flex-direction: column;
    text-align: center;
  }

  #unity-logo > hr {
    width: 0px;
    height: 0px;
  }

  #unity-logo > div > div {
    margin-top: 10px;
    font-weight: bold;
  }
}

/* Responsive Styles */
@media (max-width: 768px) {
  .loading-info {
    font-size: 12px;
  }

  #unity-loading-time {
    font-size: 10px;
  }

  #unity-loading-bar {
    min-width: 60vw;
  }
  #orientation-element {
    transform: scale(0.9);
  }
}

@media (max-width: 480px) {
  .spinner {
    width: 2.5em;
    height: 2.5em;
  }

  #unity-loading-bar {
    min-width: 80vw;
  }

  #orientation-element {
    transform: scale(0.95);
  }
}

/* Fullscreen Toast Styles */
.fullscreen-toast,
.add-home-toast {
  position: fixed;
  bottom: -100px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.75);
  color: white;
  padding: 12px 16px;
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-width: 280px;
  max-width: 90%;
  z-index: 9999;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  opacity: 0;
  transition: all 0.3s ease;
}

.fullscreen-toast.visible,
.add-home-toast.visible {
  bottom: 24px;
  opacity: 1;
}

.toast-actions {
  display: flex;
  align-items: center;
  margin-left: 12px;
}

.fullscreen-btn,
.instructions-btn {
  background: #3478f6;
  color: white;
  border: none;
  border-radius: 4px;
  padding: 6px 12px;
  font-size: 14px;
  cursor: pointer;
  margin-right: 8px;
}

.close-toast-btn {
  background: transparent;
  color: white;
  border: none;
  font-size: 20px;
  cursor: pointer;
  padding: 0 6px;
}

/* iOS Instructions Modal Styles */
.ios-instructions-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.ios-instructions-modal.visible {
  opacity: 1;
  pointer-events: auto;
}

.ios-instructions-modal.hiding {
  opacity: 0;
}

.ios-instructions-content {
  background: white;
  border-radius: 12px;
  padding: 24px;
  max-width: 90%;
  width: 340px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
}

.ios-instructions-content h3 {
  margin-top: 0;
  color: #333;
  font-size: 18px;
}

.ios-instructions-content ol {
  padding-left: 24px;
  margin-bottom: 20px;
}

.ios-instructions-content li {
  margin-bottom: 12px;
  color: #444;
  font-size: 16px;
}

.share-icon,
.add-icon {
  display: inline-block;
  margin-left: 4px;
  font-size: 18px;
}

.close-instructions-btn {
  background: #3478f6;
  color: white;
  border: none;
  border-radius: 6px;
  padding: 8px 16px;
  font-size: 16px;
  cursor: pointer;
  width: 100%;
}

/* When both toast types are present */
.add-home-toast + .fullscreen-toast,
.fullscreen-toast + .add-home-toast {
  bottom: 84px; /* Stack toasts with spacing if both appear */
}
