/* style.css - Versão Consolidada e Final sem Responsividade para Mobile */

/* Reset básico e tipografia */
body {
    font-family: 'Arial', sans-serif;
    background-color: #fce4cc; /* Laranja claro para o fundo da página */
    color: #333;
    margin: 0;
    padding: 20px;
    display: flex;
    flex-direction: column; /* Alinha o conteúdo em coluna */
    justify-content: flex-start; /* Alinha ao topo */
    align-items: center; /* Centraliza horizontalmente */
    min-height: 100vh; /* Garante que o body ocupe a altura total da viewport */
    box-sizing: border-box; /* Inclui padding no cálculo da largura/altura */
}

.container {
    background-color: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 800px; /* Largura máxima para o conteúdo principal */
    box-sizing: border-box;
    margin-bottom: 20px; /* Espaçamento abaixo do container */
}

h1, h2, h3 {
    color: #ff6600; /* Laranja vibrante para títulos */
    text-align: center;
    margin-bottom: 20px;
}

p {
    line-height: 1.6;
    margin-bottom: 10px;
}

/* Mensagens de status */
.success-message {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    padding: 10px;
    margin-bottom: 20px;
    border-radius: 5px;
    text-align: center;
}

.error-message {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    padding: 10px;
    margin-bottom: 20px;
    border-radius: 5px;
    text-align: center;
}

/* Formulários */
form {
    background-color: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #eee;
    text-align: center; /* Centraliza botões e outros elementos dentro do formulário */
}

.form-group {
    margin-bottom: 15px;
    text-align: left; /* Garante que labels e inputs fiquem alinhados à esquerda dentro do grupo */
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #555;
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group input[type="url"],
.form-group input[type="number"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box; /* Garante que padding não aumente a largura */
    font-size: 1em;
}

.form-group textarea {
    resize: vertical; /* Permite redimensionar verticalmente */
}

/* Estilo para o formulário de configurações globais */
.settings-form .form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 15px;
}

.settings-form label {
    margin-bottom: 5px;
}


/* Botões */
.button {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 5px;
    text-decoration: none;
    color: #fff;
    cursor: pointer;
    transition: background-color 0.3s ease;
    text-align: center;
    border: none;
    font-size: 1em;
    margin-top: 10px; /* Adicionado para dar um pequeno espaçamento superior aos botões */
}

.primary-button {
    background-color: #ff6600; /* Laranja vibrante */
}

.primary-button:hover {
    background-color: #e65c00; /* Laranja mais escuro no hover */
}

.secondary-button {
    background-color: #6c757d; /* Cinza */
}

.secondary-button:hover {
    background-color: #5a6268;
}

.button-danger {
    background-color: #dc3545; /* Vermelho */
}

.button-danger:hover {
    background-color: #c82333;
}

.green-button {
    background-color: #28a745; /* Verde */
}

.green-button:hover {
    background-color: #218838;
}

.button-small {
    padding: 5px 10px;
    font-size: 0.8em;
    margin: 5px 2px;
}

/* Centraliza os botões principais */
.main-actions {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

/* Navegação do utilizador (user-nav) e Admin (admin-navbar) */
.user-nav, .admin-navbar {
    background-color: #ff6600;
    padding: 10px 0;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.user-nav ul, .admin-navbar ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: center;
    flex-wrap: wrap; /* Permite que os itens quebrem a linha */
}

.user-nav li, .admin-navbar li {
    margin: 0 10px;
}

.user-nav a, .admin-navbar a {
    color: #fff;
    text-decoration: none;
    font-weight: bold;
    padding: 5px 0;
    display: block;
    transition: color 0.3s ease;
}

.user-nav a:hover, .admin-navbar a:hover {
    color: #f0f0f0;
}

/* Métricas */
.metrics-container, .admin-metrics-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
}

.metric-box, .admin-metric-box {
    background-color: #fff;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    text-align: center;
    flex: 1; /* Permite que as caixas cresçam e encolham */
    min-width: 200px; /* Largura mínima para cada caixa */
    max-width: calc(33% - 20px); /* 3 colunas em telas maiores */
    box-sizing: border-box;
    border-left: 5px solid #ff6600; /* Detalhe de cor */
}

.metric-box h3, .admin-metric-box h3 {
    color: #ff6600;
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1.2em;
}

.metric-box p, .admin-metric-box p {
    font-size: 1.5em;
    font-weight: bold;
    color: #333;
    margin: 0;
}

/* Tabelas */
.table-responsive {
    overflow-x: auto; /* Permite rolagem horizontal em telas pequenas */
    margin-bottom: 20px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.data-table th, .data-table td {
    border: 1px solid #ddd;
    padding: 12px;
    text-align: left;
}

.data-table th {
    background-color: #ff6600;
    color: white;
    font-weight: bold;
    position: sticky; /* Sticky header */
    top: 0;
    z-index: 10;
}

.data-table tr:nth-child(even) {
    background-color: #f2f2f2;
}

.data-table tr:hover {
    background-color: #ddd;
}

/* Estilos de status nas tabelas */
.status-aprovado, .status-concluído {
    background-color: #d4edda;
    color: #155724;
    padding: 5px 10px;
    border-radius: 5px;
    font-weight: bold;
}

.status-pendente, .status-aguardando {
    background-color: #fff3cd;
    color: #856404;
    padding: 5px 10px;
    border-radius: 5px;
    font-weight: bold;
}

.status-recusado {
    background-color: #f8d7da;
    color: #721c24;
    padding: 5px 10px;
    border-radius: 5px;
    font-weight: bold;
}

/* Paginação */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
}

