/* ===== RESET & BASE ===== */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700;900&family=Outfit:wght@400;600;700;800;900&display=swap");

:root {
  --primary-dark: #135390;
  --primary: #1e7cc4;
  --primary-light: #5bb7e8;
  --primary-lighter: #8cd4f5;
  --accent: #20a0ed;
  --bg: #f7fafd;
  --text-dark: #0d2e4d;
  --timer-stroke: #5bb7e8;
  --timer-fill: rgba(91, 183, 232, 0.08);
  --danger: #e74c3c;
  --danger-light: #ff6b6b;
  --grid-color: rgba(91, 183, 232, 0.08);
  --grid-line: rgba(91, 183, 232, 0.15);
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: "Inter", "Outfit", sans-serif;
  background: var(--bg);
}

/* ===== MAIN CONTAINER ===== */
.overlay {
  position: relative;
  width: 1920px;
  height: 1080px;
  background: var(--bg);
  overflow: hidden;
  margin: 0 auto;
}

/* ===== GRID BACKGROUND ===== */
.overlay::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 60px 60px;
  opacity: 0.5;
  z-index: 0;
}

/* Subtle diagonal lines overlay */
.overlay::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 80px,
    rgba(91, 183, 232, 0.02) 80px,
    rgba(91, 183, 232, 0.02) 82px
  );
  z-index: 0;
}

/* ===== CORNER DECORATIONS ===== */
.corner {
  position: absolute;
  z-index: 1;
  pointer-events: none;
}

.corner--top-left {
  top: -40px;
  left: -80px;
  width: 650px;
  height: auto;
}

.corner--bottom-right {
  bottom: -40px;
  right: -80px;
  width: 650px;
  height: auto;
  transform: rotate(180deg);
}

/* ===== LOGO ===== */
.logo-container {
  position: absolute;
  top: 40px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  text-align: center;
}

.logo-container img {
  width: 580px;
  height: auto;
  filter: drop-shadow(0 2px 8px rgba(19, 83, 144, 0.1));
}

/* ===== TIMER DISPLAY ===== */
.timer-container {
  position: absolute;
  top: 54%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  text-align: center;
}

.d-none {
  display: none;
}

.timer-display {
  font-family: "Outfit", "Inter", sans-serif;
  font-size: 420px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 12px;
  color: var(--timer-fill);
  -webkit-text-stroke: 9px var(--timer-stroke);
  paint-order: stroke fill;
  text-shadow:
    0 0 60px rgba(91, 183, 232, 0.12),
    0 0 120px rgba(91, 183, 232, 0.04);
  user-select: none;
  transition:
    color 0.3s ease,
    -webkit-text-stroke-color 0.3s ease,
    text-shadow 0.3s ease;
}

/* Warning state — last 60 seconds */
.timer-display.warning {
  -webkit-text-stroke-color: #f0a030;
  text-shadow:
    0 0 40px rgba(240, 160, 48, 0.2),
    0 0 80px rgba(240, 160, 48, 0.08);
}

/* Danger state — last 10 seconds */
.timer-display.danger {
  -webkit-text-stroke-color: var(--danger);
  text-shadow:
    0 0 40px rgba(231, 76, 60, 0.25),
    0 0 80px rgba(231, 76, 60, 0.1);
}

/* Pulse animation for last 10 sec */
.timer-display.pulse {
  animation: timerPulse 1s ease-in-out infinite;
}

@keyframes timerPulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.03);
    opacity: 0.85;
  }
}

/* Finished */
.timer-display.finished {
  -webkit-text-stroke-color: var(--danger);
  animation: timerFinished 0.5s ease-in-out infinite;
}

@keyframes timerFinished {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.3;
  }
}

/* ===== STATUS INDICATOR ===== */
.status-bar {
  position: absolute;
  bottom: 60px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 10px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.status-bar.visible {
  opacity: 1;
}

.status-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #4ade80;
  animation: statusBlink 1.5s ease-in-out infinite;
}

.status-dot.paused {
  background: #fbbf24;
  animation: none;
}

.status-dot.stopped {
  background: #94a3b8;
  animation: none;
}

@keyframes statusBlink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.4;
  }
}

.status-text {
  font-size: 18px;
  font-weight: 600;
  color: var(--primary);
  letter-spacing: 2px;
  text-transform: uppercase;
}

/* ===== CONTROL PANEL ===== */
.control-panel {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(13, 46, 77, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(91, 183, 232, 0.3);
  padding: 20px 40px;
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}

.control-panel.visible {
  transform: translateY(0);
}

/* Toggle button */
.control-toggle {
  position: fixed;
  bottom: 10px;
  right: 20px;
  z-index: 101;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid rgba(91, 183, 232, 0.3);
  background: rgba(13, 46, 77, 0.8);
  backdrop-filter: blur(10px);
  color: white;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  opacity: 0.4;
}

.control-toggle:hover {
  opacity: 1;
  background: rgba(13, 46, 77, 0.95);
  transform: scale(1.05);
}

.control-panel.visible ~ .control-toggle {
  bottom: calc(100px);
  opacity: 1;
}

/* Input group */
.input-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.input-group label {
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.input-group input {
  width: 70px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid rgba(91, 183, 232, 0.3);
  background: rgba(255, 255, 255, 0.08);
  color: white;
  font-size: 18px;
  font-weight: 700;
  font-family: "Outfit", monospace;
  text-align: center;
  outline: none;
  transition: all 0.2s;
}

.input-group input:focus {
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 0 0 3px rgba(32, 160, 237, 0.2);
}

.separator {
  color: rgba(255, 255, 255, 0.7);
  font-size: 24px;
  font-weight: 700;
  margin: 0 2px;
}

/* Buttons */
.btn {
  padding: 10px 28px;
  border-radius: 10px;
  border: none;
  font-size: 14px;
  font-weight: 700;
  font-family: "Inter", sans-serif;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  cursor: pointer;
  transition: all 0.25s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn:active {
  transform: scale(0.96);
}

.btn-start {
  background: linear-gradient(135deg, #4ade80, #22c55e);
  color: #052e16;
  box-shadow: 0 4px 15px rgba(74, 222, 128, 0.3);
}

.btn-start:hover {
  box-shadow: 0 6px 20px rgba(74, 222, 128, 0.45);
  transform: translateY(-1px);
}

.btn-pause {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: #451a03;
  box-shadow: 0 4px 15px rgba(251, 191, 36, 0.3);
}

.btn-pause:hover {
  box-shadow: 0 6px 20px rgba(251, 191, 36, 0.45);
  transform: translateY(-1px);
}

.btn-reset {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-reset:hover {
  background: rgba(255, 255, 255, 0.18);
  color: white;
}

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

/* Divider */
.control-divider {
  width: 1px;
  height: 36px;
  background: rgba(255, 255, 255, 0.15);
  margin: 0 12px;
}

/* Shortcut hints */
.shortcuts {
  display: flex;
  gap: 16px;
  align-items: center;
}

.shortcut {
  display: flex;
  align-items: center;
  gap: 6px;
  color: rgba(255, 255, 255, 0.45);
  font-size: 12px;
}

.shortcut kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 22px;
  padding: 0 6px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.7);
  font-size: 11px;
  font-family: "Inter", monospace;
  font-weight: 600;
}

/* Volume control */
.volume-control {
  display: flex;
  align-items: center;
  gap: 8px;
}

.volume-control label {
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.volume-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100px;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.15);
  outline: none;
  cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: 2px solid white;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.volume-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: 2px solid white;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}
