.timer-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 32px;
  text-align: center;
  background: rgba(99, 102, 241, 0.9);
  padding: 0;
  margin: 0;
  overflow: hidden;
  z-index: 10;
  backdrop-filter: blur(1px);
}

html,
body {
  color-scheme: dark;
}

/* Animation Containers */
#leaves {
  position: fixed;
  top: -50px;
  left: 0;
  width: 100%;
  height: 100vh;
  text-align: right;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

#leaves i {
  display: inline-block;
  width: 200px;
  height: 150px;
  background: linear-gradient(to bottom right, #309900, #005600);
  transform: skew(20deg);
  border-radius: 5% 40% 70%;
  box-shadow: inset 0px 0px 1px #222;
  border: 1px solid #333;
  z-index: 1;
  animation: falling 5s 0s infinite;
}

#leaves i:nth-of-type(2n) {
  animation: falling2 5s 0s infinite;
}
#leaves i:nth-of-type(3n) {
  animation: falling3 5s 0s infinite;
}

#leaves i:before {
  position: absolute;
  content: "";
  top: 117px;
  right: 9px;
  height: 27px;
  width: 32px;
  transform: rotate(49deg);
  border-radius: 0% 15% 15% 0%;
  border-top: 1px solid #222;
  border-bottom: 1px solid #222;
  border-left: 0px solid #222;
  border-right: 1px solid #222;
  background: linear-gradient(to right, rgba(0, 100, 0, 1), #005600);
  z-index: 1;
}

#leaves i:after {
  content: "";
  height: 125px;
  width: 10px;
  background: linear-gradient(to right, rgba(0, 0, 0, 0.15), rgba(0, 0, 0, 0));
  display: block;
  transform: rotate(125deg);
  position: absolute;
  left: 85px;
  border-radius: 50%;
}

#leaves i:nth-of-type(n) {
  height: 23px;
  width: 30px;
}
#leaves i:nth-of-type(n):before {
  width: 7px;
  height: 5px;
  top: 17px;
  right: 1px;
}
#leaves i:nth-of-type(n):after {
  width: 2px;
  height: 17px;
  left: 12px;
  top: 0px;
}

#leaves i:nth-of-type(2n + 1) {
  height: 11px;
  width: 16px;
}
#leaves i:nth-of-type(2n + 1):before {
  width: 4px;
  height: 3px;
  top: 7px;
  right: 0px;
}
#leaves i:nth-of-type(2n + 1):after {
  width: 2px;
  height: 6px;
  left: 5px;
  top: 1px;
}

#leaves i:nth-of-type(3n + 2) {
  height: 17px;
  width: 23px;
}
#leaves i:nth-of-type(3n + 2):before {
  height: 4px;
  width: 4px;
  top: 12px;
  right: 1px;
}
#leaves i:nth-of-type(3n + 2):after {
  height: 10px;
  width: 2px;
  top: 1px;
  left: 8px;
}

#leaves i:nth-of-type(n) {
  animation-delay: 1.9s;
}
#leaves i:nth-of-type(2n) {
  animation-delay: 3.9s;
}
#leaves i:nth-of-type(3n) {
  animation-delay: 2.3s;
}
#leaves i:nth-of-type(4n) {
  animation-delay: 4.4s;
}
#leaves i:nth-of-type(5n) {
  animation-delay: 5s;
}
#leaves i:nth-of-type(6n) {
  animation-delay: 3.5s;
}
#leaves i:nth-of-type(7n) {
  animation-delay: 2.8s;
}
#leaves i:nth-of-type(8n) {
  animation-delay: 1.5s;
}
#leaves i:nth-of-type(9n) {
  animation-delay: 3.3s;
}
#leaves i:nth-of-type(10n) {
  animation-delay: 2.5s;
}
#leaves i:nth-of-type(11n) {
  animation-delay: 1.2s;
}
#leaves i:nth-of-type(12n) {
  animation-delay: 4.1s;
}
#leaves i:nth-of-type(13n) {
  animation-delay: 1s;
}
#leaves i:nth-of-type(14n) {
  animation-delay: 4.7s;
}
#leaves i:nth-of-type(15n) {
  animation-delay: 3s;
}

#leaves i:nth-of-type(n) {
  background: linear-gradient(to bottom right, #309900, #005600);
}
#leaves i:nth-of-type(2n + 2) {
  background: linear-gradient(to bottom right, #5e9900, #2b5600);
}
#leaves i:nth-of-type(4n + 1) {
  background: linear-gradient(to bottom right, #990, #564500);
}

