*,
*::after,
*::before {
  box-sizing: border-box;
}

:root {
  --background-color: black;
  --top-card-color: #181818;
  --bottom-card-color: #131313;
  --text-color: #e0e0e0;
}

.dark-mode {
  --background-color: #f2f1ed;
  --top-card-color: #f3f3f3;
  --bottom-card-color: white;
  --text-color: #000000;
}

#flipSound {
  display: none;
}


body {
  background: var(--background-color);
  color: var(--text-color);
  font-family: Arial, Helvetica, sans-serif;
  width: 100vw;
  transition: all linear 0.3s;
}

* {
  font-family: "Poppins", sans-serif;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  transition: 0.5s ease;
}

.loader-wrapper {
  height: 100%;
  width: 100%;
  position: absolute;
  top: 0;
  left: 0;
  background-color: #101010;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.loader {
  width: 48px;
  height: 48px;
  display: inline-block;
  position: relative;
  transform: rotate(45deg);
}

.loader::before {
  content: "";
  box-sizing: border-box;
  width: 24px;
  height: 24px;
  position: absolute;
  left: 0;
  top: -24px;
  animation: animloader 2s ease infinite;
  pointer-events: none;
}
.loader::after {
  content: "";
  box-sizing: border-box;
  position: absolute;
  left: 0;
  top: 0;
  width: 24px;
  height: 24px;
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.15);
  animation: animloader2 1s ease infinite;
}

@keyframes animloader {
  0% {
    box-shadow: 0 24px rgba(255, 255, 255, 0), 24px 24px rgba(255, 255, 255, 0),
      24px 48px rgba(255, 255, 255, 0), 0px 48px rgba(255, 255, 255, 0);
  }
  12% {
    box-shadow: 0 24px white, 24px 24px rgba(255, 255, 255, 0),
      24px 48px rgba(255, 255, 255, 0), 0px 48px rgba(255, 255, 255, 0);
  }
  25% {
    box-shadow: 0 24px white, 24px 24px white, 24px 48px rgba(255, 255, 255, 0),
      0px 48px rgba(255, 255, 255, 0);
  }
  37% {
    box-shadow: 0 24px white, 24px 24px white, 24px 48px white,
      0px 48px rgba(255, 255, 255, 0);
  }
  50% {
    box-shadow: 0 24px white, 24px 24px white, 24px 48px white, 0px 48px white;
  }
  62% {
    box-shadow: 0 24px rgba(255, 255, 255, 0), 24px 24px white, 24px 48px white,
      0px 48px white;
  }
  75% {
    box-shadow: 0 24px rgba(255, 255, 255, 0), 24px 24px rgba(255, 255, 255, 0),
      24px 48px white, 0px 48px white;
  }
  87% {
    box-shadow: 0 24px rgba(255, 255, 255, 0), 24px 24px rgba(255, 255, 255, 0),
      24px 48px rgba(255, 255, 255, 0), 0px 48px white;
  }
  100% {
    box-shadow: 0 24px rgba(255, 255, 255, 0), 24px 24px rgba(255, 255, 255, 0),
      24px 48px rgba(255, 255, 255, 0), 0px 48px rgba(255, 255, 255, 0);
  }
}

@keyframes animloader2 {
  0% {
    transform: translate(0, 0) rotateX(0) rotateY(0);
  }
  25% {
    transform: translate(100%, 0) rotateX(0) rotateY(180deg);
  }
  50% {
    transform: translate(100%, 100%) rotateX(-180deg) rotateY(180deg);
  }
  75% {
    transform: translate(0, 100%) rotateX(-180deg) rotateY(360deg);
  }
  100% {
    transform: translate(0, 0) rotateX(0) rotateY(360deg);
  }
}

/* NAVIGATION SIDEBAR */

#nav-btn {
  position: absolute;
  font-size: 1.3em;
  left: 20px;
  top: 10px;
  height: 40px;
  width: 40px;
  background: #4a4a4a;
  border-radius: 5px;
  cursor: pointer;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.3s ease;
  z-index: 5;
}

.wrapper {
  height: 100%;
  width: 300px;
  position: relative;
  z-index: 50;
}

.wrapper .menu-btn i {
  font-size: 23px;
  position: absolute;
  transition: 0.3s ease;
}

.wrapper .menu-btn i.fa-times {
  opacity: 0;
}

.wrapper .sidebar {
  position: fixed;
  top: 0;
  left: -270px;
  height: 100%;
  width: 270px;
  transition: all 0.3s linear;
}

