/* Fonte pixelada Volter */
@font-face {
    font-family: 'Volter';
    src: url('../Volter.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

/* Variáveis de cor e estilo globais */
:root {
    --habbo-blue: #008cff; /* Azul principal do Habbo */
    --habbo-blue-dark: #006bb3; /* Azul escuro */
    --habbo-bg: #80c0ff; /* Fundo da página */
    --habbo-container-bg: #e9f2f8; /* Não usado, mas pode ser para containers */
    --habbo-border: #4d4d4d; /* Cor de borda padrão */
    --habbo-border-light: #a9b9c9; /* Cor de borda clara */
    --habbo-text: #333333; /* Cor do texto */
    --habbo-pixel: 1px; /* Tamanho do pixel para pixel-art */
    --habbo-button-border: #0056b3; /* Borda de botão */
}

/* Centraliza o conteúdo principal na tela e define cor de fundo */
body {
    font-family: 'Volter', Arial, sans-serif; /* Fonte pixelada */
    background-color: var(--habbo-bg); /* Fundo azul claro */
    margin: 0;
    padding: 0;
    color: var(--habbo-text); /* Cor do texto padrão */
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center; /* Centraliza verticalmente */
}

/* Fundo animado de moedas */
#coin-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
    z-index: -1; /* Fica atrás de todo o conteúdo */
}
/* Cada moeda animada */
.falling-item {
    position: absolute;
    width: 23px;
    height: 18px;
    background-size: 100% 100%; 
    image-rendering: pixelated;
    background-repeat: no-repeat;
    opacity: 0.7;
    animation: fall linear infinite;
}
/* Animação de queda das moedas */
@keyframes fall {
    to {
        transform: translateY(105vh);
    }
}
/* Fim do fundo animado */

/* Utilitário para borda pixelada (não usado diretamente, mas pode ser aplicado em elementos) */
.pixel-border {
    border: 4px solid #222;
    border-radius: 0;
    box-shadow:
        0 0 0 2px #fff,
        4px 4px 0 0 #222,
        8px 8px 0 0 #888;
    background-clip: padding-box;
}

/* Container principal da página */
.container {
    max-width: 800px;
    width: 90%;
    background: #fff; /* Fundo branco para destacar resultados */
    border: 2px solid #222; /* Borda preta fina */
    border-radius: 0; /* Sem arredondamento */
    box-shadow: 2px 2px 0 0 #ccc; /* Sombra leve para efeito pixel */
    padding: 24px 18px 24px 18px;
    font-family: 'Volter', Arial, sans-serif;
    position: relative;
}

/* Títulos principais e subtítulos */
h1, h2, h3 {
    font-family: 'Volter', Arial, sans-serif;
    color: #222;
    text-shadow: none; /* Remove sombra do texto */
    border: none;
    margin-top: 0;
    margin-bottom: 10px;
    letter-spacing: 1px;
    text-align: center; /* Centraliza o texto */
}
h1 {
    font-size: 32px;
    margin-bottom: 18px;
}
h2 {
    font-size: 22px;
}
h3 {
    font-size: 18px;
}

/* Inputs, selects e botões com estilo pixel-art */
input, select {
    font-family: 'Volter', Arial, sans-serif;
    font-size: 16px;
    border: 3px solid #222;
    border-radius: 0;
    background: #fff;
    color: #222;
    outline: none;
    padding: 8px 10px;
    margin: 0;
    transition: box-shadow 0.1s;
    height: 44px; /* Altura consistente para todos os campos */
    box-sizing: border-box;
}
input[type="text"] {
    flex: 1;
    min-width: 120px;
}

/* Botões padrão e pixelados - verde Habbo, sem degradê, sem sombra, sem maiúsculo, sem borda arredondada */
button, .pixel-btn {
    font-family: 'Volter', Arial, sans-serif;
    font-size: 16px;
    font-weight: bold;
    color: #fff;
    background: #00813e;
    border: 2px solid #8eda55;
    border-radius: 0;
    box-shadow: none;
    padding: 12px 24px;
    cursor: pointer;
    margin: 0 6px 8px 0;
    text-shadow: none;
    text-transform: none;
    transition: box-shadow 0.1s, background 0.1s, filter 0.1s;
    outline: none;
    display: inline-block;
    min-width: 110px;
    height: auto;
    line-height: 1.2;
    text-align: center;
}
button:hover, .pixel-btn:hover {
    background: #13b94a;
    border-color: #b6f7a5;
    filter: brightness(1.08);
    box-shadow: none;
}
button:active, .pixel-btn:active {
    background: #005e2e;
    border-color: #8eda55;
    filter: brightness(0.95);
    box-shadow: none;
}

/* Formulário de busca centralizado e responsivo */
.search-form {
    display: flex;
    gap: 10px;
    margin-bottom: 18px;
    flex-wrap: wrap;
    align-items: stretch; /* Alinha todos os campos e botão na mesma altura */
    justify-content: center;
}

/* Lista de itens encontrados (resultados de busca) */
.item-list {
    list-style: none;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    justify-content: center;
}
/* Cada item da lista de resultados */
.item-list li {
    background: #fff; /* Fundo branco */
    border: 2px solid #222;
    border-radius: 0;
    box-shadow: 2px 2px 0 0 #ccc;
    text-align: center;
    width: 150px;
    transition: box-shadow 0.1s, transform 0.1s;
    padding: 8px 0 12px 0;
}
/* Efeito ao passar o mouse no item */
.item-list li:hover {
    box-shadow: 2px 2px 0 0 #008cff;
    transform: translateY(-2px);
}
/* Link do item */
.item-list a {
    text-decoration: none;
    color: #222;
    font-weight: bold;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0;
    height: 100%;
    box-sizing: border-box;
}
/* Imagem do item de resultado */
.item-list img {
    width: 80px; /* Imagem maior */
    height: 80px;
    object-fit: contain;
    image-rendering: pixelated;
    margin-bottom: 5px;
    border: none; /* Sem borda preta */
    border-radius: 0;
    background: #fff;
    box-shadow: none;
}
/* Nome do item (resultado de busca) - menos negrito, mais hierarquia */
.item-list span {
    display: block;
    margin-top: 5px;
    font-family: 'Volter', Arial, sans-serif;
    font-size: 14px;
    line-height: 1.2;
    padding: 0 5px;
    font-weight: normal;
    color: #222;
    letter-spacing: 0.5px;
}

/* Detalhes do item selecionado */
.item {
    text-align: center;
    margin-top: 20px;
    padding: 18px 12px 18px 12px;
    background: #fff; /* Fundo branco */
    border: 2px solid #222;
    border-radius: 0;
    box-shadow: 2px 2px 0 0 #ccc;
}
/* Imagem do item detalhado */
.item img {
    image-rendering: pixelated;
    border: none; /* Sem borda preta */
    border-radius: 0;
    background: #fff;
    box-shadow: none;
}
/* Título do item detalhado */
.item h2 {
    font-size: 20px;
    font-weight: bold;
    color: #00813e;
    margin: 10px 0 8px 0;
    letter-spacing: 1px;
}
/* Bloco de detalhes do item */
.item-details {
    text-align: left;
    margin-top: 15px;
    border-top: 1px dashed #b38b00;
    padding-top: 15px;
    font-size: 16px;
}
.item-details p {
    margin: 5px 0;
    font-size: 14px;
    font-weight: normal;
    color: #333;
}
.item-details strong {
    color: #00813e;
    font-weight: bold;
    letter-spacing: 0.5px;
}

/* Mensagem de erro */
.error {
    color: #fff;
    text-align: center;
    margin-top: 15px;
    padding: 12px 8px;
    background: #ff5e5e;
    border: 2px solid #b32a2a;
    border-radius: 0;
    box-shadow: 2px 2px 0 0 #b32a2a;
    font-weight: bold;
    font-family: 'Volter', Arial, sans-serif;
    text-shadow: none;
}

/* Gráfico de preços/vendas */
canvas {
    margin-top: 20px;
    max-width: 100%;
    border: 2px solid #222;
    border-radius: 0;
    background: #fff;
    box-shadow: 2px 2px 0 0 #ccc;
}

/* Opções de detalhes (troca de período) */
.details-options {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
}

/* Botões de voltar (voltar aos resultados/início) */
.back-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 18px;
}
button, .pixel-btn {
    font-family: 'Volter', Arial, sans-serif;
    font-size: 16px;
    font-weight: bold;
    color: #fff;
    background: #00813e;
    border: 2px solid #8eda55;
    border-radius: 0;
    box-shadow: none;
    padding: 12px 24px;
    cursor: pointer;
    margin: 0 6px 8px 0;
    text-shadow: none;
    text-transform: none;
    transition: box-shadow 0.1s, background 0.1s, filter 0.1s;
    outline: none;
    display: inline-block;
    min-width: 110px;
    height: auto;
    line-height: 1.2;
    text-align: center;
}
button:hover, .pixel-btn:hover {
    background: #13b94a;
    border-color: #b6f7a5;
    filter: brightness(1.08);
    box-shadow: none;
}
button:active, .pixel-btn:active {
    background: #005e2e;
    border-color: #8eda55;
    filter: brightness(0.95);
    box-shadow: none;
}

