/* ==========================================================
   styles.css — Tela Principal
   Sistema de Relógio e Temporizador
   ========================================================== */

/* --- Reset e base ---------------------------------------- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Inter", sans-serif;
  background: #000000;
  color: #ffffff;
  min-height: 100vh;
  overflow: hidden;
}

/* ==========================================================
   MENU HAMBÚRGUER
   ========================================================== */
.menu-toggle {
  position: fixed;
  top: 30px;
  right: 30px;
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px;
  z-index: 1100;
  transition: all 0.3s ease;
}

.hamburger-line {
  width: 30px;
  height: 3px;
  background: #ffffff;
  border-radius: 2px;
  transition: all 0.3s ease;
  display: block;
}

/* Animação do ×  quando aberto */
.menu-toggle.active .hamburger-line:nth-child(1) {
  transform: rotate(45deg) translate(8px, 8px);
}
.menu-toggle.active .hamburger-line:nth-child(2) {
  opacity: 0;
}
.menu-toggle.active .hamburger-line:nth-child(3) {
  transform: rotate(-45deg) translate(8px, -8px);
}

/* Overlay que fecha o menu ao clicar fora */
.menu-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1050;
}
.menu-overlay.visible {
  display: block;
}

/* ==========================================================
   DROPDOWN DE MENU
   ========================================================== */
.menu-dropdown {
  position: fixed;
  top: 80px;
  right: 30px;
  background: rgba(20, 20, 20, 0.97);
  backdrop-filter: blur(20px);
  border: 1px solid #333;
  border-radius: 12px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 210px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.8);
  z-index: 1060;
}

.menu-dropdown.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Botões de navegação do menu */
.menu-btn {
  background: transparent;
  border: 2px solid #333;
  color: #fff;
  padding: 12px 20px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: "Inter", sans-serif;
  font-weight: 500;
  text-align: left;
  width: 100%;
  font-size: 14px;
}
.menu-btn:hover {
  border-color: #666;
  background: rgba(255, 255, 255, 0.05);
}
.menu-btn.active {
  background: #ffffff;
  border-color: #ffffff;
  color: #000;
}

/* Botão de abrir controle remoto */
.remote-btn {
  background: #333;
  border: 2px solid #333;
  color: #fff;
  padding: 12px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-family: "Inter", sans-serif;
  font-weight: 600;
  transition: all 0.3s ease;
  width: 100%;
  font-size: 14px;
  text-align: left;
}
.remote-btn:hover {
  background: #444;
  border-color: #444;
}

/* Separador visual */
.menu-separator {
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
  margin: 4px 0;
}

/* ==========================================================
   PERSONALIZAÇÃO — BOTÕES DE COR
   ========================================================== */
.config-menu-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.config-menu-title,
.config-label {
  font-size: 0.75rem;
  color: #888;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.color-options {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.text-color-btn {
  width: 32px;
  height: 32px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}
.text-color-btn:hover {
  transform: scale(1.1);
  border-color: rgba(255, 255, 255, 0.5);
}
.text-color-btn.active {
  border-color: #fff;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.4);
}

/* ==========================================================
   PRESETS NO MENU
   ========================================================== */
.preset-menu-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.preset-menu-title {
  font-size: 0.75rem;
  color: #888;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.preset-menu-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #fff;
  padding: 10px 16px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.25s ease;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: "Inter", sans-serif;
  width: 100%;
  font-size: 13px;
}
.preset-menu-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}
.preset-menu-btn:active {
  transform: translateY(0);
  background: rgba(255, 255, 255, 0.12);
}

