/* ================================================= */
/* 1. VARIÁVEIS DE COR E TEMA (:ROOT)                */
/* ================================================= */

:root {
    /* Cores */
    --primary-color: #007bff;       /* Azul (Principal e Ações) */
    --secondary-color: #6c757d;     /* Cinza (Texto Secundário) */
    --accent-color: #ffc107;        /* Amarelo (Destaques) */
    --background-color: #f8f9fa;    /* Fundo principal (Muito Claro) */
    --card-background: #ffffff;     /* Fundo de cards/formulários */
    --text-color: #343a40;          /* Texto principal Escuro */
    --border-color: #dee2e6;        /* Bordas e divisores */

    /* Status */
    --success-color: #28a745;       /* Verde */
    --error-color: #dc3545;         /* Vermelho */
    --warning-color: #ffc107;       /* Amarelo */
    --info-color: #17a2b8;          /* Azul Claro */

    /* Fontes */
    --font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}


/* ================================================= */
/* 2. RESET E ESTILOS BÁSICOS                        */
/* ================================================= */

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

body {
    font-family: var(--font-family);
    color: var(--text-color);
    background-color: var(--background-color);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
    color: var(--text-color);
}

/* Base de Links */
a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s;
}
a:hover {
    color: #0056b3;
}
.link-back {
    display: block;
    margin-top: 20px;
    text-align: center;
    color: var(--secondary-color);
    font-size: 0.9em;
}
.link-back:hover {
    color: var(--primary-color);
}


/* ================================================= */
/* 3. LAYOUT ADMINISTRATIVO (PADRÃO)                 */
/* ================================================= */

/* Centraliza a página de login e admin por padrão */
body:not(.mural-page) {
    display: flex;
    justify-content: center;
    align-items: flex-start; /* Alinha no topo, mas centraliza horizontalmente */
    min-height: 100vh;
    padding: 40px 20px; /* Mais padding no topo e base */
}

.form-container {
    background: var(--card-background);
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 800px; /* Aumentado para melhor visualização da tabela */
}
.form-container h1 {
    font-size: 2em;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 10px;
    margin-bottom: 20px;
}

/* Formulário e Inputs */
.form-group {
    margin-bottom: 15px;
}
.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
    color: var(--text-color);
}
input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="file"],
textarea,
select {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 1em;
    transition: border-color 0.3s, box-shadow 0.3s;
}

input:focus, textarea:focus, select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
    outline: none;
}

/* Botões */
.btn-submit {
    display: block;
    width: 100%;
    padding: 12px 20px;
    font-size: 1.1em;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    text-align: center;
    transition: background-color 0.2s;
    border: none;
    color: white;
    background-color: var(--primary-color);
    margin-top: 20px;
}
.btn-submit:hover {
    background-color: #0056b3;
}


/* Mensagens de feedback */
.message-success, .message-error {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 1em;
}

.message-success {
    background-color: #d4edda;
    color: var(--success-color);
    border: 1px solid #c3e6cb;
}

.message-error {
    background-color: #f8d7da;
    color: var(--error-color);
    border: 1px solid #f5c6cb;
}


/* --- ESTILOS DO DASHBOARD --- */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.dashboard-grid .card {
    display: block;
    background: var(--background-color);
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s, box-shadow 0.3s;
    text-align: center;
    border: 1px solid var(--border-color);
}
.dashboard-grid .card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color);
}
.dashboard-grid .card .icon {
    font-size: 2em;
    display: block;
    margin-bottom: 10px;
}
.dashboard-grid .card h2 {
    font-size: 1.2em;
    margin-bottom: 5px;
}
.dashboard-grid .card p {
    font-size: 0.9em;
    color: var(--secondary-color);
}


/* --- ESTILOS DE TABELA (GERENCIAR) --- */
.product-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden; /* Para garantir que o border-radius funcione */
}

.product-table th, .product-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.95em;
}

.product-table th {
    background-color: #e9ecef; /* Cor mais suave para o cabeçalho */
    font-weight: 700;
    color: var(--text-color);
    text-transform: uppercase;
    font-size: 0.8em;
}

.product-table tr:hover {
    background-color: #f1f1f1;
}

.product-table td img {
    width: 60px; /* Imagem um pouco maior */
    height: 60px;
    object-fit: cover;
    border-radius: 8px; /* Cantos mais arredondados */
    vertical-align: middle;
    border: 1px solid var(--border-color);
}
/* Ações na Tabela */
.actions a {
    margin-right: 15px;
    text-decoration: none;
    font-weight: 600;
}
.action-edit { color: var(--info-color); }
.action-delete { color: var(--error-color); }

.top-actions {
    display: flex;
    justify-content: flex-end; /* Mover o botão para a direita */
    margin-bottom: 20px;
}
.btn-add {
    background-color: var(--success-color);
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    transition: background-color 0.2s;
}
.btn-add:hover {
    background-color: #218838;
}


/* ================================================= */
/* 4. ESTILOS ESPECÍFICOS DO MURAL (INDEX.PHP)       */
/* ================================================= */

/* Reaplicando o CSS que funciona para o Mural (V6.0/Contain) */
body.mural-page {
    display: block;
    min-height: auto;
    padding: 0;
    background-color: var(--background-color);
}
.mural-header {
    text-align: center;
    padding: 30px 0;
    background-color: var(--card-background);
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 40px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}
.mural-header h1 {
    color: var(--primary-color);
    font-size: 3em;
    margin: 0;
    border-bottom: none;
    padding-bottom: 0;
    font-weight: 700;
}
.mural-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px 40px 20px;
}
.mural-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}
.product-card {
    background: var(--card-background);
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-color);
}
.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
}
.product-card-img {
    width: 100%;
    height: 250px;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #f1f1f1;
    border-bottom: 1px solid var(--border-color);
}
.product-card-img img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* Garante que a imagem caiba e mantenha a proporção */
    object-position: center;
    transition: transform 0.5s;
}
.product-card:hover .product-card-img img {
    transform: scale(1.05);
}
.product-card-body {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.product-card-body h2 {
    font-size: 1.5em;
    font-weight: 600;
    margin: 0 0 5px 0;
    color: var(--text-color);
}
.product-card-body p {
    font-size: 0.9em;
    color: var(--secondary-color);
    min-height: 40px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.4em;
}
.price {
    font-size: 2em;
    color: var(--error-color);
    font-weight: 700;
    margin: 15px 0 10px 0;
}
.stock {
    font-size: 0.9em;
    color: var(--success-color);
    font-weight: 600;
    margin-bottom: 5px;
}
.btn-buy {
    background-color: var(--success-color);
    color: white;
    padding: 14px 0;
    border: none;
    border-radius: 6px;
    text-align: center;
    text-decoration: none;
    font-weight: 600;
    transition: background-color 0.2s;
    margin-top: 15px;
    display: block;
}
.btn-buy:hover {
    background-color: #218838;
}
.admin-link {
    position: fixed;
    top: 20px;
    right: 20px;
    color: var(--secondary-color);
    text-decoration: none;
    font-size: 0.9em;
    z-index: 100;
    background-color: var(--card-background);
    padding: 8px 12px;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}