/* ======== VARIÁVEIS DE TEMA ======== */
:root {
  --bg-color: #f9fafb;
  --text-color: #222;
  --accent-color: #1e90ff;
  --card-bg: #fff;
  --shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

/* ======== LAYOUT GERAL ======== */
body {
  font-family: "Segoe UI", Roboto, sans-serif;
  background: var(--bg-color);
  color: var(--text-color);
  margin: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: background 0.3s, color 0.3s;
}

/* ======== CABEÇALHO ======== */
header {
  background: var(--accent-color);
  color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 30px;
  box-shadow: var(--shadow);
}

header h1 {
  margin: 0;
  font-size: 1.6em;
}

.theme-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
}

select,
input[type="color"] {
  border: none;
  border-radius: 6px;
  padding: 6px;
  cursor: pointer;
}

input[id="colorPicker"] {
  width: 100%;
  height: 100px;
  border: none;
  border-radius: 6px;
  padding: 6px;
  cursor: pointer;
}

/* ======== ABAS (NAV) ======== */
.tabs {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 1.0rem;
  margin-top: 1.0rem;
  gap: 10px;
}

/* suportar tanto <button> quanto <a> */
.tabs a,
.tabs button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-color);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 10px 20px;
  font-size: 1rem;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.25s ease;
}

.tabs a:hover,
.tabs button:hover {
  background: color-mix(in srgb, var(--accent-color) 80%, white 20%);
}

.tabs a.active,
.tabs button.active {
  background: #fff;
  color: var(--accent-color);
  border: 2px solid var(--accent-color);
}

/* ======== CONTEÚDO PRINCIPAL ======== */
main {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 30px;
  overflow-y: auto;
}

/* card que agrupa o conteúdo de cada página */
.page-card {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 30px;
  box-shadow: var(--shadow);
  max-width: 700px;
  width: 100%;
  animation: fadeIn 0.3s ease;
}

/* tabs internas (quando houver) */
.tab {
  display: none;
}

.tab.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ======== COMPONENTES ======== */
.big-display {
  font-size: 2.5em;
  margin: 20px 0;
  text-align: center;
}

.controls {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

button {
  background: var(--accent-color);
  color: white;
  border: none;
  padding: 10px 18px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 500;
}

button:hover {
  opacity: 0.9;
  transform: translateY(-2px);
}

input[type="number"],
input[type="time"],
textarea,
select {
  width: 100%;
  padding: 10px;
  margin-top: 8px;
  margin-bottom: 10px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 1em;
  box-sizing: border-box;
}

textarea {
  height: 200px;
  resize: vertical;
}

.calc-buttons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 20px auto;
  max-width: 250px;
}

.calc-buttons button {
  padding: 15px;
  font-size: 1.2em;
}

.counter-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  font-size: 2em;
  margin-bottom: 10px;
}

.small {
  font-size: 0.85em;
  color: gray;
  text-align: center;
}

/* ======== Sub-Abas (internas ao temporizador) ======== */
.subtab {
  display: none;
}
.subtab.active {
  display: block;
}

/* ===== pomodoro ==== */
.pomodoro-section {
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap;
  gap: 20px;
}
.pomodoro-section > div {
  flex: 1;
  min-width: 200px;
  text-align: center;
}

/* ======== TEMA ESCURO ======== */
body.dark {
  --bg-color: #121212;
  --text-color: #eaeaea;
  --accent-color: #4c57f1;
  --card-bg: #1f1f1f;
  --shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
}

/* ======== RESPONSIVIDADE ======== */
@media (max-width: 700px) {
  header {
    flex-direction: column;
    text-align: center;
    gap: 10px;
  }

  .tabs a,
  .tabs button {
    flex: 1 1 50%;
    font-size: 0.9em;
  }

  .page-card {
    padding: 20px;
  }

  main {
    padding: 15px;
  }
}

/* ==== Cronômetro: estilo dos milissegundos ==== */
#stopwatchDisplay {
  font-size: 3em;
  font-weight: bold;
  letter-spacing: 2px;
  color: var(--accent-color, #1e90ff);
}

#stopwatchDisplay small {
  font-size: 0.5em;
  opacity: 0.7;
}
