/* seu_projeto/assets/css/style.css */

/* ==========================================================================
   1. Reset Básico e Padrões Globais
   ========================================================================== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px; /* Base para REMs, facilita responsividade de fontes */
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased; /* Melhora renderização de fontes */
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
    line-height: 1.65;
    color: #343a40; /* Um pouco mais escuro que #333 para melhor contraste */
    background-color: #f8f9fa; /* Fundo um pouco mais suave */
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-x: hidden; /* Prevenir scroll horizontal acidental */
}

img,
video,
canvas,
svg {
    max-width: 100%;
    height: auto;
    display: block; /* Remove espaço extra abaixo de imagens inline */
}

a {
    color: #007bff;
    text-decoration: none;
    transition: color 0.2s ease-in-out;
}

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

/* Para acessibilidade */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

.skip-link {
    position: absolute;
    top: -100px; /* Escondido inicialmente */
    left: 10px;
    background: #007bff;
    color: white;
    padding: 10px 15px;
    z-index: 100000;
    text-decoration: none;
    border-radius: 0 0 5px 5px;
    transition: top 0.3s ease-in-out;
    font-weight: 500;
}
.skip-link:focus {
    top: 0;
}

/* ==========================================================================
   2. Layout Principal (Containers, Header, Main, Footer)
   ========================================================================== */

/* --- Containers --- */
.container,
.container-wide {
    width: 90%; /* Mais espaço nas laterais em telas menores */
    margin-left: auto;
    margin-right: auto;
    padding-left: 15px;
    padding-right: 15px;
    box-sizing: border-box;
}

.container {
    max-width: 1140px; /* Padrão Bootstrap LG, bom para conteúdo geral */
}

.container-wide {
    max-width: 1600px; /* Para páginas que precisam de mais largura */
}

/* --- Cabeçalho --- */
.site-header {
    background-color: #ffffff;
    padding: 0.8rem 0;
    border-bottom: 1px solid #e9ecef; /* Borda mais suave */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.06);
    position: sticky;
    top: 0;
    z-index: 1020;
    width: 100%;
}

.header-container { /* Este div está dentro do .container ou .container-wide do header.php */
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo a {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: #2c3e50;
}

.logo .logo-icon-main { /* Adicionado no header.php */
    font-size: 1.8rem; /* Ajuste para mobile abaixo */
    color: #007bff;
    margin-right: 10px;
    line-height: 1;
}

.logo .site-name-brand { /* Adicionado no header.php */
    font-size: 1.6rem; /* Ajuste para mobile abaixo */
    font-weight: 600; /* Era 700, mais suave */
    line-height: 1.1;
    color: #2c3e50;
}

.logo .site-brand-tagline { /* Adicionado no header.php */
    font-size: 0.75rem; /* Ajuste para mobile abaixo */
    color: #555;
    margin-left: 8px;
    font-weight: 400;
    border-left: 1px solid #ddd;
    padding-left: 8px;
    line-height: 1.1;
}

/* --- Navegação Principal --- */
.main-nav {
    /* O container do menu toggle está aqui */
}

.main-nav .menu {
    list-style: none;
    display: flex;
    gap: 20px; /* Aumentado um pouco para desktop */
    margin-bottom: 0;
}

.main-nav .menu li a {
    color: #495057; /* Cor de texto mais padrão */
    font-weight: 500;
    padding: 0.6rem 0.3rem; /* Aumentado padding vertical */
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
    border-bottom: 3px solid transparent; /* Borda mais grossa para indicar ativo */
    transition: color 0.2s ease, border-color 0.2s ease;
}
.main-nav .menu li a .fas,
.main-nav .menu li a .far,
.main-nav .menu li a .fab { /* Ícones FA */
    margin-right: 6px;
    font-size: 0.9em; /* Ícones ligeiramente menores que o texto */
    width: 1.2em; /* Alinhamento */
    text-align: center;
}

.main-nav .menu li a:hover,
.main-nav .menu li a.active {
    color: #007bff;
    border-bottom-color: #007bff;
}

/* Botão do Menu Mobile (Hamburguer) */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.6rem; /* Aumentado para melhor toque */
    color: #343a40;
    cursor: pointer;
    padding: 0.5rem; /* Área de toque */
    line-height: 1;
}

/* --- Conteúdo Principal --- */
.site-main {
    flex-grow: 1;
    padding-top: 30px;
    padding-bottom: 40px;
}

/* Título Genérico da Página (não usado muito se cada página tem seu H1) */
.page-title {
    margin-bottom: 25px;
    font-size: 2.2rem; /* Responsivo abaixo */
    color: #2c3e50;
    font-weight: 600;
    text-align: center;
}

/* --- Rodapé --- */
.site-footer {
    background-color: #2c3e50; /* Azul acinzentado escuro */
    color: #bdc3c7; /* Cinza claro para texto */
    padding: 2.5rem 1rem; /* Padding vertical maior, horizontal menor para mobile */
    text-align: center;
    margin-top: auto;
    font-size: 0.9rem;
    line-height: 1.7;
}
.site-footer p {
    margin-bottom: 0.5rem;
}
.site-footer p:last-child {
    margin-bottom: 0;
}
.site-footer a {
    color: #ecf0f1; /* Branco suave */
    text-decoration: underline;
}
.site-footer a:hover {
    color: #ffffff;
    text-decoration: none;
}

