/* ===== VARIÁVEIS DE TEMA ===== */
:root {
    /* Tema Verde (padrão) */
    --primary-color: #25D366;
    --primary-dark: #128C7E;
    --primary-light: #4AE584;
    --accent-color: #25D366;
    --primary-color-rgb: 37, 211, 102;
}

/* Temas de cores */
[data-theme="green"] {
    --primary-color: #25D366;
    --primary-dark: #128C7E;
    --primary-light: #4AE584;
    --accent-color: #25D366;
    --primary-color-rgb: 37, 211, 102;
}

[data-theme="purple"] {
    --primary-color: #8B5CF6;
    --primary-dark: #6D28D9;
    --primary-light: #A78BFA;
    --accent-color: #8B5CF6;
    --primary-color-rgb: 139, 92, 246;
}

[data-theme="pink"] {
    --primary-color: #FF1493;
    --primary-dark: #C71585;
    --primary-light: #FF69B4;
    --accent-color: #FF1493;
    --primary-color-rgb: 255, 20, 147;
}

[data-theme="orange"] {
    --primary-color: #FF8C00;
    --primary-dark: #FF4500;
    --primary-light: #FFA500;
    --accent-color: #FF8C00;
    --primary-color-rgb: 255, 140, 0;
}

[data-theme="blue"] {
    --primary-color: #00BFFF;
    --primary-dark: #1E90FF;
    --primary-light: #87CEEB;
    --accent-color: #00BFFF;
    --primary-color-rgb: 0, 191, 255;
}

/* ===== ESTILOS BASE ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: #232323;
  font-family: 'Roboto', sans-serif;
  color: #FFFFFF;
  min-height: 100vh;
}

h1, h2 {
  font-family: 'Pathway Gothic One', sans-serif;
  color: #FFFFFF;
}

h1 {
  font-size: 45px;
  line-height: 55px;
  margin-bottom: 10px;
}

h2 {
  font-size: 35px;
  line-height: 45px;
  margin-bottom: 20px;
}

p, label, li {
  font-family: 'Roboto', sans-serif;
  color: #FFFFFF;
}

p, li {
  font-size: 16px;
  line-height: 26px;
  margin-bottom: 15px;
}

.first-content {
  margin: 0 auto;
  max-width: 800px;
  padding: 20px;
}

.title-content {
  text-align: center;
  margin: 40px 0;
}

/* ===== PREDEFINIÇÕES ===== */
.config-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  margin: 40px 0;
}

.presets-section {
  margin: 0; /* Remove margin anterior */
}

.presets-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
  margin-bottom: 0; /* Remove margin anterior */
}

.custom-section {
  margin: 0; /* Remove margin anterior */
  background: #2a2a2a;
  padding: 30px;
  border-radius: 15px;
  height: fit-content;
}

.preset-btn {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  border: none;
  border-radius: 15px;
  padding: 20px 15px;
  color: white;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-height: 120px;
}

.preset-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(var(--primary-color-rgb), 0.3);
}

.preset-btn:active {
  transform: translateY(0);
}

.preset-btn i {
  font-size: 24px;
}

.preset-btn span {
  font-weight: 600;
  font-size: 14px;
}

.preset-btn small {
  font-size: 12px;
  opacity: 0.8;
}

/* ===== SELETOR DE TEMA DROPDOWN ===== */
.theme-section {
  margin: 30px 0;
  text-align: center;
}

.theme-dropdown-container {
  display: flex;
  justify-content: center;
  position: relative;
}

.theme-dropdown {
  background: #2a2a2a;
  border: 2px solid var(--primary-color);
  border-radius: 12px;
  padding: 12px 45px 12px 20px;
  color: #FFFFFF;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 200px;
  text-align: left;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}

.theme-dropdown:hover {
  background-color: #333333; /* Apenas muda a cor de fundo */
  border-color: var(--primary-light);
}

.theme-dropdown:focus {
  outline: none;
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(var(--primary-color-rgb), 0.2);
}

/* Estilização das opções do dropdown */
.theme-dropdown option {
  background: #2a2a2a;
  color: #FFFFFF;
  padding: 12px 20px;
  font-size: 16px;
  font-weight: 500;
  border: none;
}

.theme-dropdown option:hover {
  background: var(--primary-color);
  color: #FFFFFF;
}

.theme-dropdown option:checked {
  background: var(--primary-color);
  color: #FFFFFF;
}

