:root {
  --background-color: #050816;
  --background-light: #10163a;

  --btn-start: #b0afed;
  --btn-start-end: #655dcd;

  --btn-stop: #dccb35;
  --btn-stop-end: #a7991d;

  --btn-chart: #88f282;
  --btn-chart-end: #2ba71d;

  --btn-settings: #f1e027;
  --btn-settings-end: #b1b40f;
}

html,
body {
  height: 100%;
  width: 100%;
  padding: 0;
  margin: 0;
  background: radial-gradient(
    circle at top,
    var(--background-light),
    var(--background-color) 60%
  );
  color: #fff;
  user-select: none; /* Standard */
  box-sizing: border-box;
}

.container {
  display: flex;
  justify-content: center;
  flex-direction: column;
  align-items: center;
  margin: 1% auto;
  width: 100%;
  max-width: 500px;
  padding: 5px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

h1 {
  margin: 0;
  padding: 0px;
}

.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
  background-color: var(--background-color);
}

/* ==============================timer===============================*/

.timer {
  text-align: center;
}

#time-display {
  font-size: clamp(48px, 15vw, 60px);
  font-weight: 700;
  letter-spacing: 4px;
  font-family: "Inter", sans-serif;

  background: linear-gradient(180deg, #ffffff, #9effa1);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;

  transform: scaleY(1.25);
  transition: all 0.3s ease;

  text-shadow: 0 0 10px rgba(46, 204, 113, 0.3);
}
@keyframes pulseGlow {
  0% {
    text-shadow: 0 0 10px rgba(46, 204, 113, 0.3);
    transform: scaleY(1.25) scale(1);
  }
  50% {
    text-shadow: 0 0 25px rgba(46, 204, 113, 0.9);
    transform: scaleY(1.25) scale(1.02);
  }
  100% {
    text-shadow: 0 0 10px rgba(46, 204, 113, 0.3);
    transform: scaleY(1.25) scale(1);
  }
}

.timer.running #time-display {
  animation: pulseGlow 1s infinite;
}

.timer.paused #time-display {
  opacity: 0.7;
}

/* ==============================input===============================*/

.session-form {
  width: 100%;
  margin-bottom: 5px;
}

.input-wrapper {
  width: 100%;
  display: flex;
  justify-content: center;
  gap: 10px;
}

#category-select {
  min-width: 150px;
  padding: 0 10px;
  border-radius: 12px;
  border: none;
  outline: none;
  font-size: 1.5rem;
  font-family: "Inter", sans-serif;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  cursor: pointer;
}

#category-select option {
  color: black;
}

#category-select::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

#category-select:focus {
  background: rgba(255, 255, 255, 0.15);

  box-shadow:
    0 0 0 2px rgba(46, 204, 113, 0.6),
    0 6px 20px rgba(0, 0, 0, 0.4);
}

#category-select:hover {
  background: rgba(255, 255, 255, 0.12);
}

/* ==============================controls===============================*/

.controls {
  display: flex;
  gap: 10px;
  justify-content: center;
  align-items: center;
}
@media (max-width: 480px) {
  .controls {
    gap: 12px;
  }

  .input-wrapper {
    padding: 0 10px;
  }

  .session-item {
    width: 100%;
    padding: 10px;
  }
}

.btn {
  width: clamp(50px, 15vw, 60px);
  height: clamp(50px, 15vw, 60px);
  font-size: clamp(18px, 5vw, 32px);
  border-radius: 50%;
  border: none;
  cursor: pointer;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;

  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
  transition: all 0.2s ease;
}

.btn:hover {
  transform: scale(1.1);
}

.btn:active {
  transform: scale(0.95);
}

.start {
  background: radial-gradient(
    circle at 30% 30%,
    var(--btn-start),
    var(--btn-start-end)
  );
  box-shadow:
    0 10px 25px rgba(0, 0, 0, 0.4),
    inset 0 0 10px rgba(255, 255, 255, 0.3);
  opacity: 0.9;
  position: fixed;
  bottom: 50px;
  left: auto;
  z-index: 100;
}

.stop {
  background: linear-gradient(145deg, var(--btn-stop), var(--btn-stop-end));
  opacity: 0.9;
  position: fixed;
  bottom: 50px;
  left: auto;
  z-index: 100;
}

.chart {
  background: linear-gradient(145deg, var(--btn-chart), var(--btn-chart-end));
  width: clamp(40px, 15vw, 50px);
  height: clamp(40px, 15vw, 50px);
  font-size: clamp(18px, 5vw, 24px);
}

.settings {
  background: linear-gradient(
    145deg,
    var(--btn-settings),
    var(--btn-settings-end)
  );
  width: clamp(40px, 15vw, 50px);
  height: clamp(40px, 15vw, 50px);
  font-size: clamp(18px, 5vw, 24px);
}

