/* style.css */

/* Importa a fonte do Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* Estilos gerais */
body {
    font-family: 'Inter', sans-serif;
*/
 
}

/* Cores personalizadas do Magazine Luiza */
:root {
    --magalu-azul: #2F67C8;        /* Azul Principal */
    --magalu-azul-escuro: #1A499A; /* Azul para fundo do sidebar/hover escuro */
    --magalu-azul-claro: #5890E8;  /* Azul para hover de links/ativo do sidebar */
    --magalu-rosa: #E62477;        /* Rosa de destaque/ofertas/preços */
    --magalu-vermelho: #E62477;    /* Alias para o rosa de destaque */
    --magalu-red: #E62477;         /* Alias para o rosa de destaque */
}

/* Estilos de Botões e Links */
.btn {
    font-weight: bold;
    padding: 0.75rem 1rem; /* py-3 px-4 */
    border-radius: 0.5rem; /* rounded-lg */
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06); /* shadow-md */
    transition-property: background-color, border-color, color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;
    transition-duration: 200ms;
    /* Garante que o botão use a cor de texto correta para o Magalu Azul */
    color: #fff !important; 
}

.btn-primary {
    background-color: var(--magalu-azul);
    color: #fff;
}

.btn-primary:hover {
    background-color: var(--magalu-azul-escuro);
}

/* Estilo para Botões de Sucesso/Confirmação (VERDE) */
.btn-success {
    background-color: #10B981; /* Verde Esmeralda */
    color: white;
    font-weight: bold;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    transition: background-color 200ms ease-in-out;
}
.btn-success:hover {
    background-color: #059669; /* Verde um pouco mais escuro para hover */
}

.link-default {
    color: var(--magalu-azul);
    transition-property: color, text-decoration-color;
    transition-duration: 200ms;
}

.link-default:hover {
    text-decoration: underline;
}

/* Estilos de Formulário */
.form-input {
    width: 100%;
    padding: 0.5rem 1rem; /* px-4 py-2 */
    background-color: #f9fafb; /* bg-gray-50 */
    border: 1px solid #d1d5db; /* border-gray-300 */
    border-radius: 0.5rem; /* rounded-lg */
    color: #111827; /* text-gray-900 */
    transition-property: all;
    transition-duration: 200ms;
}

.form-input:focus {
    outline: 2px solid transparent;
    outline-offset: 2px;
    /* Usando o rosa de destaque para o foco */
    box-shadow: 0 0 0 2px var(--magalu-rosa); 
}

.form-group {
    margin-bottom: 1.25rem; /* mb-5 */
}

.form-label {
    display: block;
    font-size: 0.875rem; /* text-sm */
    font-weight: 500; /* font-medium */
    color: #4b5563; /* text-gray-600 */
    margin-bottom: 0.25rem; /* mb-1 */
}

/* Estilos de Alertas */
.alert {
    text-align: center;
    font-weight: 600;
    margin-bottom: 1rem; /* mb-4 */
}

.alert-danger {
    color: var(--magalu-rosa); /* Usando o rosa (ou vermelho) do Magalu para alertas de perigo */
}

/* Estilos da página de Login/Cadastro */
.auth-container {
    background-color: #fff;
    padding: 2.5rem; /* p-10 */
    border-radius: 1rem; /* rounded-2xl */
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04); /* shadow-xl */
    width: 100%;
    max-width: 28rem; /* max-w-md */
}

.auth-title {
    font-size: 1.875rem; /* text-3xl */
    font-weight: 700;
    text-align: center;
    color: var(--magalu-azul);
    margin-bottom: 1.5rem; /* mb-6 */
}

