/* ============================================
   Animations
   ============================================ */

@keyframes blink {
  from,
  25%,
  to {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  50% {
    transform: rotate(720deg);
  }
  to {
    transform: rotate(1440deg);
  }
}

@keyframes bounce {
  from,
  6.66%,
  17.66%,
  33.33% {
    animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
    transform: translate3d(0, 0, 0);
  }
  13.33%,
  14.33% {
    animation-timing-function: cubic-bezier(0.755, 0.05, 0.855, 0.06);
    transform: translate3d(0, -30px, 0) scaleY(1.1);
  }
  23.33% {
    animation-timing-function: cubic-bezier(0.755, 0.05, 0.855, 0.06);
    transform: translate3d(0, -15px, 0) scaleY(1.05);
  }
  26.66% {
    transition-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
    transform: translate3d(0, 0, 0) scaleY(0.95);
  }
  30% {
    transform: translate3d(0, -4px, 0) scaleY(1.02);
  }
}

/* ============================================
   Base Styles
   ============================================ */

body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  font-family: "Rubik", sans-serif;
  user-select: none;
}

.reminder i {
  color: whitesmoke;
  font-size: 0.8em;
  height: 12px;
  line-height: 12px;
}

.reminder span {
  display: inline-block;
  overflow: visible;
  width: auto;
  align-items: center;
  position: relative;
  height: auto;
  background: transparent;
  /* remove scrolling animation from the welcome/admin reminder */
  animation: none !important;
}
span {
  color: #5a5a5a;
  font-family: "Rubik", sans-serif;
  font-weight: 400;
  margin: 0;
  padding: 0;
}

/* ============================================
   Utility Classes
   ============================================ */

.background-image {
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

.clear-button {
  backdrop-filter: blur(3px);
  background-color: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 100px;
  box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  transition: all 250ms;
}

.clear-button:hover {
  background-color: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

/* ============================================
   App Container
   ============================================ */

#app {
  background-color: #1e1e1e;
  min-height: 100vh;
  position: relative;
}

/* ============================================
   App States
   ============================================ */

#app.logged-out #app-info {
  margin-left: 40px;
  opacity: 1;
  transform: translateX(0%);
}

#app.logged-out #app-background {
  cursor: pointer;
}

#app.logged-out #sign-in-button-wrapper {
  opacity: 1;
  pointer-events: all;
  transform: translate(-50%, -40px);
}

#app.logging-in #app-background #app-background-image,
#app.verifying-log-in #app-background #app-background-image,
#app.log-in-error #app-background #app-background-image {
  filter: blur(8px);
  transform: scale(1.2);
}

#app.logging-in #app-pin-wrapper,
#app.log-in-error #app-pin-wrapper {
  opacity: 1;
  pointer-events: all;
  transform: translate(-50%, -50%) scale(1);
}

#app.verifying-log-in #app-loading-icon {
  opacity: 1;
  transform: translate(-50%, -50%);
}

#app.log-in-error #app-pin-wrapper #app-pin .app-pin-digit {
  background-color: rgba(239, 83, 80, 0.05);
  border-color: rgba(239, 83, 80, 0.5);
}

#app.logged-in #app-menu {
  height: auto;
  overflow: initial;
  opacity: 1;
  pointer-events: all;
  transform: translateY(0%);
}

/* ============================================
   Scrollable Components
   ============================================ */

#app .scrollable-component {
  cursor: grab;
  overflow: auto;
  user-select: none;
  width: 100%;
}

#app .scrollable-component:active {
  cursor: grabbing;
}

#app .scrollable-component::-webkit-scrollbar {
  height: 0;
  width: 0;
}

/* ============================================
   Loading Icon
   ============================================ */

#app-loading-icon {
  left: 50%;
  opacity: 0;
  pointer-events: none;
  position: absolute;
  top: 50%;
  transform: translate(-50%, 0%);
  transition: opacity 250ms, transform 250ms;
  z-index: 2;
}

#app-loading-icon i {
  animation: 2s spin ease-in-out infinite;
  color: white;
  font-size: 2em;
}

/* ============================================
   Background
   ============================================ */

#app-background {
  height: 100%;
  left: 0;
  overflow: hidden;
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1;
}

/* #app-background-image {
  background-image: url("https://images.unsplash.com/photo-1483728642387-6c3bdd6c93e5?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=2076&q=80");
  height: 100%;
  transition: filter 250ms, transform 250ms;
  width: 100%;
} */

#app-background-image {
  background-image: url("https://wallpapercave.com/download/everest-mountain-wallpaper-wp3665967");
  height: 100%;
  transition: filter 250ms, transform 250ms;
  width: 100%;
  /* subtle blur to soften the background image */
  filter: blur(0px);
  will-change: filter;
}


/* ============================================
   App Info (Time & Weather)
   ============================================ */

