/* =================================================
   Centralized color system
   ================================================= */
:root {
  /* Core UI colors */
  --navbar-bg-color: #333;
  --text-color: #ffffff;
  --settings-color: #dddddd;

  /* Backgrounds */
  --page-bg-color: #fdfcfb;
  --card-bg-color: #f9f9f9;
  --panel-bg-color: #ffffff;
  --popup-bg-color: #ffffff;
  --overlay-bg-color: rgba(0, 0, 0, 0.5);
  --overlay-dark-bg-color: rgba(0, 0, 0, 0.6);
  /* Card */
--card-bg-color: rgba(255, 255, 255, 0.65);
--card-border-color: var(--border-color-light);

/* Dark mode card */
--card-bg-dark: rgba(30, 30, 30, 0.55);
--card-border-dark: var(--border-color-medium);

  /* Borders */
  --border-color-light: #dddddd;
  --border-color-medium: #cccccc;

  /* Buttons */
  --button-bg-color: #eeeeee;
  --button-bg-hover-color: #dddddd;
  --button-border-color: #cccccc;
  --button-border-hover-color: #999999;
  --button-dark-bg-color: #333333;
  --button-dark-hover-bg-color: #555555;
  --button-confirm-bg-color: #444444;
  --button-confirm-hover-bg-color: #666666;

  /* Text */
  --text-dark-color: #000000;
  --text-light-color: #ffffff;

  /* Status colors */
  --dot-inactive-color: #555555;
  --success-color: #2ecc71;
  --error-color: #e53935;

  /* Shadows */
  --shadow-light: 0 2px 5px rgba(0,0,0,0.2);
  --shadow-medium: 0 4px 12px rgba(0,0,0,0.15);
}

/* =================================================
   Base
   ================================================= */
body {
  margin: 0;
  background: var(--page-bg-color);
  color: var(--text-dark-color);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  position: relative;
  isolation: isolate;
  border: none;
  padding-bottom: 40vh;
}

/* =================================================
   Dark mode theme
   ================================================= */
body[data-theme="dark"] {
  --page-bg-color: #121212;
  --text-dark-color: #ffffff;

  --navbar-bg-color: #1e1e1e;
  --text-color: #ffffff;
  --settings-color: #bbbbbb;

  --card-bg-color: #1f1f1f;
  --panel-bg-color: #1f1f1f;
  --popup-bg-color: #1f1f1f;

  --border-color-light: #333333;
  --border-color-medium: #444444;

  /* Action buttons (dark mode) */
  --button-bg-color: #9e9e9e;          /* light grey */
  --button-bg-hover-color: #d4d4d4;
  --button-border-color: #cccccc;
  --button-border-hover-color: #bbbbbb;
  --text-dark-color: #ffffff;          /* keep global text white */

  --dot-inactive-color: #777777;

  --overlay-bg-color: rgba(0,0,0,0.7);
  --overlay-dark-bg-color: rgba(0,0,0,0.8);


}

/* =================================================
   Navbar
   ================================================= */
.navbar {
  display: flex;
  align-items: center;
  height: 60px;
  background-color: var(--navbar-bg-color);
  color: var(--text-color);
  position: relative;
  max-width: 100%;
}

.nav-title {
  margin: 0 auto;
  font-size: 20px;
  font-weight: bold;
}

/* Settings button */
.settings {
  background: none;
  border: none;
  color: var(--settings-color);
  font-size: 16px;
  cursor: pointer;
}
#settingsBtn {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 10px;
}

/* =================================================
   Settings panel
   ================================================= */
.panel {
  position: absolute;
  top: 70px;
  right: 10px;
  width: 250px;
  background: var(--panel-bg-color);
  border: 1px solid var(--border-color-medium);
  padding: 10px;
  box-shadow: var(--shadow-light);

  transition: opacity 250ms ease, transform 250ms ease;
  opacity: 0;
  transform: translateY(-10px);

  visibility: hidden;
  pointer-events: none;
  z-index: 2;

}

