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

body {
  font-family: 'Montserrat', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 50%, #1a1a1a 100%);
  color: #ffffff;
  margin: 0;
  padding: 0 20px 40px 20px;
  max-width: 960px;
  margin-left: auto;
  margin-right: auto;
  user-select: none;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* Efeito de partículas/ruído sutil no fundo */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    radial-gradient(circle at 20% 80%, rgba(255, 107, 53, 0.03) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(50, 205, 50, 0.03) 0%, transparent 50%),
    radial-gradient(circle at 40% 40%, rgba(255, 215, 0, 0.02) 0%, transparent 50%);
  pointer-events: none;
  z-index: -1;
}

header {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 30px 0 40px 0;
  gap: 20px;
  padding: 20px;
  background: rgba(45, 45, 45, 0.3);
  border-radius: 20px;
  border: 1px solid rgba(255, 107, 53, 0.2);
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
}

header::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 107, 53, 0.1), transparent);
  animation: shimmer 3s infinite;
}

@keyframes shimmer {
  0% { left: -100%; }
  100% { left: 100%; }
}

header img {
  height: 70px;
  width: 70px;
  object-fit: contain;
  user-select: none;
  filter: drop-shadow(0 4px 8px rgba(255, 107, 53, 0.3));
  transition: transform 0.3s ease;
}

header img:hover {
  transform: scale(1.1) rotate(5deg);
}

header h1 {
  font-weight: 800;
  font-size: 2.5rem;
  background: linear-gradient(135deg, #ff6b35 0%, #32cd32 50%, #ffd700 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: none;
  user-select: text;
  letter-spacing: -0.5px;
  position: relative;
}

header h1::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 3px;
  background: linear-gradient(90deg, #ff6b35, #32cd32, #ffd700);
  border-radius: 2px;
  opacity: 0.8;
}

section h2 {
  font-weight: 700;
  font-size: 1.8rem;
  background: linear-gradient(135deg, #ff6b35 0%, #32cd32 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  padding-bottom: 8px;
  margin-top: 40px;
  user-select: text;
  position: relative;
  letter-spacing: -0.3px;
}

section h2::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, #ff6b35, #32cd32);
  border-radius: 2px;
  box-shadow: 0 2px 8px rgba(255, 107, 53, 0.4);
}


/* Espaçamento entre as seções de treino */
section {
  margin-bottom: 40px;
}

section:last-child {
  margin-bottom: 20px;
}

table {
  border-collapse: collapse;
  width: 100%;
  margin-top: 15px;
  background: rgba(45, 45, 45, 0.6);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 
    0 12px 24px rgba(0, 0, 0, 0.4),
    0 4px 8px rgba(255, 107, 53, 0.1);
  user-select: none;
  border: 1px solid rgba(255, 107, 53, 0.2);
  backdrop-filter: blur(10px);
  position: relative;
}

table::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 107, 53, 0.5), transparent);
}

th, td {
  border: 1px solid rgba(255, 107, 53, 0.2);
  padding: 12px 16px;
  text-align: center;
  font-weight: 600;
  min-width: 50px;
  word-break: break-word;
  transition: all 0.3s ease;
}

/* Alinhar primeira coluna (Exercícios) à esquerda */
td:first-child {
  text-align: left;
  font-weight: 500;
}

th {
  background: linear-gradient(135deg, #ff6b35 0%, #32cd32 100%);
  color: #ffffff;
  font-size: 1rem;
  font-weight: 700;
  user-select: text;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  position: relative;
}

th::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: rgba(255, 255, 255, 0.3);
}

td[contenteditable="true"] {
  background: rgba(45, 45, 45, 0.4);
  color: #ffffff;
  cursor: text;
  font-weight: 500;
  transition: all 0.3s ease;
  position: relative;
}

td[contenteditable="true"]:hover {
  background: rgba(255, 107, 53, 0.1);
  transform: translateY(-1px);
}

td[contenteditable="true"]:focus {
  outline: 2px solid #ff6b35;
  background: rgba(255, 107, 53, 0.15);
  box-shadow: inset 0 0 0 1px rgba(255, 107, 53, 0.3);
  transform: translateY(-1px);
}

button {
  padding: 10px 20px;
  background: linear-gradient(135deg, #ff6b35 0%, #32cd32 100%);
  border: none;
  border-radius: 12px;
  font-weight: 700;
  color: #ffffff;
  cursor: pointer;
  box-shadow: 
    0 4px 12px rgba(255, 107, 53, 0.3),
    0 2px 4px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
  user-select: none;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.9rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  position: relative;
  overflow: hidden;
}

button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s ease;
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 
    0 8px 20px rgba(255, 107, 53, 0.4),
    0 4px 8px rgba(0, 0, 0, 0.3);
}