.wrapper .sidebar .title {
  line-height: 65px;
  text-align: center;
  background: #333;
  color: #f2f2f2;
  font-size: 25px;
  font-weight: 600;
  border-bottom: 1px solid #222;
}

.wrapper .sidebar .list-items {
  position: relative;
  background: #404040;
  height: 100%;
  width: 100%;
  list-style: none;
}

.wrapper .sidebar .list-items li {
  padding-left: 40px;
  line-height: 50px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom: 1px solid #333;
  transition: all 0.3s ease;
}

.wrapper .sidebar .list-items li:hover {
  border-top: 1px solid transparent;
  border-bottom: 1px solid transparent;
  box-shadow: 0px 4px 2px 0px #222;
}

.wrapper .sidebar .list-items li:first-child {
  border-top: none;
}

.wrapper .sidebar .list-items li a {
  color: #f2f2f2;
  text-decoration: none;
  font-size: 18px;
  font-weight: 500;
  height: 100%;
  width: 100%;
  display: block;
}

.wrapper .sidebar .list-items li a i {
  margin-right: 20px;
}

.wrapper .sidebar .list-items .icons {
  position: absolute;
  bottom: 100px;
  width: 100%;
  height: 40px;
  text-align: center;
  line-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wrapper .sidebar .list-items .credits {
  position: absolute;
  bottom: 150px;
  width: 100%;
  font-size: 1em;
  height: 40px;
  text-align: center;
  line-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wrapper .sidebar .list-items .icons a {
  height: 100%;
  width: 40px;
  display: block;
  margin: 0 5px;
  font-size: 18px;
  color: #f2f2f2;
  background: #4a4a4a;
  border-radius: 5px;
  border: 1px solid #383838;
  transition: all 0.3s ease;
}

.wrapper .sidebar .list-items .icons a:hover {
  background: #404040;
}

.wrapper .sidebar .list-items .icons a:first-child {
  margin-left: 0px;
}

#lightMode-icon {
  position: fixed;
  top: 10px;
  right: 20px;
  height: 40px;
  width: 40px;
  background: #4a4a4a;
  border-radius: 5px;
  cursor: pointer;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 23px;
  z-index: 0;
}

.seconds-btn {
  position: fixed;
  top: 10px;
  right: 80px;
  height: 40px;
  width: 40px;
  background: #4a4a4a;
  border-radius: 5px;
  cursor: pointer;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 23px;
  z-index: 0;
}

.ampm-btn {
  position: fixed;
  top: 70px;
  right: 20px;
  height: 40px;
  width: 40px;
  background: #4a4a4a;
  border-radius: 5px;
  cursor: pointer;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 23px;
  z-index: 0;
}

/* FLIP CLOCK */

.container {
  display: flex;
  flex-direction: column;
  gap: 2em;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  height: auto;
  padding: 3rem 0;
  width: auto;
  user-select: none;
}

.clock {
  display: flex;
  gap: 1em;
  justify-content: center;
  align-items: center;
  height: auto;
  width: auto;
  --card-scale: 1.0;
}

.container-segment {
  display: flex;
}

.headings {
  text-align: center;
}

.flip-card {
  margin-left: 0.015em;
  margin-right: 0.015em;
  margin-top: 0.02em;
  font-size: calc(18em * var(--card-scale));
  font-family: 'Oswald', 'Arial Narrow', sans-serif !important;
  font-weight: 700;
  width: 0.95em;
  height: 1.5em;
  position: relative;
  display: inline-flex;
  flex-direction: column;
  box-shadow: 
    0 10px 20px rgba(0, 0, 0, 0.45), 
    inset 0 1px 3px rgba(255, 255, 255, 0.12),
    inset 0 -1px 3px rgba(0, 0, 0, 0.4);
  border-radius: 0.06em;
}

.container .p {
  font-size: 1em;
}

.last {
  flex-direction: column;
  align-items: center;
  height: 85%;
}

.seconds-segment .flip-card {
  font-size: calc(6.5em * var(--card-scale));
}

.seconds-segment {
  position: relative;
  vertical-align: bottom;
  align-self: flex-end;
}

.ampm {
  font-weight: 500;
  font-size: 0.21em;
  margin-bottom: auto;
}

.card-ampm {
  width: 1.5em !important;
}

.top,
.bottom,
.flip-card .top-flip,
.flip-card .bottom-flip {
  height: 0.75em;
  line-height: 1;
  overflow: hidden;
  padding-top: 0.25em;
  padding-bottom: 0.25em;
  padding-left: 0.11em;
  padding-right: 0.11em;
  display: flex;
  justify-content: center;
  width: 100%;
}

.top,
.flip-card .top-flip {
  background: var(--top-card-color);
  border-top-right-radius: 0.06em;
  border-top-left-radius: 0.06em;
  border-bottom: 0.022em solid rgba(0, 0, 0, 0.55);
  align-items: flex-start;
}

.bottom,
.flip-card .bottom-flip {
  background: var(--bottom-card-color);
  border-bottom-right-radius: 0.1em;
  border-bottom-left-radius: 0.1em;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.flip-card .top-flip {
  position: absolute;
  width: 100%;
  animation: flip-top 250ms ease-in;
  transform-origin: bottom;
}

@keyframes flip-top {
  100% {
    transform: rotateX(90deg);
  }
}

.flip-card .bottom-flip {
  position: absolute;
  bottom: 0;
  width: 100%;
  animation: flip-bottom 250ms ease-out 250ms;
  transform-origin: top;
  transform: rotateX(90deg);
}

@keyframes flip-bottom {
  100% {
    transform: rotateX(0deg);
  }
}

#date {
  display: flex;
  justify-content: center;
  padding-top: 1rem;
  width: 100%;
  font-weight: 500;
  font-size: 1.5em;
}

.colon{
  font-size: calc(13rem * var(--card-scale));
}

/* breakpoints for reposiveness */
@media (max-width: 1200px) {
  html {
    font-size: 75%;
  }
  p {
    font-size: 1.5em;
  }
}

@media (max-width: 1024px) {
}

@media (max-width: 991px) {
  html {
    font-size: 65%;
  }
  p {
    font-size: 1.5em;
  }
}

@media (max-width: 870px) {
  html {
    font-size: 55%;
  }
  p {
    font-size: 1.75em;
  }
}

@media (max-width: 700px) {
  html {
    font-size: 50%;
  }
  .credits{
    font-size: 4em;
  }
}

@media (max-width: 656px) {
  html {
    font-size: 55%;
  }
  .clock {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2rem;
  }
  .last {
    flex-direction: row-reverse;
    gap: 6rem;
  }
  .colon{
    display:none;
  }
  p {
    font-size: 1.75em;
  }
}

@media (max-width: 275px) {
  html {
    font-size: 50%;
  }
  p {
    font-size: 1.75em;
  }
}

/* Pomodoro  */

/* ==========================================
   SETTINGS & COUNTDOWN TIMER STYLES
   ========================================== */

/* Settings Container in Sidebar */
.settings-container {
  padding: 15px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom: 1px solid #333;
}

.settings-title {
  font-size: 1.1em;
  font-weight: 600;
  color: #f2f2f2;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.settings-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.setting-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.setting-item label {
  font-size: 0.85em;
  color: #ccc;
  font-weight: 500;
  text-align: left;
}

.setting-item input[type="text"],
.setting-item input[type="datetime-local"],
.setting-item select {
  background: #2a2a2a;
  border: 1px solid #444;
  color: #fff;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 0.9em;
  outline: none;
  width: 100%;
  font-family: 'Poppins', sans-serif;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.setting-item input[type="text"]:focus,
.setting-item input[type="datetime-local"]:focus,
.setting-item select:focus {
  border-color: #f2f2f2;
  box-shadow: 0 0 4px rgba(255, 255, 255, 0.2);
}

/* Adapt Settings for Light Mode */
.dark-mode .settings-container {
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  border-bottom: 1px solid #e0e0e0;
}

.dark-mode .settings-title {
  color: #444;
}

.dark-mode .setting-item label {
  color: #666;
}

.dark-mode .setting-item input[type="text"],
.dark-mode .setting-item input[type="datetime-local"],
.dark-mode .setting-item select {
  background: #fff;
  border: 1px solid #ccc;
  color: #333;
}

.dark-mode .setting-item input[type="text"]:focus,
.dark-mode .setting-item input[type="datetime-local"]:focus,
.dark-mode .setting-item select:focus {
  border-color: #333;
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.15);
}

/* Countdown Mode Styles */
.clock.countdown-mode {
  flex-wrap: wrap;
  gap: 0.5em 0.8em;
  justify-content: center;
}

.clock.countdown-mode .flip-card {
  font-size: calc(7.5em * var(--card-scale)); /* Scale cards down so they fit horizontally */
}

/* Force all flip cards to be uniform size in countdown mode */
.clock.countdown-mode .seconds-segment .flip-card {
  font-size: calc(7.5em * var(--card-scale)); 
}

.clock.countdown-mode .container-segment {
  display: flex;
}

.clock.countdown-mode .last {
  flex-direction: row;
  height: auto;
  align-items: center;
}

.clock.countdown-mode .ampm {
  display: none !important;
}

.clock.countdown-mode .colon {
  font-size: calc(5.5rem * var(--card-scale));
  align-self: center;
  margin-top: 0.2em;
}

.segment-label {
  display: block; /* Always display labels to match the physical clock in the picture */
  font-family: 'Oswald', sans-serif !important;
  font-size: 1.45rem !important;
  font-weight: 700 !important;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #fff;
  opacity: 0.85;
  margin-bottom: 0.7em;
  text-align: center;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.dark-mode .segment-label {
  color: #222 !important;
  opacity: 0.9;
  text-shadow: none;
}

/* Custom Text Display Below the Clock */
#custom-text-container {
  width: 100%;
  text-align: center;
  margin-top: 1.5rem;
  padding: 0 1rem;
  transition: opacity 0.5s ease, transform 0.5s ease;
}

#custom-text-display {
  font-size: 2.2rem;
  font-weight: 600;
  color: var(--text-color);
  letter-spacing: 0.05em;
  margin: 0;
  transition: font-family 0.3s ease;
}