/* Mensagem para gráfico de um ponto só */
.single-point-message {
    text-align: center;
    color: #555;
    margin: 10px 0;
    font-style: italic;
    font-family: 'Volter', Arial, sans-serif;
    background: #fff;
    border: 1px solid #b38b00;
    border-radius: 0;
    box-shadow: 1px 1px 0 #b38b00;
    padding: 8px 0;
}

/* Loader spinner pixel-art (indicador de carregamento AJAX) */
/* Novo loader: quadrado girando pixelado */
.loader {
  display: inline-block;
  width: 32px;
  height: 32px;
  border: 0;
  background: #008cff;
  position: relative;
  animation: loader-spin 1s linear infinite;
  margin: 0 auto;
}
.loader::before, .loader::after {
  content: "";
  position: absolute;
  background: #fff;
  display: block;
}
.loader::before {
  width: 18px;
  height: 6px;
  left: 7px;
  top: 0;
  border-radius: 2px;
}
.loader::after {
  width: 6px;
  height: 18px;
  left: 0;
  top: 7px;
  border-radius: 2px;
}
@keyframes loader-spin {
  0% { transform: rotate(0deg);}
  100% { transform: rotate(360deg);}
}

/* Seta pixelada para o select (compatível com Chrome) */
select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23008cff' stroke-width='2' fill='none' fill-rule='evenodd'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 16px 12px;
    padding-right: 28px;
}

/* Responsividade para mobile */
@media (max-width: 600px) {
    .container {
        margin: 10px;
        padding: 10px;
    }
    h1 {
        font-size: 22px;
    }
    .search-form {
        flex-direction: column;
    }
    .search-form button, .pixel-btn {
        width: 100%;
    }
    .item-list {
        flex-direction: column;
        align-items: center;
    }
    .item-list li {
        width: 100%;
        max-width: 250px;
    }
    .details-options {
        flex-direction: column;
        align-items: center;
    }
    .back-buttons {
        flex-direction: column;
        align-items: center;
    }
}

/* Centraliza o container apenas quando não há resultados nem erro (tela inicial) */
body.initial .container {
    margin-top: 0;
    margin-bottom: 0;
    align-self: center;
}
/* Centraliza o container apenas quando não há resultados nem erro (tela inicial) */
body.initial .container {
    margin-top: 0;
    margin-bottom: 0;
    align-self: center;
}