#leaves i:nth-of-type(n) {
  opacity: 0.7;
}
#leaves i:nth-of-type(3n + 1) {
  opacity: 0.5;
}
#leaves i:nth-of-type(3n + 2) {
  opacity: 0.3;
}

#leaves i:nth-of-type(n) {
  transform: rotate(180deg);
}

#leaves i:nth-of-type(n) {
  animation-timing-function: ease-in-out;
}

@keyframes falling {
  0% {
    transform: translate3d(300, 0, 0) rotate(0deg);
  }
  100% {
    transform: translate3d(-350px, 700px, 0) rotate(90deg);
    opacity: 0;
  }
}

@keyframes falling2 {
  0% {
    transform: translate3d(0, 0, 0) rotate(90deg);
  }
  100% {
    transform: translate3d(-400px, 680px, 0) rotate(0deg);
    opacity: 0;
  }
}

@keyframes falling3 {
  0% {
    transform: translate3d(0, 0, 0) rotate(-20deg);
  }
  100% {
    transform: translate3d(-230px, 640px, 0) rotate(-70deg);
    opacity: 0;
  }
}

/* Wave Animation */
#waveContainer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

#waveContainer canvas {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Ocean 3D */
#oceanContainer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  overflow: hidden;
}

#oceanContainer canvas {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#ocean {
  position: absolute;
  width: 100%;
  height: 100%;
  background: linear-gradient(#045c7c, #0d324e);
}

#overlay {
  background: rgba(255, 255, 255, 0.96);
  font-family: "Allerta Stencil", sans-serif;
  font-size: 1em;
  position: absolute;
  width: 100%;
  height: 100%;
  display: none;
  top: 0;
  left: 0;
  z-index: 2;
  overflow-y: auto;
  padding: 24px 0;
}

#settings {
  margin-top: 24px;
  font-size: 2.2em;
  text-align: center;
  color: #031b2d;
}

#parameter {
  margin-top: 24px;
  font-size: 1.05em;
  text-align: center;
  width: 100%;
  color: #031b2d;
}

#holder {
  width: min(92%, 520px);
  margin-left: auto;
  margin-right: auto;
  padding: 24px 18px 28px;
  box-sizing: border-box;
}

#holder input,
#holder button {
  width: 100%;
}

@media (max-width: 768px) {
  #holder {
    padding: 18px 14px 26px;
  }

  #settings {
    font-size: 1.9em;
    margin-top: 20px;
  }

  #parameter {
    margin-top: 18px;
    font-size: 1rem;
  }
}

#holder input,
#holder button {
  width: 100%;
}

#button {
  margin-top: 30px;
  width: 100%;
  background-color: #031b2d;
  color: white;
  border: 3px solid #0d4d78;
  font-size: 1.4em;
  font-family: "Allerta Stencil", sans-serif;
}

#button:hover {
  background-color: #0d4d78;
}

@media (max-width: 768px) {
  #holder {
    padding: 20px 14px 28px;
  }

  #settings {
    font-size: 2.1em;
  }

  #parameter {
    margin-top: 24px;
    font-size: 1rem;
  }

  .slider {
    margin-top: 20px;
  }
}

.slider {
  -webkit-appearance: none;
  margin-top: 30px;
  width: 100%;
  height: 2px;
  border-radius: 5px;
  background: #d3d3d3;
  outline: none;
  opacity: 0.25;
  transition: opacity 0.2s;
}

.slider:hover {
  opacity: 0.85;
}

.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  display: inline-block;
  height: 45px;
  border-radius: 100%;
  width: 45px;
  border: solid black 6px;
  cursor: pointer;
}

.slider::-moz-range-thumb {
  display: inline-block;
  height: 50px;
  border-radius: 100%;
  width: 50px;
  border: solid black 4px;
  cursor: pointer;
}

#button {
  margin-top: 40px;
  width: 100%;
  background-color: white;
  color: black;
  border: 3px solid #555555;
  font-size: 1.75em;
  font-family: "Allerta Stencil", sans-serif;
  cursor: pointer;
}

#button:hover {
  background-color: #555555;
  color: white;
}

.timer-modes {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  z-index: 10;
}