.start.active {
  box-shadow:
    0 0 25px #2ecc71,
    0 0 60px rgba(46, 204, 113, 0.6);
}

/* ==============================items===============================*/

.sessions {
  width: 90%;
}

#session-container {
  display: flex;
  flex-direction: column;
  max-width: 100%;
  gap: 5px;
  margin-top: 115px;
}

.session-item {
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  width: 100%;
  padding: 0 12px;
  margin: 5px;
  border-radius: 12px;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 2px;
  transition: transform 0.2s ease;
}

.session-item__top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.session-item__category {
  font-weight: bold;
  font-size: clamp(16px, 5vw, 20px);
  color: #fff;
}

.session-item__info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 2px;
  font-size: 0.6rem;
  opacity: 0.7;
  min-width: 0;
}

.session-item__duration {
  font-size: clamp(18px, 5vw, 24px);
  font-weight: bold;
}

.session-item:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}

/* ==============================modal===============================*/
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 200;
}

.hidden {
  display: none;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}

.modal-content {
  background: linear-gradient(145deg, #615f5f, #1c1c1c);
  color: white;

  padding: 14px 1%;
  border-radius: 16px;

  width: 90%;
  max-width: 300px;

  text-align: center;

  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);

  transform: scale(1);
  transition: transform 0.25s ease;
}

.hidden .modal-content {
  transform: scale(0.9);
}

.modal-content p {
  margin: 0px;
  font-size: 18px;
  font-weight: 500;
}

.modal-content button {
  padding: 10px 16px;
  border: none;
  border-radius: 10px;

  font-size: 14px;
  cursor: pointer;

  margin: 5px;
  min-width: 80px;

  transition: all 0.2s ease;
}

/* ==============================chart===============================*/
.chart-modal-content {
  width: 95%;
  height: 50vh;
  max-width: 500px;

  background: rgba(20, 20, 20, 0.6);
  backdrop-filter: blur(20px);

  border-radius: 20px;
  padding: 15px;

  border: 1px solid rgba(255, 255, 255, 0.1);
}

#chart {
  height: 100% !important;
}

/* ==============================menu===============================*/
.settings-wrapper {
  position: relative;
}

.settings-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 2px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  backdrop-filter: blur(12px);
  background: rgba(20, 20, 20, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 10px 5px;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  z-index: 150;
  opacity: 1;
  transform: translateY(0);
  transition: all 0.2s ease;
}

.settings-menu button {
  min-width: 80px;
  background: none;
  border: none;
  color: white;
  padding: 5px 10px;
  text-align: left;
  cursor: pointer;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
}

.settings-menu.hidden {
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none;
}

.settings-menu button:hover {
  background: rgba(230, 221, 221, 0.4);
  color: white;
}

.modal {
  opacity: 1;
  transition: opacity 0.2s ease;
}

.modal.hidden {
  opacity: 0;
  pointer-events: none;
}

/* ==============================toast===============================*/
.undo-toast {
  position: fixed;
  bottom: 120px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);

  width: calc(100% - 40px);
  max-width: 400px;

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;

  background: rgba(78, 76, 76, 0.95);
  color: #fff;

  padding: 10px 16px;
  border-radius: 12px;

  font-size: 14px;
  font-weight: 500;

  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);

  opacity: 0;
  pointer-events: none;

  transition:
    transform 0.2s ease,
    opacity 0.2s ease;
  z-index: 9999;
}

.undo-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

#undo-btn {
  position: relative;
  overflow: hidden;
  border: none;
  background: #4f46e5;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: 8px;
  transition: all 0.15s ease;
}

.undo-progress {
  position: absolute;
  inset: 0;
  background: rgba(147, 197, 253, 0.3);
  transform-origin: left;
  transform: scaleX(1);
  z-index: 0;
}

#undo-btn span {
  position: relative;
  z-index: 1;
}

/* ==============================day-group===============================*/
.day-group {
}

.day-header {
  position: sticky;
  top: 0;
  z-index: 50;

  display: flex;
  justify-content: space-between;
  align-items: center;

  padding: 6px 10px;
  font-size: 0.8rem;
  font-weight: 600;

  background: rgba(50, 65, 131, 0.95);
  backdrop-filter: blur(6px);

  border-left: 3px solid rgba(255, 255, 255, 0.2);
  cursor: pointer;
  border-radius: 12px;
}

.day-total {
  font-size: 1rem;
  opacity: 0.9;
  color: #f6ea0c;
  font-weight: 700;
}

.day-sessions {
  max-height: 1000px;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.day-sessions.collapsed {
  max-height: 0;
}