/* Font Families */
.font-poppins {
  font-family: 'Poppins', sans-serif !important;
}

.font-playfair {
  font-family: 'Playfair Display', serif !important;
  font-style: italic;
}

.font-montserrat {
  font-family: 'Montserrat', sans-serif !important;
}

.font-dancing {
  font-family: 'Dancing Script', cursive !important;
  font-size: 3.5rem !important; /* Scale up for hand-written fonts */
}

.font-outfit {
  font-family: 'Outfit', sans-serif !important;
}

.font-cinzel {
  font-family: 'Cinzel', serif !important;
  letter-spacing: 0.15em !important;
}

.font-orbitron {
  font-family: 'Orbitron', sans-serif !important;
  letter-spacing: 0.1em !important;
}

/* Responsive adjustments for countdown */
@media (max-width: 656px) {
  .clock.countdown-mode {
    flex-direction: column;
    gap: 1.5rem;
  }
  .clock.countdown-mode .colon {
    display: none;
  }
  .clock.countdown-mode .last {
    flex-direction: row;
    gap: 0;
  }
}

/* Clock size classes */
.clock.clock-size-small {
  --card-scale: 0.75;
}
.clock.clock-size-normal {
  --card-scale: 1.0;
}
.clock.clock-size-large {
  --card-scale: 1.35;
}
.clock.clock-size-xlarge {
  --card-scale: 1.7;
}