.mode-btn {
  font-size: 0.95rem;
  font-weight: 600;
  padding: 10px 24px;
  border: 2px solid rgba(255, 255, 255, 0.8);
  background: transparent;
  color: white;
  cursor: pointer;
  border-radius: 32px;
  transition: all 0.3s ease;
}

.mode-btn.active {
  background: rgba(255, 255, 255, 0.3);
  border-color: white;
  color: white;
}

.mode-btn:hover:not(.active) {
  border-color: white;
  background: rgba(255, 255, 255, 0.1);
}

.timer-display {
  font-size: clamp(6rem, 14vw, 9rem);
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: white;
  text-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  z-index: 10;
}

.timer-actions {
  display: flex;
  gap: 20px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  z-index: 10;
}

.start-btn {
  font-size: 1.1rem;
  font-weight: 600;
  padding: 14px 48px;
  background: #6366f1;
  color: white;
  border: none;
  cursor: pointer;
  border-radius: 32px;
  transition: all 0.3s ease;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.start-btn:hover {
  background: #4f46e5;
  transform: scale(1.05);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.3);
}

.start-btn:active {
  transform: scale(0.98);
}

.secondary-btn {
  font-size: 0.9rem;
  padding: 10px 20px;
  background: transparent;
  border: 2px solid rgba(255, 255, 255, 0.8);
  color: white;
  cursor: pointer;
  border-radius: 24px;
  transition: all 0.3s ease;
}

.secondary-btn:hover {
  border-color: white;
  background: rgba(255, 255, 255, 0.2);
}

.secondary-btn:active {
  background: rgba(255, 255, 255, 0.3);
}

.timer-settings {
  display: flex;
  align-items: center;
  gap: 8px;
}

.timer-settings input {
  width: 70px;
  padding: 6px 8px;
}

.settings-btn {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  border: 2px solid rgba(255, 255, 255, 0.6);
  color: white;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  z-index: 100;
  backdrop-filter: blur(4px);
}

.settings-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  border-color: white;
  transform: rotate(90deg);
}

.theme-modal {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: min(420px, calc(100% - 32px));
  max-width: 420px;
  max-height: calc(100vh - 48px);
  overflow: hidden;
  background: rgba(0, 0, 0, 0.92);
  border-radius: 18px;
  padding: 20px;
  z-index: 99;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
}

@media (max-width: 768px) {
  .theme-modal {
    left: 50%;
    right: auto;
    bottom: 16px;
    transform: translateX(-50%);
    width: calc(100% - 24px);
    max-height: calc(100vh - 32px);
  }

  .theme-modal {
    padding: 16px;
  }

  .theme-options {
    grid-template-columns: 1fr;
  }
}

.theme-modal {
  overflow-y: auto;
}

.theme-modal::-webkit-scrollbar {
  width: 8px;
}

.theme-modal::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.25);
  border-radius: 999px;
}

.theme-modal h3 {
  color: white;
  margin: 0 0 16px 0;
  font-size: 1.1rem;
}

.theme-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.theme-option {
  width: 100%;
  height: 40px;
  border-radius: 8px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.85rem;
  font-weight: 500;
  color: white;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.theme-option:hover {
  transform: scale(1.05);
  border-color: white;
}

.theme-option.active {
  border-color: white;
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.5);
}

/* Theme Styles */
.timer-container.theme-gradient-default {
  background: linear-gradient(
    135deg,
    rgba(99, 102, 241, 0.8) 0%,
    rgba(236, 72, 153, 0.8) 50%,
    rgba(244, 63, 94, 0.8) 100%
  );
}

.timer-container.theme-gradient-sunset {
  background: linear-gradient(
    135deg,
    rgba(255, 107, 107, 0.8) 0%,
    rgba(254, 202, 87, 0.8) 100%
  );
}

.timer-container.theme-gradient-ocean {
  background: linear-gradient(
    135deg,
    rgba(0, 102, 255, 0.8) 0%,
    rgba(0, 212, 255, 0.8) 100%
  );
}

.timer-container.theme-gradient-forest {
  background: linear-gradient(
    135deg,
    rgba(19, 78, 94, 0.8) 0%,
    rgba(113, 178, 128, 0.8) 100%
  );
}

.timer-container.theme-color-dark {
  background: rgba(0, 0, 0, 0.9);
}

.timer-container.theme-color-light {
  background: rgba(245, 245, 245, 0.9);
}

.timer-container.theme-color-light .mode-btn,
.timer-container.theme-color-light .timer-display,
.timer-container.theme-color-light .secondary-btn {
  color: #333;
}