#app-info {
  bottom: 100px;
  left: 0;
  margin: 40px;
  margin-left: 0;
  opacity: 0;
  position: absolute;
  transform: translateX(-100%);
  transition: margin 250ms, opacity 250ms, transform 250ms;
  z-index: 2;
}

/* Ensure the clock / app-info stays inside the viewport and doesn't overflow to the left */
#app-info {
  left: 20px; /* keep it inset from the left edge */
  right: 20px; /* prevent overflow to the right */
  max-width: calc(100% - 40px);
  overflow: hidden;
}

.info { /* limit time text so it never runs off-screen */
  overflow: hidden;
}

.info .time {
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.info {
  align-items: flex-end;
  display: flex;
}

.info .time {
  color: whitesmoke;
  font-size: 6em;
  height: 80px;
  line-height: 80px;
  text-shadow: 2px 2px 2px rgba(0, 0, 0, 0.1);
}

.info .weather {
  display: inline-flex;
  height: 20px;
  margin-bottom: 6px;
  margin-left: 20px;
}

.info .weather i,
.info .weather span {
  align-items: center;
  display: inline-flex;
}

.info .weather .weather-temperature-value {
  color: white;
  font-size: 1.5em;
  height: 20px;
}

.reminder {
  display: flex;
  gap: 6px;
  margin-top: 10px;
}

.reminder i {
  color: whitesmoke;
  font-size: 0.8em;
  height: 12px;
  line-height: 12px;
}

.reminder span {
  display: block;
  overflow: hidden;
  width: 100%;
  align-items: center;
  position: relative;
  height: 200px; /* increased height for ~600x200 display */
  background: linear-gradient(90deg, rgba(0,0,0,0.02), rgba(255,255,255,0.02));
  --duration: 20s;
  --shift: -1000px; /* fallback; will be updated by JS to exact px */
  animation: scroll-left var(--duration) linear infinite;
}

.promo-banner-list {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 0 12px;
}

.promo-banner-item {
  flex: 0 0 auto;
  width: 600px; /* target display width */
  height: 200px; /* target display height */
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.promo-banner-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

@keyframes scroll-left {
  from { transform: translateX(0); }
  to { transform: translateX(var(--shift)); }
}


#sign-in-button-wrapper #sign-in-button:not(:hover) {
  animation: bounce 3s infinite;
  animation-delay: 3s;
}

/* ============================================
   PIN Input
   ============================================ */

#app-pin-wrapper {
  left: 50%;
  opacity: 0;
  pointer-events: none;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -30%) scale(0.8);
  transition: opacity 250ms, transform 250ms;
  z-index: 2;
}

#app-pin-label {
  color: whitesmoke;
  font-size: 0.9em;
  margin: 10px;
  text-align: center;
  text-shadow: 2px 2px 2px rgba(0, 0, 0, 0.1);
}

#app-pin-cancel-text {
  cursor: pointer;
  margin-left: 2px;
}

#app-pin-cancel-text:hover {
  text-decoration: underline;
}

#app-pin-hidden-input {
  background-color: transparent;
  border: none;
  height: 0;
  outline: none;
  pointer-events: none;
  position: absolute;
  width: 0;
}

#app-pin {
  display: flex;
  gap: 10px;
}

.app-pin-digit {
  align-items: center;
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.06);
  display: inline-flex;
  font-size: 3em;
  height: 80px;
  justify-content: center;
  position: relative;
  transition: background-color 250ms, border-color 250ms;
  width: 60px;
}

.app-pin-digit:after,
.app-pin-digit:before {
  box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.06);
  content: "";
  position: absolute;
  transition: opacity 250ms, transform 250ms;
  z-index: 2;
}

.app-pin-digit:before {
  background-color: whitesmoke;
  border-radius: 10px;
  bottom: 0;
  height: 3px;
  left: 15%;
  opacity: 0;
  transform: translateY(0);
  width: 70%;
}

.app-pin-digit:after {
  background-color: whitesmoke;
  border-radius: 20px;
  height: 20px;
  opacity: 0;
  transform: scale(0.25);
  width: 20px;
}

.app-pin-digit.focused:before {
  animation: blink 2s ease-in-out infinite;
  opacity: 1;
  transform: translateY(-10px);
}

.app-pin-digit.hidden:after {
  opacity: 1;
  transform: scale(1);
}

.app-pin-digit.hidden .app-pin-digit-value {
  opacity: 0;
  transform: scale(0.25);
}

.app-pin-digit-value {
  color: whitesmoke;
  transition: opacity 250ms, transform 250ms;
}

/* ============================================
   Menu Section
   ============================================ */

#app-menu {
  height: 100vh;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  position: relative;
  transform: translateY(-10%);
  transition: opacity 250ms, transform 250ms;
  z-index: 2;
}