button:hover::before {
  left: 100%;
}

button:active {
  transform: translateY(0);
  box-shadow: 
    0 2px 8px rgba(255, 107, 53, 0.3),
    inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Botões de reset individuais */
button[id^="btnReset"] {
  background: linear-gradient(135deg, #d0021b 0%, #ff1744 100%);
  color: white;
  font-size: 0.8rem;
  padding: 6px 14px;
  border-radius: 8px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

button[id^="btnReset"]:hover {
  background: linear-gradient(135deg, #a0021b 0%, #d50000 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(208, 2, 27, 0.4);
}


/* Estilos da Seção IMC */
#imcSection {
  margin: 40px 0;
  padding: 30px;
  background: rgba(45, 45, 45, 0.4);
  border-radius: 20px;
  border: 1px solid rgba(255, 107, 53, 0.3);
  box-shadow: 
    0 12px 32px rgba(0, 0, 0, 0.4),
    0 4px 8px rgba(255, 107, 53, 0.1);
  backdrop-filter: blur(15px);
  position: relative;
  overflow: hidden;
}

#imcSection::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, #ff6b35, #32cd32, #ffd700);
}

.imc-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  margin-top: 20px;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.imc-form, .imc-result {
  background: rgba(45, 45, 45, 0.6);
  padding: 25px;
  border-radius: 16px;
  border: 1px solid rgba(255, 107, 53, 0.2);
  box-shadow: 
    0 8px 24px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  transition: transform 0.3s ease;
}

.imc-form:hover, .imc-result:hover {
  transform: translateY(-2px);
  box-shadow: 
    0 12px 32px rgba(0, 0, 0, 0.4),
    0 4px 8px rgba(255, 107, 53, 0.2);
}

.imc-form h3, .imc-result h3 {
  color: #ffffff;
  margin-top: 0;
  margin-bottom: 20px;
  font-size: 1.4rem;
  font-weight: 700;
  background: linear-gradient(135deg, #ff6b35 0%, #32cd32 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.form-group {
  margin-bottom: 15px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  color: #ffffff;
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.form-group input {
  width: calc(100% - 20px);
  padding: 12px 16px;
  border: 2px solid rgba(255, 107, 53, 0.3);
  border-radius: 12px;
  background: rgba(45, 45, 45, 0.8);
  color: #ffffff;
  font-size: 1rem;
  font-family: 'Montserrat', sans-serif;
  transition: all 0.3s ease;
  backdrop-filter: blur(5px);
}

.form-group input:focus {
  outline: none;
  border-color: #ff6b35;
  background: rgba(45, 45, 45, 0.9);
  box-shadow: 
    0 0 0 3px rgba(255, 107, 53, 0.2),
    0 4px 12px rgba(255, 107, 53, 0.3);
  transform: translateY(-1px);
}

.form-group input::placeholder {
  color: rgba(255, 255, 255, 0.5);
  font-style: italic;
}

#btnCalcularIMC {
  width: calc(100% - 20px);
  padding: 12px;
  font-size: 1.1rem;
  margin-top: 10px;
}

.imc-value {
  font-size: 2.5rem;
  font-weight: bold;
  text-align: center;
  margin: 15px 0;
  padding: 15px;
  border-radius: 8px;
  background: linear-gradient(135deg, #f2cc8f, #bb9457);
  color: #2f2b23;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

.imc-classification {
  text-align: center;
  font-size: 1.2rem;
  font-weight: 600;
  margin: 15px 0;
  padding: 10px;
  border-radius: 6px;
}

.imc-classification.abaixo-peso {
  background: #4a90e2;
  color: white;
}

.imc-classification.normal {
  background: #7ed321;
  color: white;
}

.imc-classification.sobrepeso {
  background: #f5a623;
  color: white;
}

.imc-classification.obesidade-1 {
  background: #d0021b;
  color: white;
}

.imc-classification.obesidade-2 {
  background: #9013fe;
  color: white;
}

.imc-classification.obesidade-3 {
  background: #000000;
  color: white;
}

.imc-recommendations {
  margin-top: 15px;
  padding: 15px;
  background: rgba(47, 43, 35, 0.7);
  border-radius: 6px;
  border-left: 4px solid #f2cc8f;
}

.imc-recommendations h4 {
  color: #f2cc8f;
  margin-top: 0;
  margin-bottom: 10px;
}

.imc-recommendations ul {
  margin: 0;
  padding-left: 20px;
}

.imc-recommendations li {
  margin-bottom: 8px;
  color: #f4f1de;
}

.imc-history {
  margin-top: 30px;
  padding: 20px;
  background: rgba(60, 56, 47, 0.9);
  border-radius: 8px;
  border: 1px solid #bb9457;
}

.imc-history h3 {
  color: #f2cc8f;
  margin-top: 0;
  margin-bottom: 20px;
}

.chart-container {
  margin: 25px 0;
  text-align: center;
  background: rgba(45, 45, 45, 0.6);
  padding: 25px;
  border-radius: 20px;
  border: 1px solid rgba(255, 107, 53, 0.3);
  box-shadow: 
    0 12px 32px rgba(0, 0, 0, 0.4),
    0 4px 8px rgba(255, 107, 53, 0.1);
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(15px);
}

.chart-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, 
    rgba(255, 107, 53, 0.03) 0%, 
    rgba(50, 205, 50, 0.03) 50%, 
    rgba(255, 215, 0, 0.03) 100%);
  pointer-events: none;
}

#imcChart {
  max-width: 100%;
  height: auto;
  background: transparent;
  border-radius: 12px;
  box-shadow: inset 0 0 20px rgba(255, 107, 53, 0.1);
  transition: all 0.3s ease;
  border: 1px solid rgba(255, 107, 53, 0.2);
}

#imcChart:hover {
  transform: scale(1.02);
  box-shadow: 
    inset 0 0 20px rgba(255, 107, 53, 0.2),
    0 8px 24px rgba(255, 107, 53, 0.2);
}

.chart-container h4 {
  color: #ffffff;
  margin-bottom: 20px;
  font-size: 1.2rem;
  font-weight: 700;
  background: linear-gradient(135deg, #ff6b35 0%, #32cd32 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: none;
}

.history-table {
  margin: 20px 0;
}

.history-table table {
  width: 100%;
  margin-top: 10px;
}

.history-table th {
  background: #f2cc8f;
  color: #2f2b23;
  font-size: 0.9rem;
  padding: 8px;
}

.history-table td {
  padding: 8px;
  font-size: 0.9rem;
  text-align: center;
}

.history-table tr:nth-child(even) {
  background: rgba(47, 43, 35, 0.5);
}

#btnLimparHistorico {
  background: #d0021b;
  color: white;
  margin-top: 15px;
}

#btnLimparHistorico:hover {
  background: #a0021b;
}

