/* Variáveis de cores */
:root {
  --primary-color: #3498db;
  --primary-dark: #2980b9;
  --secondary-color: #2c3e50;
  --accent-color: #e74c3c;
  --light-bg: #f8f9fa;
  --dark-bg: #343a40;
  --text-color: #333;
  --light-text: #f8f9fa;
  --border-color: #dee2e6;
  --success-color: #28a745;
  --warning-color: #ffc107;
  --info-color: #17a2b8;
  --card-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  --hover-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

body {
  font-family: 'Roboto', sans-serif;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  min-height: 100vh;
}

/* Header styles */
.masthead {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  padding: 3rem 0;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.navbar {
  background-color: var(--dark-bg) !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Main Section Styles */
main {
  padding: 4rem 0;
  min-height: calc(100vh - 300px);
}

.main-container {
  background: white;
  border-radius: 20px;
  box-shadow: var(--card-shadow);
  padding: 3rem;
  margin: 2rem 0;
  position: relative;
  overflow: hidden;
}

.main-container::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 5px;
  background: linear-gradient(90deg, var(--primary-color), var(--accent-color), var(--success-color), var(--warning-color));
}

.main-title {
  color: var(--secondary-color);
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  position: relative;
}

.main-title::after {
  content: "";
  position: absolute;
  bottom: -10px;
  left: 0;
  width: 60px;
  height: 4px;
  background: var(--primary-color);
  border-radius: 2px;
}

.lead-text {
  font-size: 1.2rem;
  color: #6c757d;
  margin-bottom: 3rem;
  line-height: 1.8;
}

/* Menu de Calculadoras */
#menu {
  margin: 2rem 0;
}

#menu ul {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

#menu li {
  transform: translateY(0);
  transition: all 0.3s ease;
}

#menu a {
  display: block;
  padding: 2rem;
  background: white;
  border-radius: 15px;
  box-shadow: var(--card-shadow);
  text-decoration: none;
  color: var(--text-color);
  font-weight: 600;
  font-size: 1.1rem;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
  border-left: 5px solid transparent;
}

#menu a::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, transparent 0%, rgba(52, 152, 219, 0.05) 100%);
  opacity: 0;
  transition: all 0.3s ease;
}

#menu a:hover {
  transform: translateY(-5px);
  box-shadow: var(--hover-shadow);
  text-decoration: none;
  color: var(--primary-dark);
}

#menu a:hover::before {
  opacity: 1;
}

/* Cores específicas para cada calculadora */
#menu a.bin {
  border-left-color: var(--primary-color);
}

#menu a.bin::after {
  content: "01010101";
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 0.8rem;
  color: var(--primary-color);
  opacity: 0.3;
}

#menu a.hex {
  border-left-color: var(--success-color);
}

#menu a.hex::after {
  content: "#FF00AA";
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 0.8rem;
  color: var(--success-color);
  opacity: 0.3;
}

#menu a.oct {
  border-left-color: var(--warning-color);
}

#menu a.oct::after {
  content: "777";
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 0.8rem;
  color: var(--warning-color);
  opacity: 0.3;
}

#menu a.com {
  border-left-color: var(--accent-color);
}

#menu a.com::after {
  content: "~101";
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 0.8rem;
  color: var(--accent-color);
  opacity: 0.3;
}

/* Área da calculadora */
#calculadora {
  background: white;
  border-radius: 15px;
  padding: 2rem;
  margin: 2rem 0;
  box-shadow: var(--card-shadow);
  text-align: left;
  min-height: 200px;
  transition: all 0.3s ease;
  border: none;
}

#calculadora h2 {
  color: var(--secondary-color);
  margin-bottom: 1.5rem;
  font-size: 1.8rem;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 0.5rem;
}

#calculadora p {
  color: #6c757d;
  margin-bottom: 2rem;
}

/* Estilos para os formulários */
#calculadora form {
  background: var(--light-bg);
  padding: 1.5rem;
  border-radius: 10px;
  margin-bottom: 1.5rem;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

#calculadora label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--secondary-color);
}

#calculadora input[type="text"] {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 5px;
  font-size: 1rem;
  margin-bottom: 1rem;
  transition: border-color 0.3s;
}

#calculadora input[type="text"]:focus {
  border-color: var(--primary-color);
  outline: none;
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

#calculadora button {
  background: var(--primary-color);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 5px;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s;
}

#calculadora button:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
}

/* Estilos para os resultados */
#calculadora>div[id*="result"] {
  background: white;
  border-left: 4px solid var(--primary-color);
  padding: 1rem;
  margin: 1rem 0;
  border-radius: 0 5px 5px 0;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
  transition: all 0.3s;
}

/* Estilos específicos para a calculadora de complementos */
#comresult1,
#comresult2,
#comresult3,
#comresult4,
#comresult5,
#comresult6,
#comresult7 {
  background: #f8f9fa;
  padding: 1rem;
  margin: 0.5rem 0;
  border-radius: 5px;
  border-left: 4px solid var(--accent-color);
  font-family: monospace;
  font-size: 0.95rem;
}

/* Layout organizado para complementos */
.complement-results {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-top: 1.5rem;
}

/* Nota informativa */
.info-note {
  background: linear-gradient(135deg, #e3f2fd 0%, #f3e5f5 100%);
  border-radius: 15px;
  padding: 2rem;
  margin-top: 3rem;
  border-left: 5px solid var(--info-color);
  position: relative;
}

.info-note::before {
  content: "💡";
  position: absolute;
  top: 1rem;
  left: 1rem;
  font-size: 1.5rem;
}

.info-note p {
  margin: 0;
  margin-left: 2.5rem;
  color: var(--text-color);
  line-height: 1.6;
}

/* Footer */
footer {
  background-color: var(--secondary-color) !important;
  color: white !important;
  margin-top: 4rem;
}

/* Responsividade */
@media (max-width: 768px) {
  .main-container {
    margin: 1rem;
    padding: 2rem;
    border-radius: 15px;
  }

  .main-title {
    font-size: 2rem;
  }

  #menu ul {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  #menu a {
    padding: 1.5rem;
    text-align: center;
  }

  #menu a::after {
    position: static;
    display: block;
    margin-top: 0.5rem;
    opacity: 0.6;
  }

  #calculadora {
    padding: 1.5rem;
  }

  #calculadora form {
    padding: 1rem;
  }
}

@media (max-width: 576px) {
  main {
    padding: 2rem 0;
  }

  .main-container {
    padding: 1.5rem;
  }

  .main-title {
    font-size: 1.8rem;
  }

  .lead-text {
    font-size: 1.1rem;
  }
}