* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    sans-serif;
  background: linear-gradient(
    135deg,
    #fdf6e3 0%,
    #f4e8d0 25%,
    #e8d5b7 50%,
    #d4c5a0 75%,
    #c4b59a 100%
  );
  background-attachment: fixed;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #5d4e37;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(
      circle at 25% 25%,
      rgba(196, 181, 154, 0.1) 0%,
      transparent 25%
    ),
    radial-gradient(
      circle at 75% 75%,
      rgba(212, 197, 160, 0.1) 0%,
      transparent 25%
    ),
    radial-gradient(
      circle at 50% 50%,
      rgba(232, 213, 183, 0.05) 0%,
      transparent 50%
    );
  pointer-events: none;
  z-index: -1;
}

.app {
  width: 100%;
  max-width: 900px;
  margin: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.page {
  display: none;
  background: linear-gradient(
    145deg,
    rgba(255, 250, 240, 0.95),
    rgba(253, 246, 227, 0.98)
  );
  border: 2px solid;
  border-image: linear-gradient(45deg, #8b7355, #a0916a, #b5a97f) 1;
  box-shadow: 0 0 25px rgba(139, 115, 85, 0.15),
    0 0 50px rgba(160, 145, 106, 0.1), inset 0 0 15px rgba(181, 169, 127, 0.1);
  padding: 35px;
  backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
}

.page::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    45deg,
    transparent 49%,
    rgba(196, 181, 154, 0.03) 50%,
    transparent 51%
  );
  pointer-events: none;
}

.page.active {
  display: block;
}

/* Page 1 Styles */
.page1-layout {
  display: flex;
  gap: 30px;
  align-items: flex-start;
}

.timer-container {
  flex: 1;
  text-align: center;
  position: relative;
}

.timer-list-container {
  flex: 0 0 300px;
  background: linear-gradient(
    145deg,
    rgba(253, 246, 227, 0.85),
    rgba(244, 232, 208, 0.95)
  );
  border-radius: 20px;
  padding: 15px;
  border: 1px solid rgba(139, 115, 85, 0.25);
  box-shadow: 0 0 15px rgba(139, 115, 85, 0.15),
    inset 0 0 15px rgba(160, 145, 106, 0.1);
  backdrop-filter: blur(5px);
  overflow: hidden;
}

.timer-list-container h3 {
  color: #5d4e37;
  margin-bottom: 15px;
  text-align: center;
  font-size: 20px;
  text-shadow: 0 0 10px rgba(93, 78, 55, 0.3);
  font-weight: 500;
  letter-spacing: 0.5px;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    sans-serif;
}

.timer-list-display {
  max-height: 400px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-top: 2px;
  padding-bottom: 2px;
}

.timer-list-display::-webkit-scrollbar {
  width: 16px;
}

.timer-list-display::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 4px;
  margin: 4px;
}

.timer-list-display::-webkit-scrollbar-thumb {
  background: #8b7355;
  border-radius: 4px;
  border: 4px solid transparent;
  background-clip: content-box;
}

.timer-list-item {
  background: linear-gradient(
    145deg,
    rgba(255, 250, 240, 0.7),
    rgba(253, 246, 227, 0.85)
  );
  border-radius: 15px;
  padding: 18px;
  margin: 2px 0 12px 0;
  border: 1px solid rgba(139, 115, 85, 0.15);
  transition: all 0.2s ease;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.15);
  overflow: hidden;
  width: 100%;
  box-sizing: border-box;
  position: relative;
}

.timer-list-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 2px 20px rgba(139, 115, 85, 0.3);
  z-index: 1;
}

.timer-list-item:first-child {
  margin-top: 4px;
}

.timer-list-item:last-child {
  margin-bottom: 4px;
}

.timer-list-item.active {
  border-color: #d2691e;
  background: linear-gradient(
    145deg,
    rgba(210, 105, 30, 0.1),
    rgba(218, 165, 32, 0.2)
  );
  box-shadow: 0 0 20px rgba(210, 105, 30, 0.4);
}

