/**
 * til.re Default Theme
 * Clean dark style with large countdown display
 */

/* Theme variables */
:root {
  --theme-bg: #1a1a2e;
  --theme-color: #ffffff;
  --theme-accent: #4a9eff;
  --theme-timer-size: 8rem;
  --theme-separator-size: 6rem;
}

/* Apply theme */
body {
  background-color: var(--theme-bg);
  color: var(--theme-color);
}

/* Timer styles */
.timer {
  font-size: var(--theme-timer-size);
  letter-spacing: 0.02em;
}

.separator {
  font-size: var(--theme-separator-size);
  margin: 0 0.1em;
}

/* Rest state - green tone */
.state-rest {
  --theme-color: #4ade80;
}

.state-rest .timer {
  color: var(--theme-color);
}

/* Finished state */
.state-finished .message {
  color: var(--theme-accent);
  font-size: 2rem;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.8; transform: scale(1.02); }
}

/* Responsive font size */
@media (max-width: 768px) {
  :root {
    --theme-timer-size: 5rem;
    --theme-separator-size: 4rem;
  }
}

@media (max-width: 480px) {
  :root {
    --theme-timer-size: 3.5rem;
    --theme-separator-size: 2.5rem;
  }
}

@media (max-width: 320px) {
  :root {
    --theme-timer-size: 2.5rem;
    --theme-separator-size: 2rem;
  }
}

/* Support user custom colors */
body[data-color] {
  color: var(--custom-color);
}

body[data-bg] {
  background-color: var(--custom-bg);
}

/* ==================== Control Button Bar ==================== */

.default-controls {
  position: fixed;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 12px;
  z-index: 100;
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  /* Hidden by default */
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* Visible state */
.default-controls.visible {
  opacity: 1;
  visibility: visible;
}

/* Button styles */
.default-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  color: #ffffff;
  cursor: pointer;
  transition: all 0.2s ease;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

/* Button icon */
.default-btn-icon {
  font-size: 18px;
  line-height: 1;
}

/* Fullscreen icon - four corner layout (CSS drawn) */
.default-fullscreen-icon {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  width: 14px;
  height: 14px;
}

.default-fullscreen-icon span {
  width: 5px;
  height: 5px;
  border: 1.5px solid currentColor;
}

/* Expand outward */
.default-fullscreen-icon span:nth-child(1) { border-right: none; border-bottom: none; }
.default-fullscreen-icon span:nth-child(2) { border-left: none; border-bottom: none; }
.default-fullscreen-icon span:nth-child(3) { border-right: none; border-top: none; }
.default-fullscreen-icon span:nth-child(4) { border-left: none; border-top: none; }

/* Shrink inward */
.default-fullscreen-icon.shrink span:nth-child(1) { border: 1.5px solid currentColor; border-left: none; border-top: none; }
.default-fullscreen-icon.shrink span:nth-child(2) { border: 1.5px solid currentColor; border-right: none; border-top: none; }
.default-fullscreen-icon.shrink span:nth-child(3) { border: 1.5px solid currentColor; border-left: none; border-bottom: none; }
.default-fullscreen-icon.shrink span:nth-child(4) { border: 1.5px solid currentColor; border-right: none; border-bottom: none; }

/* Button hover */
.default-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.4);
  transform: scale(1.1);
}

/* Button pressed */
.default-btn:active {
  transform: scale(0.95);
}

/* Button focus */
.default-btn:focus-visible {
  outline: 2px solid var(--theme-accent);
  outline-offset: 2px;
}

/* Paused state */
.state-paused .default-btn[data-action="pause"] {
  background: rgba(74, 158, 255, 0.3);
  border-color: var(--theme-accent);
}

/* Muted state */
.state-muted .default-btn[data-action="mute"] {
  opacity: 0.5;
}

.state-muted .default-btn[data-action="mute"]:hover {
  opacity: 1;
}

/* ==================== Responsive ==================== */

@media (max-width: 480px) {
  .default-controls {
    bottom: 20px;
    padding: 10px 14px;
    gap: 10px;
  }

  .default-btn {
    width: 40px;
    height: 40px;
  }

  .default-btn-icon {
    font-size: 16px;
  }
}

/* Landscape small screen */
@media (max-height: 400px) and (orientation: landscape) {
  .default-controls {
    bottom: auto;
    left: auto;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    flex-direction: column;
  }
}