.timer-container.theme-color-light .mode-btn {
  border-color: rgba(0, 0, 0, 0.3);
}

.timer-container.theme-color-light .mode-btn:hover:not(.active) {
  border-color: rgba(0, 0, 0, 0.6);
  background: rgba(0, 0, 0, 0.05);
}

.timer-container.theme-color-light .secondary-btn {
  border-color: rgba(0, 0, 0, 0.3);
}

.timer-container.theme-color-light .secondary-btn:hover {
  border-color: rgba(0, 0, 0, 0.6);
  background: rgba(0, 0, 0, 0.1);
}

.timer-container.theme-color-light .settings-btn {
  background: rgba(0, 0, 0, 0.1);
  border-color: rgba(0, 0, 0, 0.3);
  color: #333;
}

/* Theme-specific start button styles */
.timer-container.theme-color-dark .start-btn {
  background: white;
  color: #000;
}

.timer-container.theme-color-dark .start-btn:hover {
  background: #f0f0f0;
}

.timer-container.theme-color-light .start-btn {
  background: #333;
  color: white;
}

.timer-container.theme-color-light .start-btn:hover {
  background: #1a1a1a;
}

/* Custom timer inputs styling */
.theme-section,
.timer-section {
  margin: 0;
}

.theme-section h3,
.timer-section h3 {
  color: white;
  margin: 0 0 12px 0;
  font-size: 0.95rem;
}

.custom-timer-inputs {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.input-group label {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.8rem;
  font-weight: 500;
}

.input-group input {
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.input-group input:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.15);
}

.input-group input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

/* Toggle Switch */
.toggle-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.9rem;
  font-weight: 500;
}

.toggle-label input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 40px;
  height: 24px;
  background: rgba(255, 255, 255, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 12px;
  cursor: pointer;
  position: relative;
  transition: all 0.3s ease;
  margin: 0;
}

.toggle-label input[type="checkbox"]:before {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: white;
  top: 2px;
  left: 2px;
  transition: all 0.3s ease;
}

.toggle-label input[type="checkbox"]:checked {
  background: rgba(99, 102, 241, 0.6);
  border-color: rgba(99, 102, 241, 0.8);
}

.toggle-label input[type="checkbox"]:checked:before {
  left: 18px;
}

.animation-controls {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Default theme wave animation */
@keyframes wave-default {
  0%,
  100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-20px);
  }
}

/* Ocean wave animation */
@keyframes wave-ocean {
  0%,
  100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-15px);
  }
}

/* ============ PLANNER STYLES ============ */
.planner-btn,
.settings-btn {
  position: fixed;
  bottom: 30px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.65);
  background: rgba(0, 0, 0, 0.3);
  color: white;
  font-size: 1.4rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 110;
  transition:
    transform 0.2s ease,
    background 0.2s ease,
    box-shadow 0.2s ease;
  backdrop-filter: blur(10px);
}

.planner-btn:hover,
.settings-btn:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.18);
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.18);
}

.planner-btn {
  left: 30px;
}

.settings-btn {
  right: 30px;
}

.planner-modal {
  position: fixed;
  inset: 0;
  background: rgba(5, 12, 28, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 150;
  padding: 24px;
  overflow-y: auto;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.planner-modal.open {
  opacity: 1;
  pointer-events: auto;
}

.planner-card {
  width: min(92vw, 1280px);
  max-height: 92vh;
  background: rgba(10, 18, 34, 0.98);
  border-radius: 24px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.32);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 30px;
  display: grid;
  gap: 22px;
  transform: translateY(24px);
  transition: transform 0.25s ease;
  text-align: center;
}

.planner-modal.open .planner-card {
  transform: translateY(0);
}

.planner-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.planner-label {
  text-transform: uppercase;
  letter-spacing: 0.24em;
  font-size: 0.75rem;
  color: #7b8bb2;
  margin-bottom: 6px;
}

.planner-header h2 {
  margin: 0;
  font-size: 1.75rem;
  color: white;
}

.planner-add-btn {
  border: none;
  padding: 14px 20px;
  border-radius: 18px;
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: white;
  cursor: pointer;
  transition:
    transform 0.2s ease,
    filter 0.2s ease;
}

.planner-add-btn:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.planner-summary {
  display: grid;
  gap: 18px;
}

.planner-summary-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
  color: #d0def2;
  font-size: 0.96rem;
}