.timer-list-item.completed {
  background: linear-gradient(
    145deg,
    rgba(107, 142, 35, 0.1),
    rgba(139, 115, 85, 0.2)
  );
  border-color: #6b8e23;
  opacity: 0.8;
}

.timer-item-description {
  font-weight: 500;
  color: #5d4e37;
  margin-bottom: 5px;
  font-size: 14px;
  text-shadow: 0 0 5px rgba(93, 78, 55, 0.3);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    sans-serif;
}

.timer-item-time {
  color: #8b7355;
  font-size: 16px;
  font-family: "JetBrains Mono", "SF Mono", Monaco, Inconsolata, "Roboto Mono",
    Consolas, "Courier New", monospace;
  text-shadow: 0 0 5px rgba(139, 115, 85, 0.3);
  font-variant-numeric: tabular-nums;
}

.timer-item-status {
  font-size: 12px;
  color: #6b8e23;
  margin-top: 5px;
  font-weight: 400;
  text-shadow: 0 0 5px rgba(107, 142, 35, 0.5);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    sans-serif;
}

.timer-description {
  font-size: 28px;
  color: #5d4e37;
  margin-bottom: 20px;
  font-weight: 500;
  text-shadow: 0 0 15px rgba(93, 78, 55, 0.3);
  letter-spacing: 0.5px;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    sans-serif;
}

.global-progress-container {
  margin-bottom: 10px;
  position: relative;
  width: 100%;
}

@media (max-width: 768px) {
  .global-progress-container {
    max-width: 500px;
    margin: 0 auto 10px auto;
  }
}

@media (max-width: 480px) {
  .global-progress-container {
    max-width: 100%;
    margin: 0 auto 10px auto;
  }
}

.progress-bar {
  width: 100%;
  height: 12px;
  background: linear-gradient(
    145deg,
    rgba(139, 115, 85, 0.2),
    rgba(160, 145, 106, 0.3)
  );
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
  --progress: 100%;
}

.progress-bar::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: var(--progress);
  background: linear-gradient(90deg, #6b8e23, #8fbc8f, #90ee90);
  border-radius: 12px;
  transition: width 0.3s ease;
  box-shadow: 0 0 10px rgba(107, 142, 35, 0.4);
}