/* Estilos para a imagem do produto na página principal */
.product-image {
    max-width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

/* Estilo para a imagem do produto na página de edição */
.img-produto {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

/* Estilos para os botões de ação */
.btn-action {
    font-weight: bold;
    padding: 4px 12px;
    border-radius: 8px;
    transition: all 0.2s ease-in-out;
    text-decoration: none;
    display: inline-block;
}

.btn-editar {
    background-color: var(--magalu-azul);
    color: white;
}

.btn-editar:hover {
    background-color: var(--magalu-azul-claro);
}

.btn-excluir {
    background-color: var(--magalu-rosa);
    color: white;
    margin-left: 8px;
}

.btn-excluir:hover {
    opacity: 0.8;
}

/* Estilos para o badge de mensagens */
.bg-red-600 {
    background-color: var(--magalu-rosa); /* Consistência com o rosa de destaque */
}
.text-red-100 {
    color: #fee2e2;
}
.rounded-full {
    border-radius: 9999px;
}

/* ======================================= */
/* ESTILOS DA BARRA LATERAL (SIDEBAR) */
/* ======================================= */

.sidebar {
    /* BLOQUEIO DE TAMANHO: w-64 (16rem) e flex-shrink/grow para fixar o tamanho */
    width: 16rem; /* Largura fixa (256px) */
    min-width: 16rem; /* Impede de encolher */
    max-width: 16rem; /* Impede de expandir */
    flex-shrink: 0; /* Impede que o flexbox encolha o sidebar */
    flex-grow: 0; /* Impede que o flexbox expanda o sidebar */
    
    background-color: var(--magalu-azul-escuro);
    color: #fff;
    padding: 1.5rem; /* Equivalente a p-6 */
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); /* Equivalente a shadow-xl */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.sidebar-header {
    margin-bottom: 2rem;
}

.sidebar-title {
    font-size: 1.25rem; /* text-xl */
    font-weight: 800; /* font-extrabold */
    color: #fff;
    letter-spacing: 0.05em; /* tracking-wider */
}

.sidebar-subtitle {
    font-size: 0.875rem; /* text-sm */
    font-weight: 300; /* font-light */
    color: #9ca3af; /* text-gray-400 */
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem; /* space-x-3 */
    font-size: 0.875rem; /* text-sm */
    font-weight: 500; /* font-medium */
    padding: 0.75rem; /* p-3 */
    border-radius: 0.5rem; /* rounded-lg */
    transition: all 200ms ease-in-out;
}

.sidebar-link:hover {
    background-color: var(--magalu-azul-claro);
}

.active-link {
    background-color: var(--magalu-azul-claro);
    color: #fff;
}

.sidebar-footer {
    margin-top: 2rem;
}

.sidebar-link-secondary {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.875rem;
    color: #9ca3af;
    transition: all 200ms ease-in-out;
}

.sidebar-link-secondary:hover {
    color: #fff;
}

.sidebar-badge {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1;
    color: #fff; /* Alterado para branco para contraste com o fundo rosa/vermelho */
    background-color: var(--magalu-rosa); /* Usando variável de cor */
    border-radius: 9999px;
}

/* Estilos para o painel principal (Admin) */
.main-content {
    flex: 1; /* Permite que o conteúdo principal ocupe o espaço restante */
    padding: 2rem; /* Equivalente a p-8 */
    overflow-y: auto; /* Garante scroll se o conteúdo for muito longo */
}

/* ======================================= */
/* ESTILOS DA TABELA */
/* ======================================= */

.tabela-container {
    width: 80%; 
    margin-left: auto; 
    margin-right: auto; 
    
    border-collapse: collapse;
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.tabela-80 {
    width: 80%; 
}

/* ======================================= */
/* ESTILOS ESPECÍFICOS: ADMIN PANEL */
/* ======================================= */

/* CORREÇÃO: Aplica display: flex AQUI, onde é necessário (no Admin) */
.admin-body {
    background-color: #f3f4f6; /* bg-gray-100 */
    min-height: 100vh;
    display: flex; /* Aplicado SOMENTE nas páginas de Admin para sidebar */
}

/* Container principal (o div que engloba o conteúdo, não o sidebar) */
.admin-main-container {
    flex: 1; 
    padding: 2rem; 
}

/* Card principal de conteúdo (Adicionar Produto e Tabela) */
.admin-card {
    background-color: #fff; 
    padding: 2rem; 
    border-radius: 1rem; 
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); 
}

/* Título de seção (Adicionar Novo Produto / Produtos Existentes) */
.section-title {
    font-size: 1.5rem; 
    font-weight: bold;
    margin-bottom: 1rem; 
    color: var(--magalu-azul);
}

/* Formulário de Adição de Produto */
.add-product-form {
    margin-bottom: 2rem; 
    padding: 1.5rem; 
    background-color: #eff6ff; 
    border-radius: 0.5rem; 
    box-shadow: inset 0 2px 4px 0 rgba(0, 0, 0, 0.06); 
}

/* Botão de Adicionar Produto */
.btn-add {
    background-color: var(--magalu-azul);
    color: white;
    font-weight: bold;
    padding: 0.5rem 1rem; 
    border-radius: 0.5rem; 
    transition: background-color 200ms ease-in-out;
}
.btn-add:hover {
    background-color: var(--magalu-azul-escuro);
}

/* Estilos da Tabela de Produtos */
.product-table-wrapper {
    overflow-x: auto;
}
.product-table {
    min-width: 100%;
    background-color: #eff6ff; 
    border-radius: 0.5rem; 
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1); 
}

/* Cabeçalho da Tabela */
.table-header {
    background-color: var(--magalu-azul);
    color: #fff;
    text-transform: uppercase;
    font-size: 0.875rem; 
    line-height: 1.25; 
}
.table-header th {
    padding: 0.75rem 1.5rem; 
    text-align: left;
}

/* Corpo da Tabela */
.table-body tr {
    border-bottom: 1px solid #e5e7eb; 
    transition: background-color 200ms;
}
.table-body tr:hover {
    background-color: #eff6ff; 
}
.table-body td {
    padding: 0.75rem 1.5rem; 
    text-align: left;
    font-size: 0.875rem; 
    font-weight: 300; 
    color: #4b5563; 
    white-space: nowrap;
}

/* Botões de Ação da Tabela (Editar/Excluir) */
.btn-edit {
    background-color: var(--magalu-azul);
    color: white;
    font-weight: bold;
    padding: 0.5rem 0.75rem; 
    border-radius: 0.5rem; 
    transition: background-color 200ms;
}
.btn-edit:hover {
    background-color: var(--magalu-azul-escuro);
}

.btn-delete {
    background-color: var(--magalu-rosa);
    color: white;
    font-weight: bold;
    padding: 0.5rem 0.75rem; 
    border-radius: 0.5rem; 
    transition: background-color 200ms;
    margin-left: 0.5rem; 
}
.btn-delete:hover {
    background-color: #dc2626; 
}