#app-menu-content-wrapper {
  background: linear-gradient(to bottom, transparent, #1e1e1e);
  margin-top: 30vh;
  min-height: 100vh;
  padding: 80px;
  padding-top: 0;
}

#app-menu-content {
  margin: auto;
  max-width: 1600px;
  position: relative;
}

#app-menu-content-header {
  display: flex;
  justify-content: space-between;
}

.menu-section {
  margin-top: 60px;
}

.menu-section-title {
  align-items: center;
  display: flex;
  gap: 6px;
}

.menu-section-title i,
.menu-section-title span {
  color: whitesmoke;
}

.menu-section-title i {
  font-size: 1em;
}

.menu-section-title-text {
  color: rgba(255, 255, 255, 0.8);
  font-size: 1.25em;
}

.menu-section-content {
  margin-top: 15px;
  padding-top: 5px;
}

/* ============================================
   Student Cards
   ============================================ */

#weather-section .menu-section-content {
  display: flex;
  gap: 1em;
  padding: 5px 0;
  width: 100%;
}

.day-card {
  backdrop-filter: blur(3px);
  background-color: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.25);
  cursor: pointer;
  height: 8vw;
  max-height: 160px;
  min-height: 140px;
  min-width: 180px;
  position: relative;
  transition: transform 250ms;
  width: calc(100% / 7);
}

.day-card:hover {
  transform: translateY(-5px);
}

.day-card:last-of-type {
  margin-right: 5px;
}

.day-card-content {
  display: flex;
  flex-direction: column;
  height: calc(100% - 20px);
  justify-content: center;
  align-items: center;
  padding: 10px;
}

.day-card-content span {
  color: whitesmoke;
  text-align: center;
  font-size: 1.1em;
}

.empty-message {
  color: rgba(255, 255, 255, 0.6);
  text-align: center;
  padding: 40px;
  font-size: 1.2em;
}

/* ============================================
   Fullscreen Button
   ============================================ */

#fullscreen-button {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
  width: 44px; /* restore compact size */
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#fullscreen-button i {
  color: white;
  font-size: 1.5em;
}

/* Make the initial sign-in button larger and clearly visible */
#sign-in-button-wrapper {
  z-index: 1002; /* ensure above background image */
}

#sign-in-button {
  width: 88px;
  height: 88px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4em;
  background-color: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.18);
}

#sign-in-button i {
  color: white;
  font-size: 1.6em;
}

/* Make sign-out / user-status buttons easier to see and press */
.user-status-button {
  width: 56px;
  height: 56px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15em;
  border-radius: 10px;
  background-color: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
}

.user-status-button i {
  color: white;
}

/* ============================================
   Login Logo
   ============================================ */
#login-logo-container {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 1000;
  max-width: 450px;
  max-height: 150px;
}

#login-logo {
  width: 100%;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.3));
}

/* Show logo only on the initial main (logged-out) screen */
#login-logo { display: none; }
#app.logged-out #login-logo { display: block; }

/* ============================================
   Menu Logo
   ============================================ */
#menu-logo-container {
  text-align: center;
  margin-bottom: 30px;
  padding-top: 20px;
}

#menu-logo {
  max-width: 450px;
  max-height: 150px;
  width: auto;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.3));
}

/* ============================================
   Promotional Banner
   ============================================ */
#promo-banner-section {
  margin-top: 40px;
  padding-top: 20px;
}

/* outer container that holds the scrolling track */
#promo-banner-container {
  display: block;
  width: 100%;
  overflow: hidden;
}

/* the track contains two repeated lists for seamless scrolling */
.promo-banner-track {
  display: flex;
  align-items: center;
  gap: 12px;
  /* animation duration is provided as --duration by JS */
  /* --shift is set by JS (px) to match one list width */
  --shift: -1000px;
  animation: scroll-left var(--duration, 18s) linear infinite;
}

.promo-banner-list {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 0 12px;
}

.promo-banner-item {
  flex: 0 0 auto;
  width: 600px;
  height: 200px;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.promo-banner-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

@keyframes scroll-left {
  from { transform: translateX(0); }
  to { transform: translateX(var(--shift)); }
}

/* ============================================
   Responsive Design
   ============================================ */

@media (max-width: 1300px) {
  #app.logged-out #sign-in-button-wrapper {
    transform: translate(-40px, 0);
  }

  #sign-in-button-wrapper {
    bottom: 40px;
    left: auto;
    right: 0;
    transform: translate(40px, 0);
  }

  #app-menu-content-wrapper {
    padding: 30px;
  }
}

@media (max-width: 600px) {
  .info .time {
    font-size: 4em;
    height: 60px;
    line-height: 60px;
  }

  .user-status-button {
    width: 100px; /* compact */
    height: 60px;
    font-size: 1em;
  }
}
