* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-family: 'Inter', sans-serif;
    scroll-behavior: smooth;
}

body {
    background-color: #f8f9fa;
    padding: 1rem;
    transition: background-color 0.3s;
}

body.dark-mode {
    background-color: #121212;
    color: #e0e0e0;
}

header {
    text-align: center;
    margin-bottom: 2rem;
}

header h1 {
    font-size: 2rem;
    color: #003366;
}

.container {
    max-width: 800px;
    margin: auto;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    transition: background-color 0.3s;
}

body.dark-mode .container {
    background: #1e1e1e;
}

label {
    font-weight: 600;
}

input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 1rem;
    margin-top: 0.25rem;
}

button {
    background-color: #28a745;
    color: white;
    border: none;
    padding: 0.75rem;
    font-size: 1rem;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

button:hover {
    background-color: #218838;
}

.resultado {
    background-color: #e9f7ef;
    padding: 1rem;
    border: 1px solid #28a745;
    border-radius: 6px;
    display: none;
    transition: 0.3s ease;
}

@media (min-width: 768px) {
    .grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    }
}

.grafico {
    margin-top: 2rem;
}

/* Melhorias para o botão do modo escuro em telas mobile */
.switch {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 10;
}

.switch label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.9);
    padding: 0.5rem 0.75rem;
    border-radius: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    white-space: nowrap;
}

.switch label:hover {
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

body.dark-mode .switch label {
    background: rgba(30, 30, 30, 0.9);
    color: #e0e0e0;
}

body.dark-mode .switch label:hover {
    background: rgba(30, 30, 30, 1);
}

.switch input[type="checkbox"] {
    width: auto;
    margin: 0;
    margin-top: 0;
}

/* Responsividade para tablets */
@media (max-width: 768px) {
    .switch {
        position: fixed;
        top: 0.75rem;
        right: 0.75rem;
    }
    
    .switch label {
        font-size: 0.8rem;
        padding: 0.4rem 0.6rem;
        border-radius: 16px;
    }
}

/* Responsividade para smartphones */
@media (max-width: 480px) {
    .switch {
        position: fixed;
        top: 0.5rem;
        right: 0.5rem;
    }
    
    .switch label {
        font-size: 0.75rem;
        padding: 0.3rem 0.5rem;
        border-radius: 12px;
        gap: 0.3rem;
    }
    
    /* Ajustar o header para não sobrepor com o botão */
    header {
        margin-top: 3rem;
        padding-top: 0.5rem;
    }
}

/* Para telas muito pequenas */
@media (max-width: 360px) {
    .switch {
        top: 0.25rem;
        right: 0.25rem;
    }
    
    .switch label {
        font-size: 0.7rem;
        padding: 0.25rem 0.4rem;
        border-radius: 10px;
        gap: 0.25rem;
    }
    
    header {
        margin-top: 3.5rem;
    }
    
    header h1 {
        font-size: 1.5rem;
    }
}

/* Versão ainda mais compacta para telas extra pequenas */
@media (max-width: 320px) {
    .switch label {
        font-size: 0.65rem;
        padding: 0.2rem 0.3rem;
        border-radius: 8px;
    }
    
    /* Opção alternativa: apenas ícone em telas muito pequenas */
    .switch label span {
        display: none;
    }
    
    .switch label::after {
        content: "🌙";
        font-size: 1rem;
    }
    
    body.dark-mode .switch label::after {
        content: "☀️";
    }
}

footer{
  background-color: #218838;
  text-align: center;
  font-size:large;
  color: #e9f7ef;
  padding: 10px;
}

footer>p>a{
  text-decoration: none;
  color: #003366;
}

footer>p>a:hover{
  padding: 5px;
  border-radius: 10p;
  background-color: #1c7030af;
  transition: 0.3s;
}