.panel.open {
  opacity: 1;
  transform: translateY(0);
  visibility: visible;
  pointer-events: auto;
  border-radius: 10px;
  max-width: 85%;
}

.hidden {
  display: none !important;
}

/* =================================================
   Overlay + popup
   ================================================= */
.overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay-bg-color);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.popup-card {
  background: var(--popup-bg-color);
  border: 1px solid var(--border-color-light);
  border-radius: 8px;
  width: 320px;
  max-width: 90%;
  padding: 20px;
  box-shadow: var(--shadow-medium);
  text-align: left;
  position: relative;
}

.popup-card h2 {
  margin-top: 0;
  margin-bottom: 12px;
  font-size: 1.5rem;
}

.popup-card button.close-btn {
  background: none;
  border: none;
  font-size: 1.2rem;
  position: absolute;
  top: 10px;
  right: 15px;
  cursor: pointer;
}

/* Popup text */
.popup-title {
  margin: 0;
  text-align: center;
  font-size: 1.8rem;
}

.popup-text {
  margin: 12px 0 24px;
  text-align: center;
  line-height: 1.4;
}

/* =================================================
   Dots
   ================================================= */
.dot-row {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.dot {
  width: 20px;
  height: 20px;
  background: var(--dot-inactive-color);
  border-radius: 50%;
  transition: background 0.2s;
}

.dot.filled {
  background: var(--success-color);
}

/* =================================================
   Main card
   ================================================= */
.card {
  max-width: 90%;
  margin: 80px auto 40px;
  padding: 20px;
  background: var(--card-bg-color);
  border: 1px solid var(--card-border-color);
  border-radius: 12px;
  text-align: center;
  z-index: 1;

  /* Frosted glass blur */
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);

  /* subtle shadow for depth */
  box-shadow: var(--shadow-light);
}

body[data-theme="dark"] .card {
  background: rgba(30, 30, 30, 0.55); /* darker + transparent */
  border-color: var(--border-color-medium);
}


/* =================================================
   Goal display
   ================================================= */
.goal-display .goal-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  margin: 0 2px;
  background: var(--dot-inactive-color);
  border-radius: 50%;
}

.goal-display .goal-label {
  font-size: 1.4rem; /* bigger text */
  font-weight: 600;  /* optional */
  margin-right: 0.4rem;
}

.goal-display {
  border: 2px solid rgb(66, 66, 66); /* border around the whole div */
  padding: 0.5rem 0.8rem;                /* space inside the border */
  border-radius: 8px;                    /* rounded corners (optional) */
  display: inline-flex;                  /* keeps it tight to content */
  align-items: center;
  margin-top: 15px;
}

.goal-dot.filled {
  background: var(--success-color);
}

.goal-dot.violation {
  background: var(--error-color);
}

/* =================================================
   Buttons
   ================================================= */
.button-row {
  display: flex;
  flex-wrap: wrap;        /* allow wrapping */
  justify-content: center;
  gap: 12px;
  margin-top: 30px;
}

.action-btn {
  padding: 10px 18px;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 12px;
  cursor: pointer;

  /* Modern look */
  background: linear-gradient(180deg, var(--button-bg-color), var(--button-bg-hover-color));
  border: 1px solid var(--button-border-color);

  color: var(--text-dark-color);
  box-shadow: 0 8px 16px rgba(0,0,0,0.12);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.action-btn {
  padding: 0.55rem 1.2rem;
  font-size: 0.95rem;
  font-weight: 600;

  background: var(--button-bg-color);
  color: var(--text-dark-color);

  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 10px;

  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
  box-shadow: 0 6px 10px rgba(0, 0, 0, 0.12);
}

.action-btn:hover {
  transform: translateY(1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.10);
  filter: brightness(1.03);
}
.action-btn:hover {
  transform: translateY(1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.10);
  filter: brightness(1.03);
}

#totalTimeContainer {
  margin: 10px;
}

/* =================================================
   Timer overlay
   ================================================= */
#timerOverlay {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--page-bg-color);
  color: var(--text-dark-color);
  font-size: 6rem;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  flex-direction: column;
}

