* {
  box-sizing: border-box;
  font-family: 'Poppins', sans-serif;
}

/* ===== BODY ===== */
body {
  font-family: 'Poppins', sans-serif;
  background: #f4f4f4;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.4s ease, color 0.4s ease;
}

.app-subtitle {
  font-size: 20px;
  margin-top: -6px;
  margin-bottom: 18px;
  letter-spacing: 0.4px;
  font-weight: 400;
  color: #555;        
}


body.dark .app-subtitle {
  color: #ddd;       
}


/* ===== CONTAINER ===== */
.container {
  background: white;
  padding: 30px;
  border-radius: 12px;
  text-align: center;
  box-shadow: 0 10px 25px rgba(0,0,0,0.1);

  width: 500px;
  height: 700px;

  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.container > * {
  flex-shrink: 0;
}

/* ===== TEXTOS ===== */
h1 {
  margin: 0 0 15px 0;
  font-size: 40px;
}

#timer {
  font-family: 'Poppins', sans-serif;
  font-size: 130px;
  font-weight: 600;
  letter-spacing: 2px;
  height: 160px;

  display: flex;
  align-items: center;
  justify-content: center;
}

/* ===== BOTONES GENERALES ===== */
button {
  cursor: pointer;
  border: none;
  border-radius: 6px;
  transition: background 0.3s ease, transform 0.2s ease;
}

button:hover {
  transform: scale(1.05);
}

/* ===== BOTÓN TEMA ===== */
.theme-btn {
  font-size: 24px;
  padding: 10px 14px;
  border-radius: 10px;
  background: #333;
  color: white;
}

/* ===== CONTROLES CENTRALES ===== */
.buttons {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin: 20px 0;
}

#toggle-timer,
#reset-timer,
#settings-btn {
  width: 55px;
  height: 55px;
  padding: 0;

  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 15px;
  color: white;
  font-size: 24px;
}

/* Play / Pause */
#toggle-timer {
  background: #4CAF50;
}

#toggle-timer.running {
  background: #F44336;
}

/* Reset */
#reset-timer {
  background: #2196F3;
}

#reset-timer svg {
  width: 22px;
  height: 22px;
}

/* Animación reset */
#reset-timer.rotate {
  animation: spin 0.4s linear;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Settings */
#settings-btn {
  background: #555;
}

/* ===== PARTE INFERIOR ===== */
#mode {
  font-weight: bold;
  margin: 10px 0;
  font-size: 20px;
  text-align: center;
  align-self: center;


  transition:
  opacity 0.3s ease,
  transform 0.3s ease;

}

/* Estado animado */
#mode.animate {
  opacity: 0;
  transform: translateY(-6px);
}

.presets {
  margin-top: auto;
}

.preset-btn {
  background: #ddd;
  padding: 10px 18px;
  border-radius: 10px;
  margin: 6px;
  font-size: 15px;
}

/* ===== MODO OSCURO ===== */
body.dark {
  background: #121212;
}

body.dark .container {
  background: #1e1e1e;
  color: white;
}

body.dark button:not(.theme-btn) {
  background: #333;
  color: white;
}

body.dark .theme-btn {
  background: white;
  color: #121212;
}

/* ===== MODAL ===== */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);

  display: flex;
  align-items: center;
  justify-content: center;

  z-index: 1000;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: #1e1e1e;
  color: white;
  padding: 24px;
  border-radius: 12px;
  width: 280px;
  text-align: center;
}

.modal-content input {
  width: 100%;
  padding: 18px;
  margin: 10px 2px;
  border-radius: 8px;
  border: none;
}

.modal-actions {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.modal-actions button {
  font-size: 14px;      /* texto más grande */
  padding: 10px 16px;   /* botón más cómodo */
  border-radius: 8px;
}

#modal-minutes {
  font-size: 20px;       /* mismo tamaño siempre */
  padding: 12px 14px;
  font-weight: 500;
}

#modal-minutes::placeholder {
  font-size: inherit;    /* 🔑 mismo tamaño que el texto */
  font-weight: inherit;
  opacity: 0.6;          /* opcional: estilo placeholder */
}

/* Reset desactivado */
.reset-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Giro único del SVG al resetear */
@keyframes spinOnce {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Solo gira el SVG una vez */
.reset-btn.spin-once svg {
  animation: spinOnce 0.6s ease-in-out;
}

/* Contenedor central de botones + modo */
.center-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

/* ===== ANIMACIÓN MODAL ===== */

/* Estado base (cerrado) */
.modal {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

/* Modal visible */
.modal:not(.hidden) {
  opacity: 1;
  pointer-events: auto;
}

/* Contenido del modal */
.modal-content {
  transform: translateY(-10px) scale(0.95);
  opacity: 0;

  transition:
    transform 0.25s ease,
    opacity 0.25s ease;
}

/* Cuando el modal está abierto */
.modal:not(.hidden) .modal-content {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.feedback-btn {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);

  padding: 10px 20px;
  font-size: 18px;
  border-radius: 8px;

  background: #333;
  color: white;
  border: none;
  cursor: pointer;

  opacity: 0.85;
}

.feedback-btn:hover {
  opacity: 1;
  transform: translateX(-50%) scale(1.05);
}

#feedback-text {
  width: 100%;
  font-size: 16px;
  padding: 10px;
  border-radius: 8px;
  resize: none;
}

/* ===== ANIMACIÓN ENVÍO FEEDBACK ===== */

.modal.sending .modal-content {
  animation: sendFeedback 0.5s ease forwards;
}

@keyframes sendFeedback {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  60% {
    transform: scale(1.05);
    opacity: 1;
  }
  100% {
    transform: scale(0.95);
    opacity: 0;
  }
}