.planner-summary-item {
  color: #cbd6f2;
}

.planner-summary-done strong,
.planner-summary-overdue strong {
  color: inherit;
}

.planner-summary-done {
  color: #7ee787;
}

.planner-summary-overdue {
  color: #ff8a91;
}

.planner-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.planner-filter-btn {
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
  color: #d8e4f8;
  padding: 10px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition:
    background 0.2s ease,
    border-color 0.2s ease;
}

.planner-filter-btn.active,
.planner-filter-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.28);
}

.planner-list {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 16px;
  min-height: 220px;
  max-height: calc(90vh - 340px);
  overflow-y: auto;
  display: grid;
  gap: 8px;
  scroll-behavior: smooth;
}

.planner-list::-webkit-scrollbar {
  width: 8px;
}

.planner-list::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.02);
  border-radius: 10px;
}

.planner-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 10px;
}

.planner-list::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

.planner-empty {
  color: #b0b9cc;
  font-size: 1rem;
  text-align: center;
  padding: 48px 0;
}

.planner-task-item {
  /* task card */
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px; /* ← gap between task info and action buttons */
  align-items: start;
  padding: 4px 8px; /* ← controls the card height/inner spacing */
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: all 0.2s ease;
  font-size: 0.93rem;
}

.planner-task-item.overdue {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.4);
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.15);
}

.planner-task-item.done {
  background: rgba(34, 197, 94, 0.08);
  border-color: rgba(34, 197, 94, 0.4);
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.15);
}

.planner-task-item.active {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.08);
}

.task-info {
  min-width: 0;
}

.task-title {
  margin: 0 0 4px;
  font-size: 0.88rem;
  color: white;
  font-weight: 600;
}

.task-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  color: #aab6dd;
  font-size: 0.78rem;
}

.task-meta span {
  background: rgba(255, 255, 255, 0.08);
  padding: 3px 7px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.task-meta span i {
  font-size: 0.72rem;
}

.tag-category.category-exam {
  background: rgba(248, 113, 113, 0.18);
  color: #fecdd3;
  border: 1px solid rgba(248, 113, 113, 0.35);
}

.tag-category.category-revision {
  background: rgba(56, 189, 248, 0.18);
  color: #cfe8ff;
  border: 1px solid rgba(56, 189, 248, 0.35);
}

.tag-category.category-past-paper {
  background: rgba(168, 85, 247, 0.18);
  color: #e9d5ff;
  border: 1px solid rgba(168, 85, 247, 0.35);
}

.tag-category.category-finals {
  background: rgba(235, 77, 75, 0.18);
  color: #fed7aa;
  border: 1px solid rgba(235, 77, 75, 0.35);
}

.tag-category.category-other {
  background: rgba(148, 163, 184, 0.18);
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.35);
}

.tag-priority.priority-normal {
  background: rgba(59, 130, 246, 0.18);
  color: #bfdbfe;
  border: 1px solid rgba(59, 130, 246, 0.35);
}

.tag-priority.priority-high {
  background: rgba(251, 191, 36, 0.18);
  color: #fef3c7;
  border: 1px solid rgba(251, 191, 36, 0.35);
}

.tag-priority.priority-urgent {
  background: rgba(248, 113, 113, 0.18);
  color: #fed7d7;
  border: 1px solid rgba(248, 113, 113, 0.35);
}

.tag-subject,
.tag-due,
.tag-estimate {
  background: rgba(255, 255, 255, 0.08);
  color: #aab6dd;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.task-notes {
  margin: 8px 0 0;
  color: #c2cbe0;
  line-height: 1.4;
  font-size: 0.88rem;
}

.task-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-end;
}

.task-done-toggle,
.task-edit-btn,
.task-delete-btn {
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.06);
  color: white;
  padding: 5px 8px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 0.74rem;
}
.task-edit-btn {
  color: #a5e0ff;
}

.task-done-toggle.checked {
  background: rgba(59, 130, 246, 0.2);
  border-color: #3b82f6;
}

.task-popup {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(3, 11, 32, 0.75);
  z-index: 160;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}

.task-popup.open {
  opacity: 1;
  pointer-events: auto;
}

.task-popup-card {
  width: min(580px, 95vw);
  background: rgba(12, 22, 44, 0.98);
  border-radius: 24px;
  padding: 32px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.35);
  max-height: 90vh;
  overflow-y: auto;
}