/* Para navegadores WebKit (Chrome, Safari, etc.) */
.theme-dropdown option:checked {
  background: var(--primary-color) !important;
  color: #FFFFFF !important;
}

/* Para Firefox - ícone também fixo */
@-moz-document url-prefix() {
  .theme-dropdown {
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23FFFFFF' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
  }
  
  .theme-dropdown option {
    background: #2a2a2a;
    color: #FFFFFF;
  }
  
  .theme-dropdown option:hover {
    background: var(--primary-color);
  }
}

/* Estilo alternativo para melhor compatibilidade */
.theme-dropdown-wrapper {
  position: relative;
  display: inline-block;
}

.theme-dropdown-wrapper::after {
  content: '';
  position: absolute;
  top: 50%;
  right: 15px;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 6px solid #FFFFFF;
  pointer-events: none;
  transition: all 0.3s ease;
}

.theme-dropdown:focus + .theme-dropdown-wrapper::after {
  border-top-color: var(--primary-light);
}


/* ===== DICA DE ATALHO DE TECLADO ===== */
.keyboard-hint {
  margin-top: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #CCCCCC;
  font-size: 14px;
}

.keyboard-hint i {
  color: var(--primary-color);
}

kbd {
  background: #404040;
  border: 1px solid #666666;
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 12px;
  font-weight: 600;
  color: #FFFFFF;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* ===== SEÇÃO DE TEMAS ===== */
.theme-section {
  margin: 40px 0;
}

.theme-selector {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
  justify-content: center;
}

.theme-btn {
  background: #2a2a2a;
  border: 2px solid #404040;
  border-radius: 12px;
  padding: 15px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 80px;
}

.theme-btn:hover {
  border-color: #666;
  transform: translateY(-2px);
}

.theme-btn.active {
  border-color: var(--primary-color);
  background: rgba(var(--primary-color-rgb), 0.1);
}

.theme-color {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  margin-bottom: 5px;
}

.theme-btn span {
  color: #FFFFFF;
  font-size: 12px;
  font-weight: 500;
}

/* ===== TIMER DISPLAY ===== */
.timer-section {
  margin: 50px 0;
  text-align: center;
}

.timer-container {
  position: relative;
  display: inline-block;
  margin-bottom: 30px;
}

.timer-circle {
  transform: rotate(-90deg);
}

.timer-bg-circle {
  fill: none;
  stroke: #404040;
  stroke-width: 8;
}

.timer-progress-circle {
  fill: none;
  stroke: var(--primary-color);
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 879.646;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 1s linear;
}

.timer-display {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

.time-display {
  font-size: 48px;
  font-weight: 700;
  color: #FFFFFF;
  margin-bottom: 5px;
  font-family: 'Pathway Gothic One', sans-serif;
}

.timer-label {
  font-size: 16px;
  color: var(--primary-color);
  font-weight: 500;
}

.timer-controls {
  display: flex;
  justify-content: center;
  gap: 20px;
}

.control-btn {
  background: var(--primary-color);
  border: none;
  border-radius: 50%;
  width: 60px;
  height: 60px;
  color: white;
  cursor: pointer;
  font-size: 20px;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.control-btn:hover {
  background: var(--primary-dark);
  transform: scale(1.1);
}

.control-btn:active {
  transform: scale(0.95);
}

/* ===== CONFIGURAÇÃO PERSONALIZADA ===== */
.custom-section {
  margin: 50px 0;
  background: #2a2a2a;
  padding: 30px;
  border-radius: 15px;
}

.custom-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  align-items: end;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group label {
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 500;
}

.form-group input,
.form-group select {
  padding: 12px;
  border: 2px solid #404040;
  border-radius: 8px;
  background: #232323;
  color: #FFFFFF;
  font-size: 16px;
  transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary-color);
}

.custom-btn {
  background: var(--primary-color);
  border: none;
  border-radius: 8px;
  padding: 12px 24px;
  color: white;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  transition: all 0.3s ease;
  grid-column: 1 / -1;
  justify-self: center;
  max-width: 200px;
}

.custom-btn:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
}

/* ===== HISTÓRICO ===== */
.history-section {
  margin: 50px 0;
  background: #2a2a2a;
  padding: 30px;
  border-radius: 15px;
}

.history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.clear-history-btn {
  background: #FF6B6B;
  border: none;
  border-radius: 8px;
  padding: 8px 12px;
  color: white;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 5px;
}

.clear-history-btn:hover {
  background: #FF5252;
  transform: translateY(-1px);
}

.clear-history-btn:active {
  transform: translateY(0);
}

.history-stats {
  display: flex;
  justify-content: center;
  gap: 40px;
  margin-bottom: 30px;
}

.stat-item {
  text-align: center;
}

.stat-number {
  display: block;
  font-size: 32px;
  font-weight: 700;
  color: var(--primary-color);
  font-family: 'Pathway Gothic One', sans-serif;
}

.stat-label {
  font-size: 14px;
  color: #CCCCCC;
}

.history-list {
  max-height: 200px;
  overflow-y: auto;
}

.history-item {
  background: #232323;
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.history-item:last-child {
  margin-bottom: 0;
}

.history-name {
  font-weight: 600;
  color: var(--primary-color);
}

.history-duration {
  color: #CCCCCC;
  font-size: 14px;
}

.history-date {
  color: #888888;
  font-size: 12px;
}

.no-history {
  text-align: center;
  color: #888888;
  font-style: italic;
}

/* ===== ESTADOS DO TIMER ===== */
.timer-running .timer-progress-circle {
  stroke: var(--primary-color);
}

.timer-paused .timer-progress-circle {
  stroke: #FFA500;
}

.timer-finished .timer-progress-circle {
  stroke: #FF6B6B;
  animation: pulse 1s infinite;
}

.timer-stopwatch .timer-progress-circle {
  stroke: var(--primary-color);
  stroke-dasharray: none;
  stroke-dashoffset: 0;
  opacity: 0.3;
}

.timer-stopwatch.timer-running .timer-progress-circle {
  opacity: 1;
  animation: pulse-stopwatch 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@keyframes pulse-stopwatch {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* ===== NOTIFICAÇÃO ===== */
.notification {
  position: fixed;
  top: 20px;
  right: 20px;
  background: var(--primary-color);
  color: white;
  padding: 15px 20px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  z-index: 1000;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* ===== RESPONSIVIDADE ===== */
@media (max-width: 768px) {
  .first-content {
    padding: 15px;
  }
  
  h1 {
    font-size: 35px;
    line-height: 45px;
  }
  
  h2 {
    font-size: 28px;
    line-height: 35px;
  }

   .config-section {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .presets-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .theme-dropdown {
    min-width: 180px;
    font-size: 14px;
    padding: 10px 40px 10px 15px;
    background-size: 14px;
    background-position: right 12px center;
  }
  
  .theme-dropdown option {
    font-size: 14px;
    padding: 10px 15px;
  }
  
  .keyboard-hint {
    font-size: 12px;
  }
  
  .keyboard-hint span {
    text-align: center;
  }
  
  .preset-btn {
    min-height: 100px;
    padding: 15px 10px;
  }
  
  .timer-circle {
    width: 250px;
    height: 250px;
  }
  
  .timer-bg-circle,
  .timer-progress-circle {
    r: 115;
    cx: 125;
    cy: 125;
  }
  
  .time-display {
    font-size: 36px;
  }
  
  .custom-form {
    grid-template-columns: 1fr;
  }
  
  .history-stats {
    gap: 20px;
  }
  
  .stat-number {
    font-size: 24px;
  }
  
  .theme-selector {
    gap: 10px;
  }
  
  .theme-btn {
    min-width: 70px;
    padding: 12px;
  }
  
  .theme-color {
    width: 35px;
    height: 35px;
  }
}

@media (max-width: 480px) {
  .presets-grid {
    grid-template-columns: 1fr;
  }
  
  .theme-dropdown {
    min-width: 160px;
    padding: 10px 35px 10px 15px;
    background-size: 12px;
    background-position: right 10px center;
  }
  
  .theme-dropdown option {
    font-size: 14px;
    padding: 8px 15px;
  }
  
  .keyboard-hint {
    flex-direction: column;
    gap: 5px;
  }
  
  .timer-circle {
    width: 200px;
    height: 200px;
  }
  
  .timer-bg-circle,
  .timer-progress-circle {
    r: 90;
    cx: 100;
    cy: 100;
  }
  
  .time-display {
    font-size: 28px;
  }
  
  .history-stats {
    flex-direction: column;
    gap: 15px;
  }
  
  .history-header {
    flex-direction: column;
    gap: 10px;
    align-items: flex-start;
  }
  
  .clear-history-btn {
    align-self: flex-end;
  }
  
  .theme-selector {
    justify-content: space-between;
  }
  
  .theme-btn {
    flex: 1;
    min-width: 60px;
  }
}