/* ---------------------------------------------------------
   Base layout integration
--------------------------------------------------------- */
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.clock-page {
  position: relative;
  flex-grow: 1;
    display: flex;
    justify-content: center;
    min-height: 300px;
    background: #111;
    align-items: stretch;
}

.clock-page main {
  flex-grow: 1;
  flex-direction: column;
  display: flex;
  align-items: stretch;
  min-height: 300px;
  background: url(/assets/universal.jpg);
  background-color: #111;
  background-size: cover;
  background-position: center;
}

/* ---------------------------------------------------------
   Configuration toggle button
--------------------------------------------------------- */

.configuration-btn {
  position: absolute;
  top: 5px;
  left: 5px;
  z-index: 2000;

  background: rgba(0,0,0,0.55);
  color: white;
  border: none;
  padding: 6px 10px;
  border-radius: 6px;

  font-size: 18px;
  cursor: pointer;
}

.configuration-btn:hover {
  background: rgba(0,0,0,0.75);
}

/* ---------------------------------------------------------
   Fullscreen toggle button
--------------------------------------------------------- */

.fullscreen-btn {
  position: absolute;
  top: 5px;
  right: 5px;
  z-index: 2000;

  background: rgba(0,0,0,0.55);
  color: white;
  border: none;
  padding: 6px 10px;
  border-radius: 6px;

  font-size: 18px;
  cursor: pointer;
}

.fullscreen-btn:hover {
  background: rgba(0,0,0,0.75);
}

/* ---------------------------------------------------------
   Control panel and tips panel
--------------------------------------------------------- */

.section-header {
  position: relative;
  background: rgba(0,0,0,0.2);
}

.control-panel {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  padding: 0.5rem 1rem;
}

.control-panel label {
  color: white;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
}

.control-panel select {
  width: 100%;
  padding: 0.6rem;
  background: #111;
  color: white;
}

.tips-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: white;
}

#tipsPanel {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 4rem;
  text-align: center;
  padding: 0.5rem 1rem;
}

#tipText {
  position: relative;
  animation: tipFloat 5s cubic-bezier(0.37, 0, 0.63, 1) infinite;
  flex-grow: 1;
  min-height: 4rem;
}

.tip {
  position: absolute;
  inset: 0; /* position relative to parent */
  opacity: 0;
  pointer-events: none; /* allow clicks to pass through */
  transition: opacity 0.8s ease;
}

.tip.active {
  opacity: 1; /* make active tip visible */
}

.tip-focus {
  opacity: 0;
  transition: opacity 0.8s ease;
  font-weight: bold;
  font-size: 1.2rem;
  color: white;
}

.tip-focus.tip-visible {
  opacity: 1;
}

.tip-explanation {
  opacity: 0;
  transition: opacity 0.8s ease;
  font-size: 1rem;
  color: lightgray;
}

.tip-explanation.tip-visible {
  opacity: 1;
}

@keyframes tipFloat {
  0% {
    transform: translateY(3px);
  }
  50% {
    transform: translateY(-3px); /* Smooth peak */
  }
  100% {
    transform: translateY(3px);  /* Smooth trough/return */
  }
}

@media (max-width: 480px) {
  .tip-focus {
    font-size: 1rem;
  }

  .tip-explanation {
    font-size: 0.8rem;
  }
}

/* ---------------------------------------------------------
   Clock container (static layout)
--------------------------------------------------------- */

#umi-clock {
  position: relative;
  transform-origin: top left;
  pointer-events: none; /* clock is not interactive */
}

/* ---------------------------------------------------------
   Fullscreen mode
--------------------------------------------------------- */

.clock-fullscreen header,
.clock-fullscreen footer {
  display: none;
}

.clock-fullscreen .umi-region-full {
  width: 100vw;
  height: 100vh;
  padding: 0;
}

.clock-fullscreen #clockWrapper {
  width: 100vw;
  height: 100vh;
}

/* ---------------------------------------------------------
   Bouncing movement wrapper
--------------------------------------------------------- */

#clockWrapper {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden; /* clock stays inside region */
  pointer-events: none;
  touch-action: none;
}

#clockWrapper #umi-clock {
  position: absolute; /* required for bouncing movement */
  left: 0;
  top: 0;
  transform: translate(0px, 0px);
}

/* Clock hidden at startup */
.clock-hidden {
  opacity: 0;
}

/* Fade-in animation */
.clock-fade-in {
  opacity: 1;
  transition: opacity 0.5s ease-in;
}