.pagination a.button {
    background-color: #ff6600;
    padding: 8px 15px;
    text-decoration: none;
    border-radius: 5px;
    color: white;
}

.pagination a.button:hover {
    background-color: #e65c00;
}

.pagination span {
    font-weight: bold;
    color: #555;
}

/* Seções do Admin */
.admin-section {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.admin-section h2 {
    text-align: left;
    margin-top: 0;
    margin-bottom: 20px;
    color: #ff6600;
}

/* Chat Box */
.chat-box {
    border: 1px solid #ddd;
    padding: 15px;
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 20px;
    border-radius: 8px;
    background-color: #fcfcfc;
    display: flex;
    flex-direction: column;
}

.message {
    padding: 10px;
    border-radius: 15px;
    margin-bottom: 10px;
    max-width: 80%;
    word-wrap: break-word; /* Ensures long words break and wrap */
}

.message.user {
    background-color: #e0f7fa; /* Light blue for user messages */
    align-self: flex-end; /* Align to the right */
    border-bottom-right-radius: 2px; /* Sharper corner on one side */
}

.message.admin {
    background-color: #ffe0b2; /* Light orange for admin messages */
    align-self: flex-start; /* Align to the left */
    border-bottom-left-radius: 2px; /* Sharper corner on one side */
}

.message .timestamp {
    display: block;
    font-size: 0.7em;
    color: #777;
    margin-top: 5px;
    text-align: right; /* Align timestamp to the right within message bubble */
}

.message.admin .timestamp {
    text-align: left; /* Align timestamp to the left within admin message bubble */
}

/* Floating Chat Button (for user pages) */
.floating-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #007bff; /* Azul para o botão de chat */
    color: white;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    text-decoration: none;
    z-index: 100; /* Acima de outros elementos */
    transition: background-color 0.3s ease;
}

.floating-button:hover {
    background-color: #0056b3;
}

.floating-button img {
    width: 30px;
    height: 30px;
    object-fit: cover;
}

.unread-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: #dc3545; /* Vermelho para o contador */
    color: white;
    border-radius: 50%;
    padding: 5px 8px;
    font-size: 0.7em;
    font-weight: bold;
}

.table-unread-badge {
    background-color: #007bff;
    color: white;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: bold;
    display: inline-block; /* To allow padding/margin */
}


/* Detalhes de Cashback/Saque expansíveis */
.toggle-details-button {
    background-color: #007bff; /* Azul */
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

.toggle-details-button:hover {
    background-color: #0056b3;
}

.cashback-details-row td {
    padding: 0; /* Remove padding from the cell containing the expanded content */
}

.cashback-details-content {
    padding: 15px;
    background-color: #f0f0f0;
    border-top: 1px solid #ddd;
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
}

.cashback-details-content form {
    background-color: transparent; /* No background for nested form */
    padding: 0;
    border: none;
    box-shadow: none;
}

/* Botão Voltar ao Topo */
.back-to-top {
    display: none; /* Hidden by default */
    position: fixed; /* Fixed position */
    bottom: 30px; /* Place at the bottom */
    right: 30px; /* Place at the right */
    z-index: 99; /* Make sure it does not overlap */
    border: none; /* Remove borders */
    outline: none; /* Remove outline */
    background-color: #ff6600; /* Set a background color */
    color: white; /* Text color */
    cursor: pointer; /* Add a mouse pointer on hover */
    padding: 15px; /* Some padding */
    border-radius: 50%; /* Rounded corners */
    font-size: 18px; /* Increase font size */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: background-color 0.3s, transform 0.3s;
}

.back-to-top:hover {
    background-color: #e65c00; /* Darker background on hover */
    transform: translateY(-2px);
}

/* Estilos para o contêiner de vídeo e imagem */
.video-container, .image-container {
    position: relative;
    width: 100%;
    max-width: 600px; /* Define uma largura máxima para o contêiner */
    margin: 20px auto; /* Centraliza o contêiner */
    background-color: #f0f0f0;
    border-radius: 8px;
    overflow: hidden; /* Garante que o conteúdo não vaze */
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    padding-bottom: 56.25%; /* Proporção 16:9 para vídeos, ajuste conforme necessário para imagens */
    height: 0;
}

.video-container iframe, .image-container img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain; /* Garante que a imagem/vídeo caiba sem cortar, mantendo proporção */
    border-radius: 8px;
}

/* Estilo para o texto "Como Funciona" para preservar quebras de linha */
.how-it-works-text-content {
    white-space: pre-wrap; /* Preserva espaços em branco e quebras de linha, e quebra o texto */
    text-align: justify; /* Opcional: Justifica o texto para uma aparência mais limpa */
}

/* REMOVIDAS AS MEDIA QUERIES PARA DESATIVAR A PERSONALIZAÇÃO MOBILE */