.task-popup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.task-popup-header h3 {
  margin: 0;
  font-size: 1.5rem;
  color: white;
}

.task-popup-close {
  background: transparent;
  border: none;
  font-size: 1.7rem;
  line-height: 1;
  color: white;
  width: 46px;
  height: 46px;
  cursor: pointer;
}

.task-popup-body {
  display: grid;
  gap: 18px;
  margin-bottom: 24px;
}

.form-section {
  display: grid;
  gap: 8px;
}

.form-section.full-width {
  grid-column: 1 / -1;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.form-label {
  display: block;
  color: #9fb4d6;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}

.form-input,
.form-textarea {
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: white;
  padding: 11px 13px;
  font-size: 0.96rem;
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

select.form-input {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #f8fafc !important;
  border-color: rgba(255, 255, 255, 0.18) !important;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath fill='none' stroke='%23e2e8f0' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M5 8l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px 16px;
  padding-right: 44px;
}

select.form-input option {
  background: #0f172a;
  color: #e2e8f0;
}

select.form-input option:hover {
  background: #1e293b;
}

input[type="date"].form-input::-webkit-calendar-picker-indicator {
  filter: brightness(0.65) opacity(0.9);
}

.form-input:focus,
.form-textarea:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.08);
}

.form-textarea {
  resize: vertical;
  min-height: 90px;
}

.category-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.category-chip {
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
  color: #d8e4f8;
  padding: 10px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.category-chip:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.24);
}

.category-chip i {
  margin-right: 8px;
  color: currentColor;
}

.category-chip.selected {
  color: white;
}

.category-chip.category-exam.selected {
  background: #ef4444;
  border-color: #b91c1c;
}

.category-chip.category-revision.selected {
  background: #38bdf8;
  border-color: #0284c7;
  color: #0f172a;
}

.category-chip.category-past-paper.selected {
  background: #facc15;
  border-color: #ca8a04;
  color: #0f172a;
}

.category-chip.category-finals.selected {
  background: #a855f7;
  border-color: #7c3aed;
}

.category-chip.category-other.selected {
  background: #4b5563;
  border-color: #374151;
}

.task-popup-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.save-task-btn,
.cancel-task-btn {
  border: none;
  padding: 12px 20px;
  border-radius: 18px;
  cursor: pointer;
  font-size: 0.96rem;
  transition:
    transform 0.2s ease,
    filter 0.2s ease;
}

.save-task-btn {
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: white;
}

.save-task-btn:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.cancel-task-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #d8e4f8;
}

.cancel-task-btn:hover {
  background: rgba(255, 255, 255, 0.05);
}

@media (max-width: 900px) {
  .planner-card {
    width: min(90vw, 500px);
  }

  .planner-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .planner-add-btn {
    width: 100%;
  }
}
/* ============ ANALYTICS MODAL ============ */
.analytics-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.analytics-modal.open {
  opacity: 1;
  pointer-events: auto;
}
.analytics-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
}
.analytics-panel {
  position: relative;
  z-index: 1;
  width: min(92vw, 780px);
  max-height: 88vh;
  overflow-y: auto;
  background: #0b111f;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 24px;
  padding: 32px;
  transform: translateY(20px) scale(0.98);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}
.analytics-modal.open .analytics-panel {
  transform: translateY(0) scale(1);
}
.analytics-panel::-webkit-scrollbar {
  width: 6px;
}
.analytics-panel::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

/* Header */
.analytics-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
}
.analytics-eyebrow {
  margin: 0 0 4px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.35);
}
.analytics-title {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 700;
  color: white;
  letter-spacing: -0.02em;
}
.analytics-close {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.5);
  width: 36px;
  height: 36px;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
}
.analytics-close:hover {
  background: rgba(255, 255, 255, 0.12);
  color: white;
}

/* Date pills */
.analytics-date-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  gap: 12px;
}
.analytics-date-pills {
  display: flex;
  gap: 6px;
  background: rgba(255, 255, 255, 0.04);
  padding: 4px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.date-pill {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.45);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.date-pill:hover {
  color: rgba(255, 255, 255, 0.8);
}
.date-pill.active {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}
.analytics-date-label {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.3);
}