.preset-menu-name { font-weight: 500; }
.preset-menu-time { color: #aaa; font-size: 11px; }

/* ==========================================================
   CONTAINER E SEÇÕES PRINCIPAIS
   ========================================================== */
.main-container {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 40px;
}

.section {
  display: none;
  width: 100%;
  max-width: 1200px;
}
.section.active {
  display: block;
}

/* ==========================================================
   DISPLAY DE TEMPO (RELÓGIO E TEMPORIZADOR)
   ========================================================== */
.time-display,
.timer-display {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 120px;
  width: 100%;
}

.time-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.time-number {
  font-size: clamp(4rem, 12vw, 12rem);
  font-weight: 900;
  color: #ffffff;
  line-height: 0.9;
  margin-bottom: 20px;
  font-family: "Inter", sans-serif;
  letter-spacing: -0.02em;
  transition: color 0.3s ease;
}

.time-label {
  font-size: clamp(0.8rem, 1.5vw, 1.2rem);
  color: #ffffff;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* ==========================================================
   TEMPORIZADOR — STATUS E CONTAINER
   ========================================================== */
.timer-container {
  text-align: center;
}

.timer-display {
  margin-bottom: 60px;
}

.timer-status-display {
  position: fixed;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1rem;
  color: #555;
  font-weight: 400;
  white-space: nowrap;
  pointer-events: none;
  letter-spacing: 0.05em;
  transition: color 0.3s ease;
}

/* Status coloridos conforme o estado */
.timer-status-display.running { color: #4caf50; }
.timer-status-display.paused  { color: #ffc107; }
.timer-status-display.done    { color: #f44336; }

/* ==========================================================
   LABEL "TEMPO EXCEDIDO" — contagem negativa
   ========================================================== */
.timer-overtime-label {
  position: fixed;
  bottom: 68px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.1rem;
  font-weight: 300;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #ff4444;
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
  transition: opacity 0.4s ease;
}

.timer-overtime-label.visible {
  opacity: 1;
}

/* ==========================================================
   CORES DO TEXTO DO RELÓGIO
   ========================================================== */
.text-white  { color: #ffffff !important; }
.text-yellow { color: #ffff00 !important; }
.text-cyan   { color: #00ffff !important; }
.text-lime   { color: #00ff00 !important; }
.text-orange { color: #ffa500 !important; }

/* ==========================================================
   EFEITO DE PISCAR — TEMPO ESGOTADO
   ========================================================== */
@keyframes flashRed {
  0%, 100% { color: #ffffff !important; text-shadow: none !important; }
  50%       { color: #ff0000 !important; text-shadow: 0 0 30px #ff0000 !important; }
}

.flashing-red {
  animation: flashRed 0.5s ease-in-out infinite;
}

/* ==========================================================
   TOAST DE FEEDBACK
   ========================================================== */
.toast {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(40, 40, 40, 0.96);
  color: #fff;
  padding: 12px 24px;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 500;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  pointer-events: none;
  z-index: 2000;
  max-width: 90vw;
  text-align: center;
  white-space: nowrap;
}
.toast.show {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}
.toast.error { border-color: rgba(244, 67, 54, 0.5); color: #ff8a80; }
.toast.warn  { border-color: rgba(255, 193, 7, 0.5);  color: #ffd740; }
.toast.ok    { border-color: rgba(76, 175, 80, 0.5);  color: #b9f6ca; }

/* ==========================================================
   RESPONSIVIDADE
   ========================================================== */
@media (max-width: 1200px) {
  .time-display,
  .timer-display { gap: 80px; }
}

@media (max-width: 900px) {
  .time-display,
  .timer-display { gap: 50px; }
}

@media (max-width: 768px) {
  .main-container { padding: 0 20px; }

  .menu-toggle {
    top: 16px;
    right: 16px;
  }
  .menu-dropdown {
    right: 16px;
    top: 66px;
    min-width: 190px;
  }

  .time-display,
  .timer-display {
    flex-direction: column;
    gap: 30px;
  }
}

@media (max-width: 480px) {
  .time-label { font-size: 0.8rem; }

  .menu-dropdown {
    right: 8px;
    left: 8px;
    min-width: unset;
  }
}

/* Evita que o menu ultrapasse a tela em dispositivos pequenos */
@media (max-height: 600px) {
  .menu-dropdown {
    max-height: calc(100vh - 80px);
    overflow-y: auto;
  }
}

/* ==========================================================
   MODAL DE CONFIRMAÇÃO CUSTOMIZADO
   ========================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9000;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.22s ease, visibility 0.22s;
}
.modal-overlay.show {
  opacity: 1;
  visibility: visible;
}

.modal-box {
  background: #141414;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 36px 30px 28px;
  width: 100%;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.9);
  transform: scale(0.93) translateY(10px);
  transition: transform 0.24s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.modal-overlay.show .modal-box {
  transform: scale(1) translateY(0);
}

.modal-icon {
  font-size: 2.8rem;
  line-height: 1;
}

.modal-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #ffffff;
  text-align: center;
  line-height: 1.3;
}

.modal-message {
  font-size: 0.88rem;
  color: #888;
  text-align: center;
  line-height: 1.55;
}

.modal-actions {
  display: flex;
  gap: 12px;
  width: 100%;
  margin-top: 8px;
}

.modal-btn {
  flex: 1;
  padding: 14px 12px;
  border: none;
  border-radius: 12px;
  font-family: "Inter", sans-serif;
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
  transition: filter 0.15s ease, transform 0.12s ease;
  user-select: none;
}
.modal-btn:hover  { filter: brightness(1.12); }
.modal-btn:active { transform: scale(0.97); }

.modal-btn-cancel {
  background: rgba(255, 255, 255, 0.07);
  color: #aaa;
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.modal-btn-cancel:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }

.modal-btn-confirm {
  background: #c62828;
  color: #fff;
}
.modal-btn-confirm.ok {
  background: #2e7d32;
}
