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

body {
    background: #f0f2f5;
    font-family: 'Segoe UI', sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100vh; /* Ocupa 100% da altura da janela */
    margin: 0;
    padding: 20px 20px 0 20px; /* Padding no topo e laterais */
    overflow: hidden; /* Impede a página inteira de rolar */
}

/* Estilo do Loader */
#loading-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center; justify-content: center;
    z-index: 9999;
}

.spinner {
    width: 50px; height: 50px;
    border: 5px solid #f3f3f3; border-top: 5px solid #1a73e8;
    border-radius: 50%; animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

.content-hidden { display: none !important; }

/* Estilos do App */
.container {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
    width: 100%;
    max-width: 450px;
}

h2 {
    text-align: center;
    color: #1a73e8;
    margin-top: 0;
}

input {
    width: 100%; padding: 12px;
    margin: 10px 0;
    border: 2px solid #dfe1e5;
    border-radius: 8px;
    font-size: 16px;
    outline: none;
    box-sizing: border-box; 
}

#resultado { 
    margin-top: 20px;
    font-weight: bold;
    padding: 15px;
    border-radius: 8px;
    display: none;
    text-align: center;
}

.antiga {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.atual {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.erro {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.historico-titulo {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 10px;
    padding: 10px 0;      /* Espaçamento interno */
    background: #f0f2f5;  /* MESMA COR DO FUNDO DO BODY para camuflar */
    position: sticky;     /* O segredo para ficar fixo */
    top: 0;               /* Gruda no topo do container */
    z-index: 10;          /* Fica acima dos itens que rolam */
    width: 100%;
}

.historico-container {
    margin-top: 25px;
    width: 100%;
    max-width: 450px;
    flex: 1;
    overflow-y: auto;
    padding-right: 10px;
    margin-bottom: 80px;
}

#btnLimpar {
    font-family: 'Courier New', Courier, monospace;
    text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.655);
    float: right;
    background-color: #ff4d4d;
    color: white;
    border: none;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
    transition: background 300ms;
}

#btnLimpar:hover {
    background: #cc0000;
}

/* Deixa a barra de rolagem mais fina e moderna */
.historico-container::-webkit-scrollbar {
    width: 6px;
}

.historico-container::-webkit-scrollbar-thumb {
    background: #bcc0c4;
    border-radius: 10px;
}

.historico-item {
    background: white;
    padding: 10px;
    margin-bottom: 8px;
    border-radius: 6px;
    border-left: 5px solid #ccc;
    font-size: 13px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.item-antiga {
    border-left-color: #fbbc04;
}

.item-atual {
    border-left-color: #34a853;
}

#main-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    height: calc(100vh - 80px); /* Desconta o espaço do topo e do footer */
    overflow: hidden; /* Mantém o controle do scroll interno */
}

.site-footer {
    position: fixed; /* Fixa o elemento na tela */
    bottom: 0;       /* Alinha no limite inferior */
    left: 0;         /* Alinha no limite esquerdo */
    width: 100%;     /* Ocupa toda a largura */
    background-color: #f8f9fa;
    color: #6c757d;
    padding: 15px 0;
    text-align: center;
    border-top: 1px solid #dee2e6;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 0.9rem;
    z-index: 1000;   /* Garante que fique acima de outros elementos */
}

.footer-content p {
    margin: 0;
    padding-bottom: 5px;
}

.footer-links a {
    color: #007bff;
    text-decoration: none;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: #0056b3;
    text-decoration: underline;
}

.separator {
    margin: 0 10px;
    color: #ced4da;
}