/* KPI row */
.analytics-kpi-row {
  display: flex;
  align-items: stretch;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 16px;
  padding: 20px 0;
  margin-bottom: 20px;
  overflow: hidden;
}
.analytics-kpi {
  flex: 1;
  padding: 0 24px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.analytics-kpi-divider {
  width: 1px;
  background: rgba(255, 255, 255, 0.07);
  margin: 4px 0;
}
.kpi-value {
  font-size: 2rem;
  font-weight: 700;
  color: white;
  letter-spacing: -0.03em;
  line-height: 1;
}
.kpi-unit {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.35);
  font-weight: 500;
  margin-top: 2px;
}
.kpi-label {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.4);
  font-weight: 500;
  margin-top: 6px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.kpi-bar {
  height: 3px;
  background: rgba(255, 255, 255, 0.07);
  border-radius: 2px;
  margin-top: 10px;
  overflow: hidden;
}
.kpi-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}
.kpi-bar-fill.study {
  background: #6366f1;
}
.kpi-bar-fill.break {
  background: #38bdf8;
}
.kpi-bar-fill.sessions {
  background: #a78bfa;
}
.kpi-bar-fill.streak {
  background: #f59e0b;
}

/* Body grid */
.analytics-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
@media (max-width: 600px) {
  .analytics-body {
    grid-template-columns: 1fr;
  }
  .analytics-kpi-row {
    flex-wrap: wrap;
  }
  .analytics-kpi {
    min-width: 45%;
    padding: 8px 16px;
  }
  .analytics-kpi-divider {
    display: none;
  }
}

/* Cards */
.analytics-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 16px;
  padding: 20px;
}
.analytics-card-label {
  margin: 0 0 16px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.35);
}

/* Activity chart */
.chart-area {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 90px;
  margin-bottom: 8px;
}
.chart-bar-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
  gap: 3px;
}
.chart-bar {
  width: 100%;
  border-radius: 4px 4px 0 0;
  min-height: 3px;
  transition: height 0.7s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  cursor: default;
}
.chart-bar.study-bar {
  background: linear-gradient(180deg, #818cf8, #6366f1);
}
.chart-bar.break-bar {
  background: linear-gradient(180deg, #7dd3fc, #38bdf8);
  opacity: 0.6;
}
.chart-bar:hover::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 20, 35, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: white;
  font-size: 0.72rem;
  padding: 4px 8px;
  border-radius: 6px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 10;
}
.chart-x-labels {
  display: flex;
  gap: 6px;
}
.chart-x-label {
  flex: 1;
  text-align: center;
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.25);
  font-weight: 500;
}

/* Subject list */
.subject-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.subject-row {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.subject-row-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.subject-name {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.8);
  font-weight: 500;
}
.subject-time {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.45);
  font-weight: 600;
}
.subject-progress {
  height: 4px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 2px;
  overflow: hidden;
}
.subject-progress-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Session log */
.analytics-sessions-card {
  margin-bottom: 16px;
}
.analytics-sessions-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.analytics-show-all {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.35);
  font-size: 0.78rem;
  cursor: pointer;
  padding: 0;
  transition: color 0.2s;
}
.analytics-show-all:hover {
  color: rgba(255, 255, 255, 0.7);
}
.session-log {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 200px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.08) transparent;
}
.session-log.expanded {
  max-height: none;
}
.session-entry {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.025);
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: background 0.15s ease;
}
.session-entry:hover {
  background: rgba(255, 255, 255, 0.05);
}
.session-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.session-dot.focus {
  background: #6366f1;
}
.session-dot.break {
  background: #38bdf8;
}
.session-entry-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.session-entry-title {
  font-size: 0.83rem;
  color: rgba(255, 255, 255, 0.8);
  font-weight: 500;
}
.session-entry-sub {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.3);
}
.session-entry-duration {
  font-size: 0.82rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.5);
}

/* Empty state */
.analytics-empty {
  color: rgba(255, 255, 255, 0.25);
  font-size: 0.85rem;
  text-align: center;
  padding: 24px 0;
  margin: 0;
}

/* Footer */
.analytics-footer {
  display: flex;
  gap: 10px;
}
.analytics-btn {
  flex: 1;
  padding: 11px 16px;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}
.analytics-btn-danger {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.25);
  color: #fca5a5;
}
.analytics-btn-danger:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.45);
}
.analytics-btn-export {
  background: rgba(99, 102, 241, 0.1);
  border-color: rgba(99, 102, 241, 0.25);
  color: #c7d2fe;
}
.analytics-btn-export:hover {
  background: rgba(99, 102, 241, 0.2);
  border-color: rgba(99, 102, 241, 0.45);
}