@media (max-width: 700px) {
  body {
    padding: 15px;
  }
  
  header {
    padding: 15px;
    margin: 20px 0 30px 0;
  }
  
  header h1 {
    font-size: 1.8rem;
  }
  
  header img {
    height: 50px;
    width: 50px;
  }
  
  table, th, td {
    font-size: 0.8rem;
  }
  
  th, td {
    padding: 6px 8px;
  }
  
  /* Ajustar alinhamento da primeira coluna em mobile */
  td:first-child {
    font-size: 0.75rem;
    padding: 6px 8px;
  }
  
  /* Ajustar cabeçalho da tabela em mobile */
  th {
    font-size: 0.75rem;
    padding: 6px 4px;
  }
  
  /* Melhorar legibilidade dos botões em mobile */
  .btnConcluir {
    font-size: 0.7rem;
    padding: 4px 8px;
  }
  
  button {
    padding: 8px 16px;
    font-size: 0.85rem;
  }
  
  .imc-container {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .imc-value {
    font-size: 2rem;
  }
  
  .imc-form, .imc-result {
    padding: 20px;
  }
  
  .chart-container {
    padding: 20px;
    margin: 20px 0;
  }
  
  .chart-container::before {
    background: linear-gradient(45deg, 
      rgba(255, 107, 53, 0.02) 0%, 
      rgba(50, 205, 50, 0.02) 50%, 
      rgba(255, 215, 0, 0.02) 100%);
  }
  
  #imcChart {
    width: 100%;
    height: 200px;
  }
  
  .history-table table {
    font-size: 0.8rem;
  }
  
  .history-table th,
  .history-table td {
    padding: 6px 4px;
  }
  
  /* Responsividade para botões de reset */
  button[id^="btnReset"] {
    font-size: 0.75rem;
    padding: 5px 10px;
  }
  
  /* Ajustar container do cabeçalho dos treinos em mobile */
  div[style*="justify-content: space-between"] {
    flex-direction: column !important;
    gap: 15px;
    align-items: center !important;
  }
  
  /* Reduzir espaçamento entre seções em mobile */
  section {
    margin-bottom: 30px;
  }
  
  section:last-child {
    margin-bottom: 20px;
  }
  
  /* Ajustar seção IMC em mobile */
  #imcSection {
    padding: 20px;
    margin: 30px 0;
  }
  
}
