/* PALETA MESTRE (MODO CLARO) */
:root {
    --bg-main: #f4f7f6;
    --bg-panel: #ffffff;
    --text-primary: #333333;
    --text-secondary: #666666;
    --accent: #00d2ff;
    --accent-hover: #00b8e6;
    --border: #dddddd;
}

/* PALETA MESTRE (MODO ESCURO) */
body.dark-mode {
    --bg-main: #121212;
    --bg-panel: #1e1e1e;
    --text-primary: #ffffff;
    --text-secondary: #aaaaaa;
    --accent: #00d2ff;
    --accent-hover: #00b8e6;
    --border: #333333;
}

/* REGRAS GERAIS E RESPONSIVIDADE */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    transition: background-color 0.3s, color 0.3s;
    
    /* Flexbox para o Footer grudar no chão */
    display: flex;
    flex-direction: column;
}

.hidden { display: none !important; }

/* TELA DE BUSCA (search.html) */
.search-wrapper {
    max-width: 800px;
    margin: 40px auto; /* Reduzi a margem superior para caber melhor no mobile */
    padding: 20px;
    text-align: center;
    flex: 1 0 auto; /* Faz o wrapper crescer e empurrar o footer para baixo */
    width: 100%; /* Garante que não ultrapasse a tela */
    box-sizing: border-box; /* Garante que o padding não adicione largura extra */
}

.search-bar {
    display: flex;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 50px;
    padding: 5px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.search-bar input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 15px 20px;
    font-size: 16px;
    color: var(--text-primary);
    outline: none;
    min-width: 0; /* Previne input de quebrar layout em telas pequenas */
}

.search-bar button {
    background-color: var(--accent);
    color: #000;
    border: none;
    border-radius: 50px;
    padding: 0 25px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
    white-space: nowrap; /* Impede o botão de quebrar em duas linhas */
}

.search-bar button:hover { background-color: var(--accent-hover); }

/* FOOTER / AVISO LEGAL */
.site-footer {
    padding: 20px;
    border-top: 1px solid var(--border);
    text-align: center;
    font-size: 0.85em;
    color: var(--text-secondary);
    background-color: var(--bg-main);
    flex-shrink: 0; /* Impede que o footer encolha */
}

/* === ESTILOS DO MODAL === */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.8); backdrop-filter: blur(5px);
    display: flex; justify-content: center; align-items: center; z-index: 999;
}

.modal-content {
    background: var(--bg-panel); border: 1px solid var(--border);
    padding: 30px; border-radius: 12px; width: 90%; max-width: 400px;
    text-align: center; box-shadow: 0 10px 30px rgba(0,210,255,0.2);
    box-sizing: border-box; /* Previne que o modal vaze a tela no mobile */
}

/* TELA DE LOGIN/REGISTRO (Mantido para auth-page) */
body.auth-page {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    flex-direction: column;
}

.auth-container {
    background: var(--bg-panel);
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
    width: 90%; /* Ajuste Mobile */
    max-width: 400px;
    text-align: center;
    box-sizing: border-box;
}

/* === MEDIA QUERIES (RESPONSIVO MOBILE) === */
@media (max-width: 600px) {
    .top-navbar { flex-direction: column; gap: 15px; text-align: center; }
    .search-wrapper h1 { font-size: 2em !important; }
    .search-bar { flex-direction: column; border-radius: 15px; padding: 10px; gap: 10px; }
    .search-bar input, .search-bar button { border-radius: 10px; padding: 15px; width: 100%; box-sizing: border-box; }
    .tip-btn { display: block; width: 100%; margin: 10px 0; }
}