.progress-bar.warning::before {
  background: linear-gradient(90deg, #d2691e, #daa520, #f4a460);
  box-shadow: 0 0 10px rgba(210, 105, 30, 0.4);
}

.progress-bar.danger::before {
  background: linear-gradient(90deg, #cd5c5c, #dc143c, #e9967a);
  box-shadow: 0 0 10px rgba(205, 92, 92, 0.4);
}

.progress-text {
  text-align: center;
  font-size: 16px;
  color: #8b7355;
  margin-top: 8px;
  font-family: "JetBrains Mono", "SF Mono", Monaco, Inconsolata, "Roboto Mono",
    Consolas, "Courier New", monospace;
  font-weight: 400;
  text-shadow: 0 0 5px rgba(139, 115, 85, 0.3);
  font-variant-numeric: tabular-nums;
}

.timer-display {
  font-size: 72px;
  font-weight: 400;
  color: #5d4e37;
  margin: 30px 0;
  font-family: "JetBrains Mono", "SF Mono", Monaco, Inconsolata, "Roboto Mono",
    Consolas, "Courier New", monospace;
  border: 2px solid;
  border-image: linear-gradient(45deg, #8b7355, #a0916a) 1;
  padding: 35px;
  background: linear-gradient(
    145deg,
    rgba(255, 250, 240, 0.4),
    rgba(253, 246, 227, 0.6)
  );
  backdrop-filter: blur(10px);
  transition: all 0.2s ease;
  box-shadow: 0 0 25px rgba(139, 115, 85, 0.2),
    inset 0 0 25px rgba(160, 145, 106, 0.1);
  text-shadow: 0 0 15px rgba(93, 78, 55, 0.2);
  position: relative;
  overflow: hidden;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.1em;
}

/* .timer-display::before {
  content: "";
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(45deg, #00ffff, #66b3ff, #00bfff, #ff00ff);
  border-radius: 0px;
  z-index: -1;
  
} */

.timer-display.warning {
  color: #d2691e;
  border-image: linear-gradient(45deg, #d2691e, #daa520) 1;
  text-shadow: 0 0 20px rgba(210, 105, 30, 0.5);
  box-shadow: 0 0 30px rgba(210, 105, 30, 0.3),
    inset 0 0 30px rgba(218, 165, 32, 0.1);
}

.timer-display.warning::before {
  background: linear-gradient(45deg, #d2691e, #daa520, #deb887, #f4a460);
}

.timer-display.danger {
  color: #cd5c5c;
  border-image: linear-gradient(45deg, #cd5c5c, #dc143c) 1;
  text-shadow: 0 0 25px rgba(205, 92, 92, 0.5);
  box-shadow: 0 0 40px rgba(205, 92, 92, 0.3),
    inset 0 0 40px rgba(205, 92, 92, 0.1);
}

.timer-display.danger::before {
  background: linear-gradient(45deg, #cd5c5c, #dc143c, #e9967a, #f08080);
}

.controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 15px;
  margin-bottom: 30px;
}

.control-btn {
  width: 65px;
  height: 65px;
  border: 2px solid #8b7355;
  border-radius: 50%;
  background: linear-gradient(
    145deg,
    rgba(139, 115, 85, 0.1),
    rgba(160, 145, 106, 0.2)
  );
  color: #8b7355;
  font-size: 24px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 0 12px rgba(139, 115, 85, 0.2);
  backdrop-filter: blur(10px);
  text-shadow: 0 0 8px rgba(139, 115, 85, 0.2);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.control-btn-5min {
  width: 55px;
  height: 55px;
  font-size: 16px;
  font-weight: 600;
  opacity: 0.8;
  border-color: rgba(139, 115, 85, 0.6);
  background: linear-gradient(
    145deg,
    rgba(139, 115, 85, 0.05),
    rgba(160, 145, 106, 0.1)
  );
}

.control-btn::before {
  display: none;
}

.control-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 0 20px rgba(139, 115, 85, 0.4);
  border-color: #a0916a;
}

.control-btn-5min:hover {
  transform: scale(1.05);
  box-shadow: 0 0 15px rgba(139, 115, 85, 0.3);
  border-color: #8b7355;
  opacity: 1;
}

.control-btn:active {
  transform: scale(0.95);
}

.control-btn-5min:active {
  transform: scale(0.9);
}

.timer-controls {
  display: flex;
  justify-content: center;
  gap: 15px;
  flex-wrap: wrap;
}

.action-btn {
  padding: 14px 28px;
  border: 2px solid #8b7355;
  border-radius: 12px;
  background: linear-gradient(
    145deg,
    rgba(139, 115, 85, 0.1),
    rgba(160, 145, 106, 0.2)
  );
  color: #8b7355;
  font-size: 16px;
  font-weight: 400;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 90px;
  box-shadow: 0 0 12px rgba(139, 115, 85, 0.15);
  backdrop-filter: blur(10px);
  text-shadow: 0 0 8px rgba(139, 115, 85, 0.2);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    sans-serif;
  letter-spacing: 0.2px;
  position: relative;
  overflow: hidden;
}

.action-btn::before {
  display: none;
}

.action-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 3px 20px rgba(139, 115, 85, 0.3);
  border-color: #a0916a;
  background: linear-gradient(
    145deg,
    rgba(139, 115, 85, 0.2),
    rgba(160, 145, 106, 0.3)
  );
}

.action-btn:active {
  transform: translateY(0px);
}

/* 初始狀態只顯示開始按鈕 */
#pauseBtn {
  display: none;
}

/* Page 2 Styles */
.settings-container h2 {
  color: #5d4e37;
  margin-bottom: 30px;
  text-align: center;
  font-size: 32px;
  text-shadow: 0 0 15px rgba(93, 78, 55, 0.3);
  font-weight: 500;
  letter-spacing: 0.5px;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    sans-serif;
}

.timers-list {
  margin-bottom: 20px;
}

.timer-setting {
  background: linear-gradient(
    145deg,
    rgba(253, 246, 227, 0.85),
    rgba(244, 232, 208, 0.95)
  );
  border-radius: 20px;
  padding: 25px;
  margin-bottom: 20px;
  border: 1px solid rgba(139, 115, 85, 0.25);
  transition: all 0.2s ease;
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(5px);
}

.timer-setting:hover {
  border-color: #8b7355;
  transform: translateY(-1px);
  box-shadow: 0 0 20px rgba(139, 115, 85, 0.3);
}

.timer-info {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-bottom: 15px;
}

.description-input {
  padding: 12px;
  border: 2px solid rgba(139, 115, 85, 0.3);
  border-radius: 8px;
  font-size: 16px;
  width: 100%;
  background: linear-gradient(
    145deg,
    rgba(255, 250, 240, 0.3),
    rgba(253, 246, 227, 0.5)
  );
  color: #5d4e37;
  backdrop-filter: blur(5px);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    sans-serif;
  text-shadow: 0 0 5px rgba(93, 78, 55, 0.3);
}

.description-input::placeholder {
  color: rgba(139, 115, 85, 0.5);
}

.description-input:focus {
  outline: none;
  border-color: #8b7355;
  box-shadow: 0 0 15px rgba(139, 115, 85, 0.4);
}

.time-inputs {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
}

.time-inputs span {
  color: #8b7355;
  font-weight: 400;
  font-size: 16px;
  text-shadow: 0 0 5px rgba(139, 115, 85, 0.5);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    sans-serif;
}

.minutes-input,
.seconds-input {
  width: 70px;
  padding: 10px;
  border: 2px solid rgba(139, 115, 85, 0.3);
  border-radius: 8px;
  text-align: center;
  font-size: 16px;
  background: linear-gradient(
    145deg,
    rgba(255, 250, 240, 0.3),
    rgba(253, 246, 227, 0.5)
  );
  color: #5d4e37;
  backdrop-filter: blur(5px);
  font-family: "JetBrains Mono", "SF Mono", Monaco, Inconsolata, "Roboto Mono",
    Consolas, "Courier New", monospace;
  text-shadow: 0 0 5px rgba(93, 78, 55, 0.3);
  font-variant-numeric: tabular-nums;
}

.minutes-input:focus,
.seconds-input:focus {
  outline: none;
  border-color: #8b7355;
  box-shadow: 0 0 15px rgba(139, 115, 85, 0.4);
}

.timer-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.move-up,
.move-down,
.delete-timer {
  width: 40px;
  height: 40px;
  border: 2px solid rgba(139, 115, 85, 0.5);
  border-radius: 8px;
  background: linear-gradient(
    145deg,
    rgba(253, 246, 227, 0.3),
    rgba(244, 232, 208, 0.5)
  );
  color: #8b7355;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.2s ease;
  backdrop-filter: blur(5px);
  text-shadow: 0 0 5px rgba(139, 115, 85, 0.3);
}

.move-up:hover,
.move-down:hover {
  background: linear-gradient(
    145deg,
    rgba(139, 115, 85, 0.2),
    rgba(160, 145, 106, 0.3)
  );
  box-shadow: 0 0 10px rgba(139, 115, 85, 0.3);
  transform: scale(1.02);
}

.delete-timer {
  background: linear-gradient(
    145deg,
    rgba(205, 92, 92, 0.3),
    rgba(178, 34, 34, 0.5)
  );
  border-color: rgba(205, 92, 92, 0.5);
  color: #cd5c5c;
  text-shadow: 0 0 5px rgba(205, 92, 92, 0.3);
}

.delete-timer:hover {
  background: linear-gradient(
    145deg,
    rgba(205, 92, 92, 0.4),
    rgba(178, 34, 34, 0.6)
  );
  box-shadow: 0 0 10px rgba(205, 92, 92, 0.3);
  transform: scale(1.02);
}

.move-up:disabled,
.move-down:disabled,
.delete-timer:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.move-up:disabled:hover,
.move-down:disabled:hover,
.delete-timer:disabled:hover {
  background: linear-gradient(
    145deg,
    rgba(108, 117, 125, 0.3),
    rgba(90, 98, 104, 0.5)
  );
  box-shadow: none;
  transform: none;
}

.delete-timer:disabled {
  background: linear-gradient(
    145deg,
    rgba(220, 53, 69, 0.3),
    rgba(200, 35, 51, 0.5)
  );
}

.delete-timer:disabled:hover {
  background: linear-gradient(
    145deg,
    rgba(220, 53, 69, 0.3),
    rgba(200, 35, 51, 0.5)
  );
}

.add-timer-btn {
  width: 100%;
  padding: 15px;
  border: 2px dashed rgba(139, 115, 85, 0.5);
  border-radius: 15px;
  background: linear-gradient(
    145deg,
    rgba(139, 115, 85, 0.05),
    rgba(160, 145, 106, 0.1)
  );
  color: #8b7355;
  font-size: 16px;
  font-weight: 400;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: 30px;
  backdrop-filter: blur(5px);
  text-shadow: 0 0 10px rgba(139, 115, 85, 0.3);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    sans-serif;
  letter-spacing: 0.2px;
}

.add-timer-btn:hover {
  background: linear-gradient(
    145deg,
    rgba(139, 115, 85, 0.2),
    rgba(160, 145, 106, 0.3)
  );
  border-style: solid;
  box-shadow: 0 0 15px rgba(139, 115, 85, 0.3);
  transform: translateY(-1px);
}

.test-sound-btn {
  width: 100%;
  padding: 15px;
  border: 2px solid rgba(210, 105, 30, 0.5);
  border-radius: 15px;
  background: linear-gradient(
    145deg,
    rgba(210, 105, 30, 0.1),
    rgba(218, 165, 32, 0.2)
  );
  color: #d2691e;
  font-size: 16px;
  font-weight: 400;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: 30px;
  backdrop-filter: blur(5px);
  text-shadow: 0 0 10px rgba(210, 105, 30, 0.3);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    sans-serif;
  letter-spacing: 0.2px;
}

.test-sound-btn:hover {
  background: linear-gradient(
    145deg,
    rgba(210, 105, 30, 0.2),
    rgba(218, 165, 32, 0.3)
  );
  border-style: solid;
  box-shadow: 0 0 15px rgba(210, 105, 30, 0.4);
  transform: translateY(-1px);
}

.settings-controls {
  display: flex;
  justify-content: space-between;
  gap: 15px;
}

.settings-controls .action-btn {
  flex: 1;
}

/* Responsive Design */
@media (max-width: 768px) {
  .page1-layout {
    flex-direction: column;
    align-items: center;
  }

  .timer-container {
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
  }

  .timer-list-container {
    flex: none;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
  }

  .timer-list-display {
    max-height: 200px;
  }
}

@media (max-width: 480px) {
  .timer-display {
    font-size: 48px;
    padding: 20px;
  }

  .controls {
    gap: 10px;
  }

  .control-btn {
    width: 50px;
    height: 50px;
    font-size: 18px;
  }

  .control-btn-5min {
    width: 42px;
    height: 42px;
    font-size: 14px;
  }

  .timer-controls {
    gap: 10px;
  }

  .action-btn {
    padding: 10px 16px;
    font-size: 14px;
    min-width: 70px;
  }

  .page {
    padding: 20px;
    margin: 10px;
  }

  .app {
    max-width: 100%;
  }

  .page1-layout {
    gap: 20px;
    align-items: center;
  }

  .timer-container {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
  }

  .timer-list-container {
    padding: 15px;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
  }
}