.timerGlow {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;

  background:
    radial-gradient(circle at 50% 40%,
      rgba(46, 204, 113, 0.20) 0%,
      rgba(46, 204, 113, 0.10) 12%,
      rgba(46, 204, 113, 0.05) 22%,
      rgba(46, 204, 113, 0.00) 45%),
    radial-gradient(circle at 60% 60%,
      rgba(46, 204, 113, 0.14) 0%,
      rgba(46, 204, 113, 0.06) 12%,
      rgba(46, 204, 113, 0.00) 40%);

  filter: blur(16px);
}


#timerValue {
  transition: color 0.25s ease;
  max-width: 90vw; /* Maximum width at 90% of the viewport */
  width: auto; /* Adapt width based on content */
  overflow-wrap: break-word; /* Allow text to wrap */
  word-break: break-word; /* Ensures long words break */
  font-size: clamp(45px, 15vw, 85px); /* Responsive font size */
}


.timer-flash-red {
  color: #e53935 !important;
}

.timer-flash-black {
  color: #000 !important;
}

#timerOverlay .exit-btn {
  margin-top: 2rem;
  padding: 0.5rem 1rem;
  font-size: 1.5rem;
  background: var(--button-dark-bg-color);
  color: var(--text-light-color);
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

#timerOverlay .exit-btn:hover {
  background: var(--button-dark-hover-bg-color);
}

/* =================================================
   Exit confirmation dialog
   ================================================= */
#exitConfirmOverlay {
  background: var(--overlay-dark-bg-color);
  color: var(--text-light-color);
  font-size: 2rem;
  align-items: center;
  justify-content: center;
  z-index: 3000;
}

#exitConfirmOverlay .confirm-card {
  background: #222; /* intentionally darker contrast */
  padding: 2rem 3rem;
  border-radius: 8px;
  text-align: center;
}

#exitConfirmOverlay .confirm-btn {
  margin: 0.5rem;
  padding: 0.55rem 1.25rem;
  font-size: 1.4rem;
  font-weight: 600;

  background: var(--button-confirm-bg-color);
  color: var(--text-light-color);

  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  cursor: pointer;

  box-shadow: 0 6px 10px rgba(0, 0, 0, 0.25);
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
}

#exitConfirmOverlay .confirm-btn:hover {
  transform: translateY(1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.20);
  filter: brightness(1.05);
}


/* =================================================
   Progress bar
   ================================================= */
#progressContainer {
  width: 80%;
  max-width: 400px;
  height: 6px;
  background: var(--border-color-light);
  border-radius: 3px;
  margin: 1rem auto;
  overflow: hidden;

/* glow */
box-shadow: 0 0 30px rgba(46, 204, 113, 0.55);

}

#progressBar {
  height: 100%;
  width: 0%;
  background: var(--success-color);
  transition: width 0.25s linear;

  filter: drop-shadow(0 0 10px rgba(46, 204, 113, 0.85));
}




.goal-dot.filled {
  background: var(--success-color);   /* same green used for popup dots */
}

.goal-dot.violation {
  background: var(--error-color);     /* red */
}

/* =================================================
   Settings panel toggles
   ================================================= */
.setting-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  font-size: 0.95rem;
  color: var(--text-dark-color);
}

/* Label text */
.setting-label {
  flex: 1;
}

/* Switch container */
.switch {
  position: relative;
  width: 42px;
  height: 22px;
  flex-shrink: 0;
}

/* Hide default checkbox */
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

/* Slider track */
.slider {
  position: absolute;
  inset: 0;
  background: var(--border-color-medium);
  border-radius: 22px;
  cursor: pointer;
  transition: background 0.2s;
}

/* Slider knob */
.slider::before {
  content: "";
  position: absolute;
  height: 18px;
  width: 18px;
  left: 2px;
  top: 2px;
  background: var(--popup-bg-color);
  border-radius: 50%;
  transition: transform 0.2s;
}

/* Checked state */
.switch input:checked + .slider {
  background: var(--success-color);
}