/* Real Wall Clock 3D Bezel Frame */
.wall-frame {
  background: #202225; /* Dark frame bezel */
  border: 16px solid #141517; /* Bezel edge border */
  border-radius: 20px;
  padding: 8px;
  box-shadow: 
    0 30px 60px rgba(0, 0, 0, 0.75), 
    0 15px 25px rgba(0, 0, 0, 0.5),
    inset 0 2px 3px rgba(255, 255, 255, 0.1),
    inset 0 -2px 3px rgba(0, 0, 0, 0.4);
  display: flex;
  justify-content: center;
  align-items: center;
  width: auto;
  max-width: 95%;
  margin: 2rem auto;
  transition: all 0.3s ease;
}

.inner-plate {
  background: #18191b; /* Deep matte black background inside frame */
  border-radius: 10px;
  padding: 40px 50px;
  box-shadow: 
    inset 0 15px 30px rgba(0, 0, 0, 0.9), 
    inset 0 2px 8px rgba(0, 0, 0, 0.7),
    inset 0 -5px 15px rgba(255, 255, 255, 0.02);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
}

/* Adapt Frame to Light Mode */
.dark-mode .wall-frame {
  background: #ece9df;
  border-color: #d0cbc0;
  box-shadow: 
    0 25px 45px rgba(0, 0, 0, 0.12), 
    0 10px 15px rgba(0, 0, 0, 0.08),
    inset 0 1px 2px rgba(255, 255, 255, 0.6),
    inset 0 -1px 2px rgba(0, 0, 0, 0.15);
}

.dark-mode .inner-plate {
  background: #f7f6f2;
  box-shadow: 
    inset 0 10px 20px rgba(0, 0, 0, 0.06), 
    inset 0 2px 5px rgba(0, 0, 0, 0.04);
}