/* ==========================================================================
   3. Componentes Comuns (Botões, Formulários, Mensagens, Tabelas, etc.)
   ========================================================================== */

/* --- Mensagens Flash --- */
.flash-message {
    padding: 1rem; /* Padding maior */
    margin-bottom: 1.5rem;
    border: 1px solid transparent;
    border-radius: 0.3rem; /* Raio de borda consistente */
    font-weight: 500;
    font-size: 0.95rem;
}
.flash-message.success { color: #0f5132; background-color: #d1e7dd; border-color: #badbcc; }
.flash-message.error, .flash-message.danger { color: #842029; background-color: #f8d7da; border-color: #f5c2c7; }
.flash-message.warning { color: #664d03; background-color: #fff3cd; border-color: #ffecb5; }
.flash-message.info { color: #055160; background-color: #cff4fc; border-color: #b6effb; }

/* --- Formulários --- */
.form-group {
    margin-bottom: 1.25rem; /* Mais espaço */
}
.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #495057;
    font-size: 0.95rem;
}
.form-control,
input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="search"], input[type="tel"], input[type="url"],
textarea,
select {
    display: block;
    width: 100%;
    padding: 0.65rem 1rem; /* Ajustado para melhor toque e aparência */
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    color: #495057;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid #ced4da;
    appearance: none; /* Remove estilos padrão do SO, especialmente para select */
    border-radius: 0.3rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}
input[type="file"].form-control { /* Input file requer atenção especial */
    padding: 0.4rem 0.8rem;
    line-height: 1.8; /* Ajuste para alinhar texto verticalmente */
}
/* Para select, adicionar um ícone de dropdown se desejado com ::after ou background-image */
select.form-control {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px 12px;
    padding-right: 2.5rem; /* Espaço para o ícone */
}


.form-control:focus {
    border-color: #86b7fe;
    outline: 0;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}
textarea.form-control {
    min-height: 150px; /* Maior por padrão */
    resize: vertical;
}

/* --- Botões --- */
.btn {
    display: inline-block;
    font-weight: 500; /* Um pouco mais de peso */
    line-height: 1.5;
    color: #fff;
    text-align: center;
    text-decoration: none;
    vertical-align: middle;
    cursor: pointer;
    user-select: none;
    background-color: #007bff;
    border: 1px solid #007bff;
    padding: 0.65rem 1.25rem; /* Ajustado para melhor toque e proporção */
    font-size: 1rem;
    border-radius: 0.3rem;
    transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}
.btn:hover {
    color: #fff;
    background-color: #0069d9;
    border-color: #0062cc;
    text-decoration: none;
}
.btn:focus {
    outline: 0;
    box-shadow: 0 0 0 0.25rem rgba(38, 143, 255, 0.5);
}
.btn:disabled, .btn.disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.btn-primary { background-color: #007bff; border-color: #007bff; }
.btn-primary:hover { background-color: #0069d9; border-color: #0062cc; }

.btn-secondary { background-color: #6c757d; border-color: #6c757d; }
.btn-secondary:hover { background-color: #5a6268; border-color: #545b62; }

.btn-success { background-color: #28a745; border-color: #28a745; }
.btn-success:hover { background-color: #218838; border-color: #1e7e34; }

.btn-danger { background-color: #dc3545; border-color: #dc3545; }
.btn-danger:hover { background-color: #c82333; border-color: #bd2130; }

.btn-info { background-color: #17a2b8; border-color: #17a2b8; } /* Usado no audio_to_text */
.btn-info:hover { background-color: #138496; border-color: #117a8b; }


.btn-lg { /* Botão maior */
    padding: 0.8rem 1.5rem;
    font-size: 1.15rem;
    border-radius: 0.35rem;
}
.btn-sm { /* Botão menor */
    padding: 0.35rem 0.75rem;
    font-size: 0.875rem;
    border-radius: 0.25rem;
}
.btn-block { display: block; width: 100%; }

/* --- Barra de Progresso --- */
.progress-bar-container {
    width: 100%;
    background-color: #e9ecef;
    border-radius: 0.3rem;
    margin-top: 0.75rem;
    display: none; /* Oculta por padrão, JS controla */
    height: 22px; /* Altura fixa */
    overflow: hidden; /* Garante que o filho não exceda */
}
.progress-bar {
    width: 0%;
    height: 100%; /* Preenche a altura do container */
    background-color: #007bff;
    /* border-radius: 0.3rem;  Se o pai já tem, este não precisa para efeito de preenchimento total */
    text-align: center;
    line-height: 22px; /* Igual à altura do container */
    color: white;
    font-size: 0.85rem;
    font-weight: 500;
    transition: width 0.3s ease-out; /* Transição mais suave */
}

/* --- Caixa de Resultado --- */
.result-box {
    margin-top: 1.5rem;
    padding: 1rem;
    border: 1px solid #dee2e6;
    background-color: #f8f9fa; /* Fundo levemente diferenciado */
    border-radius: 0.3rem;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: "SFMono-Regular", Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; /* Melhor pilha de fontes mono */
    font-size: 0.95rem;
    line-height: 1.6;
    min-height: 150px; /* Altura mínima */
}

/* --- Placeholder de Anúncios --- */
.ad-placeholder {
    border: 1px dashed #adb5bd; /* Borda mais sutil */
    padding: 1.5rem;
    text-align: center;
    margin: 1.5rem 0;
    background-color: #e9ecef;
    border-radius: 0.3rem;
    font-size: 0.9rem;
    color: #6c757d;
}

/* --- Tabelas --- */
.table {
    width: 100%;
    margin-bottom: 1rem;
    color: #212529;
    background-color: #fff; /* Fundo para a tabela */
    border-collapse: collapse; /* Remove espaços duplos entre bordas */
    border: 1px solid #dee2e6; /* Borda em volta da tabela */
}
.table th,
.table td {
    padding: 0.85rem; /* Aumentado padding */
    vertical-align: top;
    border-top: 1px solid #dee2e6;
}
.table thead th {
    vertical-align: bottom;
    border-bottom: 2px solid #dee2e6; /* Linha mais grossa para o header */
    background-color: #f8f9fa;
    font-weight: 600; /* Header da tabela em negrito */
}
.table tbody + tbody { border-top: 2px solid #dee2e6; }
.table-striped tbody tr:nth-of-type(odd) { background-color: rgba(0, 0, 0, 0.03); }
.table-bordered th, .table-bordered td { border: 1px solid #dee2e6; }
.table-hover tbody tr:hover { color: #212529; background-color: rgba(0, 0, 0, 0.06); }
.table-sm th, .table-sm td { padding: 0.4rem; } /* Tabela pequena */

/* --- Badges --- */
.badge {
    display: inline-block;
    padding: 0.35em 0.6em; /* Ajustado */
    font-size: 75%;
    font-weight: 600; /* Mais visível */
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 0.25rem;
}
.badge-success { color: #fff; background-color: #28a745; }
.badge-danger { color: #fff; background-color: #dc3545; }
.badge-warning { color: #212529; background-color: #ffc107; }
.badge-info { color: #fff; background-color: #17a2b8; }
.badge-secondary { color: #fff; background-color: #6c757d; } /* Adicionado */


/* ==========================================================================
   4. Estilos Específicos de Seções/Páginas (Ex: Login, Ferramentas)
   ========================================================================== */
/* --- Página de Login --- */
.login-container { /* Já definido em login.php, pode ser movido para cá */
    max-width: 450px;
    margin: 50px auto;
    padding: 30px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}
.login-container h1 { text-align: center; margin-bottom: 25px; color: #333; }

/* --- Páginas de Ferramentas (Estilos comuns) --- */
.tool-container h1.page-title { /* Se usar .page-title dentro das ferramentas */
    font-size: 1.8rem; /* Menor que o H1 da home */
    margin-bottom: 1rem;
}
.tool-container .lead { /* Parágrafo de introdução da ferramenta */
    font-size: 1.05rem;
    color: #555;
    margin-bottom: 1.5rem;
    text-align: center;
}

/* Estilos que foram adicionados nas páginas de ferramentas (como .tool-header, .input-options)
   podem ser centralizados aqui se forem comuns a todas as ferramentas, ou mantidos
   nas tags <style> das próprias páginas se forem muito específicos.
   Para uma melhor manutenção, o ideal é movê-los para cá e usar classes
   específicas no body da página para diferenciar se necessário.
   Ex: .body-image-tool .tool-header { ... } */


/* ==========================================================================
   5. Responsividade
   ========================================================================== */
@media (max-width: 992px) { /* Tablets e Desktops Menores */
    .container, .container-wide {
        width: 92%; /* Um pouco mais de largura */
    }
    .page-title { font-size: 1.9rem; }
    .logo .site-name-brand { font-size: 1.5rem; }
    .logo .logo-icon-main { font-size: 1.6rem; }
    .logo .site-brand-tagline { display: none; } /* Esconder tagline */
}

@media (max-width: 768px) { /* Tablets em modo retrato e Celulares Grandes */
    html { font-size: 15px; } /* Reduzir base da fonte para mobile */
    .container, .container-wide {
        width: 95%; /* Quase largura total */
        padding-left: 10px;
        padding-right: 10px;
    }

    .site-header { padding: 0.6rem 0; }
    .header-container { position: relative; }
    .logo .site-name-brand { font-size: 1.3rem; }
    .logo .logo-icon-main { font-size: 1.4rem; margin-right: 8px; }

    .menu-toggle {
        display: flex; /* Usar flex para alinhar ícone */
        align-items: center;
        justify-content: center;
        position: absolute;
        top: 50%;
        right: 10px; /* Mais próximo da borda */
        transform: translateY(-50%);
        z-index: 1001;
        font-size: 1.5rem; /* Ícone do hamburguer */
        width: 40px; /* Área de toque definida */
        height: 40px;
    }
    .main-nav .menu {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: #ffffff;
        border-top: 1px solid #e9ecef;
        box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
        padding: 10px 0;
        z-index: 1000;
    }
    .main-nav .menu.is-active { display: flex; }
    .main-nav .menu li { width: 100%; text-align: left; /* Melhor para menus mobile */ }
    .main-nav .menu li a {
        display: block;
        padding: 12px 20px; /* Bom padding para toque */
        width: 100%;
        border-bottom: 1px solid #f0f0f0; /* Divisor entre itens */
    }
     .main-nav .menu li:last-child a { border-bottom: none; }
    .main-nav .menu li a.active,
    .main-nav .menu li a:hover {
        background-color: #f0f8ff; /* Fundo suave no hover/active */
        color: #007bff;
        border-bottom-color: #f0f0f0; /* Mantém a cor do divisor */
    }
    .main-nav .menu li a .fas { font-size: 1em; } /* Ícones no menu mobile */

    .site-main { padding-top: 20px; padding-bottom: 30px; }
    .page-title { font-size: 1.7rem; margin-bottom: 20px;}

    .btn { padding: 0.7rem 1rem; font-size: 0.95rem; } /* Botões ligeiramente menores */
    .btn-lg { padding: 0.9rem 1.3rem; font-size: 1.05rem; }

    /* Adaptações de formulários para mobile */
    .form-control, input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="search"], input[type="tel"], input[type="url"], textarea, select {
        padding: 0.7rem 0.9rem;
        font-size: 0.95rem;
    }
    textarea.form-control { min-height: 120px; }

    /* Ajuste específico para input-options das ferramentas, para empilhar */
    .input-options { flex-direction: column; }
    .input-options > div { min-width: 100%; /* Ocupar toda a largura */ }

    /* Para os drop_zones das ferramentas */
    #drop_zone, #pdf_drop_zone, #audio_drop_zone { min-height: 160px; padding:20px; }
    #drop_zone p, #pdf_drop_zone p, #audio_drop_zone p { font-size:0.95rem; }

    /* Para os selects de idioma das ferramentas */
    .lang-select-container select, .audio-options-container select {width:100%;}

    /* Botão principal das ferramentas */
    #start_ocr_js_button, #start_pdf_processing_button, #start_transcription_button {width:100%;}

    .site-footer { padding: 2rem 1rem; font-size: 0.85rem; }
}

@media (max-width: 480px) { /* Celulares menores */
    html { font-size: 14px; } /* Reduzir ainda mais a base da fonte */
    .logo .site-name-brand { font-size: 1.2rem; }
    .logo .logo-icon-main { font-size: 1.3rem; margin-right: 6px; }

    .tool-header h1 { font-size: 1.6rem; } /* Exemplo de ajuste para títulos de ferramentas */
    .tool-header .lead { font-size: 0.95rem; }
}

/* seu_projeto/assets/css/style.css */

/* ==========================================================================
   1. Reset Básico e Padrões Globais
   ========================================================================== */
/* ... (COMO NA RESPOSTA ANTERIOR SOBRE "organiza esse css") ... */
html { font-size: 16px; scroll-behavior: smooth; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; line-height: 1.65; color: #343a40; background-color: #f8f9fa; display: flex; flex-direction: column; min-height: 100vh; margin:0; overflow-x: hidden;}
img, video, canvas, svg { max-width: 100%; height: auto; display: block; }
a { color: #007bff; text-decoration: none; transition: color 0.2s ease-in-out; }
a:hover { color: #0056b3; text-decoration: underline; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border-width: 0; }
.skip-link { position: absolute; top: -100px; left: 10px; background: #007bff; color: white; padding: 10px 15px; z-index: 100000; text-decoration: none; border-radius: 0 0 5px 5px; transition: top 0.3s ease-in-out; font-weight: 500; }
.skip-link:focus { top: 0; }

/* ==========================================================================
   2. Layout Principal (Containers, Header Público, Main Público, Footer Público)
   ========================================================================== */
.container, .container-wide { width: 90%; margin-left: auto; margin-right: auto; padding-left: 15px; padding-right: 15px; box-sizing: border-box; }
.container { max-width: 1140px; }
.container-wide { max-width: 1600px; padding-left: 20px; padding-right: 20px; }

.site-header { background-color: #ffffff; padding: 0.8rem 0; border-bottom: 1px solid #e9ecef; box-shadow: 0 2px 5px rgba(0, 0, 0, 0.06); position: sticky; top: 0; z-index: 1020; width: 100%;}
.header-container { display: flex; justify-content: space-between; align-items: center; }
/* ... (estilos de .logo, .main-nav do header PÚBLICO como antes) ... */
.logo a { display: flex; align-items: center; text-decoration: none; color: #2c3e50; }
.logo .logo-icon-main { font-size: 1.8rem; color: #007bff; margin-right: 10px; line-height: 1; }
.logo .site-name-brand { font-size: 1.6rem; font-weight: 600; line-height: 1.1; color: #2c3e50; }
.logo .site-brand-tagline { font-size: 0.75rem; color: #555; margin-left: 8px; font-weight: 400; border-left: 1px solid #ddd; padding-left: 8px; line-height: 1.1; }
.main-nav .menu { list-style: none; display: flex; gap: 20px; margin-bottom: 0; }
.main-nav .menu li a { color: #495057; font-weight: 500; padding: 0.6rem 0.3rem; text-decoration: none; display: flex; align-items: center; gap: 6px; border-bottom: 3px solid transparent; transition: color 0.2s ease, border-color 0.2s ease; }
.main-nav .menu li a .fas, .main-nav .menu li a .far, .main-nav .menu li a .fab { margin-right: 6px; font-size: 0.9em; width: 1.2em; text-align: center; }
.main-nav .menu li a:hover, .main-nav .menu li a.active { color: #007bff; border-bottom-color: #007bff; }
.menu-toggle { display: none; background: none; border: none; font-size: 1.6rem; color: #343a40; cursor: pointer; padding: 0.5rem; line-height: 1; }

.site-main { flex-grow: 1; padding-top: 30px; padding-bottom: 40px; }
.page-title { margin-bottom: 25px; font-size: 2.2rem; color: #2c3e50; font-weight: 600; text-align: center; }
.site-footer { background-color: #2c3e50; color: #bdc3c7; padding: 2.5rem 1rem; text-align: center; margin-top: auto; font-size: 0.9rem; line-height: 1.7; }
.site-footer p { margin-bottom: 0.5rem; } .site-footer p:last-child { margin-bottom: 0; }
.site-footer a { color: #ecf0f1; text-decoration: underline; } .site-footer a:hover { color: #ffffff; text-decoration: none; }

/* ==========================================================================
   3. Componentes Comuns
   ========================================================================== */
/* ... (estilos de .flash-message, .form-group, .form-control, .btn, .progress-bar, .result-box, .ad-placeholder, .table, .badge como antes) ... */
.flash-message { padding: 1rem; margin-bottom: 1.5rem; border: 1px solid transparent; border-radius: 0.3rem; font-weight: 500; font-size: 0.95rem; }
.flash-message.success { color: #0f5132; background-color: #d1e7dd; border-color: #badbcc; }
.flash-message.error, .flash-message.danger { color: #842029; background-color: #f8d7da; border-color: #f5c2c7; }
.flash-message.warning { color: #664d03; background-color: #fff3cd; border-color: #ffecb5; }
.flash-message.info { color: #055160; background-color: #cff4fc; border-color: #b6effb; }

.form-group { margin-bottom: 1.25rem; }
.form-group label { display: block; margin-bottom: 0.5rem; font-weight: 500; color: #495057; font-size: 0.95rem; }
.form-control, input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="search"], input[type="tel"], input[type="url"], textarea, select { display: block; width: 100%; padding: 0.65rem 1rem; font-size: 1rem; font-weight: 400; line-height: 1.5; color: #495057; background-color: #fff; background-clip: padding-box; border: 1px solid #ced4da; appearance: none; border-radius: 0.3rem; transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out; }
input[type="file"].form-control { padding: 0.4rem 0.8rem; line-height: 1.8; }
select.form-control { background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e"); background-repeat: no-repeat; background-position: right 0.75rem center; background-size: 16px 12px; padding-right: 2.5rem; }
.form-control:focus { border-color: #86b7fe; outline: 0; box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25); }
textarea.form-control { min-height: 150px; resize: vertical; }
.form-check-input { width: auto; margin-right: 0.5rem; vertical-align: middle; }
.form-check-label { font-weight: normal; }


.btn { display: inline-block; font-weight: 500; line-height: 1.5; color: #fff; text-align: center; text-decoration: none; vertical-align: middle; cursor: pointer; user-select: none; background-color: #007bff; border: 1px solid #007bff; padding: 0.65rem 1.25rem; font-size: 1rem; border-radius: 0.3rem; transition: all 0.15s ease-in-out; }
.btn:hover { color: #fff; background-color: #0069d9; border-color: #0062cc; text-decoration:none;}
.btn:focus { outline: 0; box-shadow: 0 0 0 0.25rem rgba(38, 143, 255, 0.5); }
.btn:disabled, .btn.disabled { opacity: 0.65; cursor: not-allowed; }
.btn-primary { background-color: #007bff; border-color: #007bff; } .btn-primary:hover { background-color: #0069d9; border-color: #0062cc; }
.btn-secondary { background-color: #6c757d; border-color: #6c757d; } .btn-secondary:hover { background-color: #5a6268; border-color: #545b62; }
.btn-success { background-color: #28a745; border-color: #28a745; } .btn-success:hover { background-color: #218838; border-color: #1e7e34; }
.btn-danger { background-color: #dc3545; border-color: #dc3545; } .btn-danger:hover { background-color: #c82333; border-color: #bd2130; }
.btn-warning { background-color: #ffc107; border-color: #ffc107; color: #212529;} .btn-warning:hover { background-color: #e0a800; border-color: #d39e00; color: #212529;}
.btn-info { background-color: #17a2b8; border-color: #17a2b8; } .btn-info:hover { background-color: #138496; border-color: #117a8b; }
.btn-outline-secondary { color: #6c757d; border-color: #6c757d; background-color:transparent; } .btn-outline-secondary:hover { color: #fff; background-color: #6c757d; border-color: #6c757d; }
.btn-lg { padding: 0.8rem 1.5rem; font-size: 1.15rem; border-radius: 0.35rem; }
.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.875rem; border-radius: 0.25rem; }
.btn-block { display: block; width: 100%; }

.progress-bar-container { width: 100%; background-color: #e9ecef; border-radius: 0.3rem; margin-top: 0.75rem; display: none; height: 22px; overflow: hidden; }
.progress-bar { width: 0%; height: 100%; background-color: #007bff; text-align: center; line-height: 22px; color: white; font-size: 0.85rem; font-weight: 500; transition: width 0.3s ease-out; }
.result-box { margin-top: 1.5rem; padding: 1rem; border: 1px solid #dee2e6; background-color: #fdfdff; border-radius: 0.3rem; white-space: pre-wrap; word-wrap: break-word; font-family: "SFMono-Regular", Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; font-size: 0.95rem; line-height: 1.6; min-height: 150px; }
.ad-placeholder { border: 1px dashed #adb5bd; padding: 1.5rem; text-align: center; margin: 1.5rem 0; background-color: #e9ecef; border-radius: 0.3rem; font-size: 0.9rem; color: #6c757d; }
.table { width: 100%; margin-bottom: 1rem; color: #212529; background-color: #fff; border-collapse: collapse; border: 1px solid #dee2e6; }
.table th, .table td { padding: 0.85rem; vertical-align: top; border-top: 1px solid #dee2e6; }
.table thead th { vertical-align: bottom; border-bottom: 2px solid #dee2e6; background-color: #f8f9fa; font-weight: 600; }
.table tbody + tbody { border-top: 2px solid #dee2e6; }
.table-striped tbody tr:nth-of-type(odd) { background-color: rgba(0, 0, 0, 0.03); }
.table-bordered th, .table-bordered td { border: 1px solid #dee2e6; }
.table-hover tbody tr:hover { color: #212529; background-color: rgba(0, 0, 0, 0.06); }
.table-sm th, .table-sm td { padding: 0.4rem; font-size:0.85rem; }
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.badge { display: inline-block; padding: 0.35em 0.6em; font-size: 75%; font-weight: 600; line-height: 1; text-align: center; white-space: nowrap; vertical-align: baseline; border-radius: 0.25rem; }
.badge-success { color: #fff; background-color: #28a745; } .badge-danger { color: #fff; background-color: #dc3545; }
.badge-warning { color: #212529; background-color: #ffc107; } .badge-info { color: #fff; background-color: #17a2b8; }
.badge-secondary { color: #fff; background-color: #6c757d; }

/* ==========================================================================
   4. Estilos Específicos de Seções/Páginas (Ex: Home, Ferramentas)
   ========================================================================== */
/* (Estilos do index.php, tool_container, etc. que já foram criados) */


/* ==========================================================================
   5. Layout do Painel de Administração (Admin Dashboard)
   ========================================================================== */
body.admin-page { background-color: #eef2f7; /* Fundo diferente para o admin */}
.admin-layout {
    display: flex;
    /* A altura e o topo da sidebar e do conteúdo principal
       são agora relativos ao início da página, não ao header público */
}

.admin-sidebar {
    width: 250px; /* Largura da sidebar */
    background-color: #2c3e50; /* Cor escura para a sidebar */
    color: #ecf0f1;
    padding: 20px 0;
    height: 100vh; /* Sidebar de altura total */
    position: fixed; 
    top: 0; /* Começa do topo da viewport */
    left: 0;
    overflow-y: auto;
    z-index: 1000; /* Abaixo do header público, se ele existir e for sticky */
    transition: width 0.3s ease, transform 0.3s ease;
}

.admin-sidebar .sidebar-header {
    padding: 15px 20px;
    text-align: center;
    margin-bottom: 15px;
    border-bottom: 1px solid #3a5068; /* Borda mais sutil */
}
.admin-sidebar .sidebar-header .admin-avatar {
    width: 70px; height: 70px; border-radius: 50%;
    margin: 0 auto 10px auto; border: 2px solid #4a627a; object-fit: cover;
}
.admin-sidebar .sidebar-header .admin-name { font-weight: 500; font-size: 1rem; margin-bottom:3px;}
.admin-sidebar .sidebar-header .admin-role {font-size: 0.8rem; color: #95a5a6;}


.admin-sidebar-nav ul { list-style: none; padding: 0; margin: 0; }
.admin-sidebar-nav li a {
    display: flex; align-items: center; padding: 13px 25px; /* Mais padding */
    color: #bdc3c7; text-decoration: none; font-size: 0.9rem; /* Ligeiramente menor */
    transition: background-color 0.2s ease, color 0.2s ease, border-left-color 0.2s ease;
    border-left: 4px solid transparent;
}
.admin-sidebar-nav li a:hover { background-color: #34495e; color: #ffffff; }
.admin-sidebar-nav li a.active {
    background-color: #1f2b38; color: #ffffff; font-weight: 500;
    border-left-color: #00aaff; /* Cor de destaque */
}
.admin-sidebar-nav li a .fas, .admin-sidebar-nav li a .far, .admin-sidebar-nav li a .fab {
    margin-right: 15px; width: 20px; /* Ícones um pouco maiores e mais espaçados */
    text-align: center; font-size: 1.05em;
}
.admin-sidebar-nav hr { border-color: #3a5068; margin: 15px 20px; }


.admin-main-content {
    flex-grow: 1;
    padding: 30px; /* Maior padding interno */
    margin-left: 250px; /* Mesmo valor da largura da sidebar */
    background-color: #eef2f7; /* Fundo diferente do body público */
    min-height: 100vh; /* Garante que ocupe a altura da tela */
    transition: margin-left 0.3s ease;
}
/* Estilo para o H1 dentro do admin-main-content */
.admin-main-content > h1.page-title { 
    text-align: left; 
    margin-top: 0; /* Remover margem superior se for o primeiro elemento */
    margin-bottom: 25px; 
    font-size: 1.9rem; 
    color: #2c3e50;
    font-weight: 600;
}


/* Estilos para Gráficos (Chart.js) */
.chart-container {
    position: relative;
    padding: 20px; /* Mais padding */
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    margin-bottom: 25px;
    /* A altura será definida inline ou via JS para melhor controle, mas um min-height é bom */
    min-height: 350px; 
    height: 380px; /* Altura padrão para gráficos */
    width: 100%; /* Para preencher o container flex/grid */
}
.chart-container canvas { max-width: 100% !important; max-height: 100% !important; }
.section-title-admin { /* Título para seções DENTRO do admin-main-content */
    font-size: 1.6rem; margin-top: 30px; margin-bottom: 20px;
    padding-bottom: 12px; border-bottom: 1px solid #d8dde3;
    color: #34495e; font-weight: 500;
}
.section-title-admin:first-child { margin-top:0; } /* Remover margem do primeiro título de seção */

/* Grid para cards do dashboard */
.dashboard-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); /* Ajuste minmax */
    gap: 25px; /* Mais gap */
    margin-bottom: 35px;
}
.dashboard-card { /* Estilos do card já definidos anteriormente, pode precisar de ajustes de cor/fonte aqui */
    background-color: #fff; padding: 20px; border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.08); display: flex;
    flex-direction: column; align-items: center; text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    min-height: 160px; /* Altura mínima para os cards */
    justify-content: center;
}
.dashboard-card:hover { transform: translateY(-5px); box-shadow: 0 6px 15px rgba(0,0,0,0.12); }
.dashboard-card .card-icon { font-size: 2.5rem; margin-bottom:10px; line-height: 1;}
.dashboard-card h3.card-title { font-size: 0.9rem; color: #5a6a79; margin-bottom:4px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.5px; }
.dashboard-card .card-value { font-size: 2rem; font-weight: 600; color: #2c3e50; margin-bottom:5px; line-height: 1.1;}
.dashboard-card .card-value.small-text { font-size: 1.2rem !important; }
.dashboard-card .card-description { font-size: 0.8rem; color: #7a8691; }
.dashboard-card a.card-link { margin-top: 10px; padding: 7px 14px; font-size: 0.85rem; border-radius: 5px; text-decoration:none; }
/* Cores dos cards como antes */
.dashboard-card.tools .card-icon { color: #17a2b8; } .dashboard-card.files .card-icon { color: #fd7e14; }
.dashboard-card.visits .card-icon { color: #28a745; } .dashboard-card.settings .card-icon { color: #6f42c1; }
.dashboard-card.ads .card-icon { color: #ffc107; } .dashboard-card.headcode .card-icon { color: #e83e8c; } /* Rosa para código */

.table-admin-dashboard { font-size: 0.9rem; }
.table-admin-dashboard th { background-color: #f1f5f9 !important; color:#34495e; }
.table-admin-dashboard td, .table-admin-dashboard th { vertical-align: middle; }
.table-admin-dashboard .badge { font-size: 80%; font-weight: 500;}

/* ==========================================================================
   6. Responsividade Admin e Global
   ========================================================================== */
/* Responsividade do Menu Público */
@media (max-width: 992px) {
    .logo .site-brand-tagline { display: none; }
}
@media (max-width: 768px) {
    html { font-size: 15px; }
    .container, .container-wide { width: 95%; padding-left: 10px; padding-right: 10px; }
    .site-header { padding: 0.6rem 0; }
    .header-container { position: relative; } /* Para menu toggle */
    .logo .site-name-brand { font-size: 1.3rem; }
    .logo .logo-icon-main { font-size: 1.4rem; margin-right: 8px; }

    .menu-toggle { display: flex; align-items: center; justify-content: center; position: absolute; top: 50%; right: 10px; transform: translateY(-50%); z-index: 1001; font-size: 1.5rem; width: 40px; height: 40px; }
    .main-nav .menu { display: none; flex-direction: column; position: absolute; top: 100%; left: 0; width: 100%; background-color: #ffffff; border-top: 1px solid #e9ecef; box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1); padding: 10px 0; z-index: 1000; }
    .main-nav .menu.is-active { display: flex; }
    .main-nav .menu li { width: 100%; text-align: left; }
    .main-nav .menu li a { display: block; padding: 12px 20px; width: 100%; border-bottom: 1px solid #f0f0f0; }
    .main-nav .menu li:last-child a { border-bottom: none; }
    .main-nav .menu li a.active, .main-nav .menu li a:hover { background-color: #f0f8ff; color: #007bff; border-bottom-color: #f0f0f0; }
    .main-nav .menu li a .fas { font-size: 1em; }

    .page-title { font-size: 1.7rem; margin-bottom: 20px;}
    .btn { padding: 0.7rem 1rem; font-size: 0.95rem; } .btn-lg { padding: 0.9rem 1.3rem; font-size: 1.05rem; }
    .form-control, input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="search"], input[type="tel"], input[type="url"], textarea, select { padding: 0.7rem 0.9rem; font-size: 0.95rem; }
    textarea.form-control { min-height: 120px; }
}


/* Responsividade do Admin Layout */
/* Tablet (Sidebar encolhida) */
.admin-sidebar-toggle-btn { /* Botão para mostrar/esconder sidebar no mobile */
    display: none; /* Mostrado apenas em mobile */
    position: fixed;
    top: 10px; /* Ajuste conforme altura do header do admin (se houver) */
    left: 10px;
    z-index: 1050;
    background-color: #2c3e50;
    color: #fff;
    border:none;
    padding: 8px 12px;
    border-radius:4px;
    font-size:1.2rem;
}

@media (max-width: 992px) {
    .admin-sidebar {
        width: 70px; /* Sidebar encolhida */
    }
    .admin-sidebar .sidebar-header .admin-name,
    .admin-sidebar .sidebar-header .admin-role,
    .admin-sidebar-nav li a span.nav-text {
        display: none;
    }
    .admin-sidebar:hover { /* Expande no hover */
        width: 250px;
    }
    .admin-sidebar:hover .sidebar-header .admin-name,
    .admin-sidebar:hover .sidebar-header .admin-role,
    .admin-sidebar:hover .admin-sidebar-nav li a span.nav-text {
        display: inline;
    }
    .admin-sidebar .sidebar-header { padding: 15px 10px; }
    .admin-sidebar .sidebar-header .admin-avatar { width: 40px; height: 40px; margin-bottom:5px;}
    .admin-sidebar-nav li a { justify-content: center; padding: 13px 10px;}
    .admin-sidebar-nav li a .fas, .admin-sidebar-nav li a .far, .admin-sidebar-nav li a .fab { margin-right: 0; font-size: 1.1rem;}

    .admin-main-content { margin-left: 70px; }
    .admin-sidebar:hover ~ .admin-main-content { /* ~ seletor de irmão geral */
        margin-left: 250px; /* Empurra conteúdo quando sidebar expande no hover */
    }
}

/* Mobile (Sidebar no topo ou oculta por um botão) */
@media (max-width: 768px) {
    .admin-sidebar-toggle-btn { display: block; }
    .admin-sidebar {
        transform: translateX(-100%); /* Esconde a sidebar fora da tela */
        position: fixed; /* Mantém fixo para deslizar */
        height: 100vh; /* Altura total no mobile também */
        top:0;
        z-index: 1100; /* Acima do conteúdo */
        box-shadow: 3px 0 10px rgba(0,0,0,0.1);
    }
    .admin-sidebar.open {
        transform: translateX(0); /* Mostra a sidebar */
    }
    .admin-main-content {
        margin-left: 0; /* Conteúdo ocupa toda a largura */
        padding-top: 70px; /* Espaço para o botão de toggle e um pouco de respiro */
    }
    .admin-sidebar:hover ~ .admin-main-content { margin-left: 0; } /* Não empurra no mobile */

    .admin-sidebar .sidebar-header .admin-name,
    .admin-sidebar .sidebar-header .admin-role,
    .admin-sidebar-nav li a span.nav-text {
        display: inline; /* Sempre mostra texto na sidebar mobile quando aberta */
    }
     .admin-sidebar .sidebar-header .admin-avatar { width: 50px; height: 50px; }
    .admin-sidebar-nav li a { justify-content: flex-start; padding: 12px 20px; } /* Alinhar à esquerda */
    .admin-sidebar-nav li a .fas, .admin-sidebar-nav li a .far, .admin-sidebar-nav li a .fab { margin-right: 12px; font-size: 1em; }
}

@media (max-width: 480px) {
    html { font-size: 14px; }
    .admin-main-content { padding: 20px 15px; } /* Menos padding no mobile */
    .dashboard-cards-grid { grid-template-columns: 1fr; /* Um card por linha */ }
    .chart-container { height: 300px; /* Altura menor para gráficos no mobile */ }
}