.switch input:checked + .slider::before {
  transform: translateX(20px);
}

/* Focus state (keyboard accessibility) */
.switch input:focus + .slider {
  box-shadow: 0 0 0 2px rgba(46, 204, 113, 0.4);
}

#totalTimeContainer {
  margin-top: 25px;
  color: var(--text-dark-color);
  font-family: monospace;
  font-size: 15px;
  border-radius: 10px;
  pointer-events: none;
}

/* Dark mode styling */
body[data-theme="dark"] #totalTimeContainer {
  color: var(--text-light-color);
}


/* Flashing timer text */
.timer-flash-red {
  color: #e53935 !important; /* red */
}

.timer-flash-black {
  color: #000 !important;    /* black */
}

.footer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--text-color);
  background: var(--navbar-bg-color);
  z-index: 999;
}

/* -------------------------------------------------
   Plant growth container
   ------------------------------------------------- */
#growthStage {
  position: fixed;
  z-index: -1;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);

  width: 100%;
  height: 100%;
  max-height: 80vh;

  background-repeat: no-repeat;
  background-position: center bottom;
  background-size: contain;

  pointer-events: none;
}

/* -------------------------------------------------
   Growth stages (0–5)
   ------------------------------------------------- */
body[data-bg="0"] #growthStage {
  background-image: url("background/0.png");
}

body[data-bg="1"] #growthStage {
  background-image: url("background/1.png");
}

body[data-bg="2"] #growthStage {
  background-image: url("background/2.png");
}

body[data-bg="3"] #growthStage {
  background-image: url("background/3.png");
}

body[data-bg="4"] #growthStage {
  background-image: url("background/4.png");
}

body[data-bg="5"] #growthStage {
  background-image: url("background/5.png");
}

body[data-theme="dark"] #growthStage {
  filter: brightness(0.45) contrast(0.9);
}

#ambientLight {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -2;

  background:
    radial-gradient(circle at 50% 40%,
      rgba(255, 165, 0, 0.15) 0%,    /* Orange, less intense */
      rgba(255, 165, 0, 0.08) 12%,
      rgba(255, 165, 0, 0.03) 22%,
      rgba(255, 165, 0, 0.00) 45%),
    radial-gradient(circle at 60% 60%,
      rgba(255, 165, 0, 0.10) 0%,
      rgba(255, 165, 0, 0.05) 12%,
      rgba(255, 165, 0, 0.00) 40%);

  filter: blur(20px);
}

@keyframes glowPulse {
  0%, 100% { opacity: 0.8; }
  50%      { opacity: 1; }
}

body[data-theme="dark"] #ambientLight {
  background:
    radial-gradient(
      circle at center,
      rgba(255, 165, 0, 0.08) 0%,
      rgba(255, 165, 0, 0.04) 30%,
      rgba(255, 165, 0, 0.02) 50%,
      rgba(255, 165, 0, 0.00) 70%
    );
}   

.reset-btn {
  padding: 0.45rem 0.9rem;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 10px;

  background: transparent;
  color: var(--text-dark-color);
  border: 1px solid rgba(0,0,0,0.2);

  cursor: pointer;
  transition: transform 0.12s ease, filter 0.12s ease;
}

.reset-btn:hover {
  transform: translateY(1px);
  filter: brightness(1.05);
}

.card-title {
  margin: 0;
}

.how-title {
  cursor: pointer;
  user-select: none;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0;
  margin-bottom: 5px;
  font-weight: 400;
  font-size: 15px;
}

.how-title .arrow {
  transition: transform 0.3s ease;
}

.how-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease;
  text-align: left;
  font-size: 0.9rem; /* smaller text */
  line-height: 1rem; /* keeps it readable */
}

.how-content.open {
  max-height: 1000px; /* large enough for content */
}

.how-title .arrow {
  transition: transform 0.3s ease;
}

.how-title.open .arrow {
  transform: rotate(-180deg);
}

.icon-tabler-clock-hour-8 {
margin-top: 15px;
}