/* Layout geral - ajuste do conteúdo principal */
body {
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
    background-color: #081028; /* Tema escuro */
    color: #f5f5f5; /* Texto claro */
    font-family: Arial, sans-serif;
    min-height: 100vh; /* Garantir que o corpo ocupe toda a altura da tela */
    overflow-x: hidden; /* Remove rolagem horizontal */
}

/* Cabeçalhos */
h1 {
    text-align: center;
    color: #1abc9c;
}

/* Botões */
button {
    background-color: #1abc9c; /* Cor de destaque */
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    padding: 10px 15px;
}

button:hover {
    background-color: #16a085; /* Fundo mais escuro no hover */
}

/* Modais */
.modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: #2c3e50;
    color: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    width: 400px;
    max-width: 90%;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.modal input, .modal button {
    width: 100%;
    padding: 10px;
    margin-bottom: 10px;
    border-radius: 4px;
    border: 1px solid #7f8c8d;
    background-color: #34495e;
    color: white;
}

.modal-icon {
    font-size: 60px;
    color: #f1c40f;
    margin-bottom: 15px;
}

.modal-body h2 {
    font-size: 24px;
    margin-bottom: 10px;
    color: #ecf0f1;
}

.modal-body p {
    font-size: 16px;
    color: #bdc3c7;
    word-wrap: break-word;
}

.modal-footer {
    margin-top: 20px;
}

.modal-footer button {
    padding: 10px 20px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.modal-footer button:hover {
    background-color: #0056b3;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Cartões de Estatísticas */
.stats {
    display: flex;
    justify-content: space-around;
    margin-bottom: 30px;
}

.stat-card {
    padding: 20px;
    border-radius: 5px;
    width: 150px;
    text-align: center;
    color: white;
    font-size: 18px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2); /* Sombra suave */
}

.stat-card .stat-title {
    font-size: 14px;
}

.stat-card .stat-number {
    font-size: 24px;
    font-weight: bold;
}

/* Cores dos cartões */
.stat-card.gray {
    background-color: #7f8c8d; /* Cinza */
}

.stat-card.green {
    background-color: #27ae60; /* Verde */
}

.stat-card.yellow {
    background-color: #f39c12; /* Amarelo */
}

.stat-card.red {
    background-color: #e74c3c; /* Vermelho */
}

/* Tabela de Usuários - Modernizada */
.modern-table {
    width: 90%;
    border-collapse: collapse;
    margin-top: 30px;
}

.modern-table th, .modern-table td {
    padding: 20px;
    text-align: left;
    border-bottom: 1px solid #7f8c8d;
}

.modern-table th {
    background-color: #34495e;
    color: #ecf0f1;
}

.modern-table tr:hover {
    background-color: #1abc9c;
    color: white;
}

/* Barra lateral */
.sidebar {
    width: 250px;
    height: 100%;
    background-color: #081028;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    transition: transform 0.3s ease-in-out;
}

/* Botão para fechar a barra lateral no mobile */
.sidebar .close-btn {
    display: none; /* Por padrão, o botão X está oculto */
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: transparent;
    border: none;
    font-size: 24px;
    color: #fff;
    cursor: pointer;
}

.sidebar .close-btn:hover {
    color: #e74c3c;
}

/* Desktop: barra lateral sempre visível */
@media only screen and (min-width: 769px) {
    .sidebar {
        transform: translateX(0); /* Visível no desktop */
    }

    .main-content {
        margin-left: 250px; /* Compensa a largura da barra lateral */
        transition: margin-left 0.3s ease-in-out;
    }

    .sidebar-toggle {
        display: none; /* Oculta o botão de alternância no desktop */
    }

    .sidebar .close-btn {
        display: none; /* Oculta o botão X no desktop */
    }
}

/* Mobile: barra lateral oculta por padrão */
@media only screen and (max-width: 768px) {
    .sidebar {
        transform: translateX(-250px); /* Oculta no mobile */
    }

    .sidebar.open {
        transform: translateX(0); /* Exibe a barra lateral ao clicar no botão */
    }

    .sidebar .close-btn {
        display: block; /* Exibe o botão X apenas no mobile */
    }

    .main-content {
        margin-left: 0; /* Sem compensação no mobile */
    }

    .sidebar-toggle {
        display: block; /* Exibe o botão no mobile */
        position: fixed;
        top: 20px; /* Ajuste para o canto superior esquerdo */
        left: 15px; /* Ajuste para o canto superior esquerdo */
        background: none; /* Remove o fundo do botão */
        color: #000000; /* Cor do ícone */
        padding: 0; /* Remove o padding extra */
        font-size: 24px; /* Ajusta o tamanho do ícone */
        border: none; /* Remove bordas */
        cursor: pointer;
        z-index: 1100;
    }

    .sidebar-toggle:hover {
        background-color: #1abc9c;
    }
}

/* Conteúdo principal */
.main-content {
    padding: 20px;
    background-color: #081028; /* Cor de fundo escura */
    color: #ecf0f1; /* Texto claro */
    flex-grow: 1; /* Preencher o espaço restante */
    transition: margin-left 0.3s ease-in-out;
}

.main-content.full-width {
    margin-left: 0;
}

/* Responsividade - Modo Mobile */
@media only screen and (max-width: 700px) {
    .stats {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: space-between;
        margin: 0 5px;
    }

    .stat-card {
        width: 48%;
        margin-bottom: 10px;
        text-align: center;
    }

    .modern-table th, .modern-table td {
        font-size: 12px;
        padding: 8px;
    }
}

/* Nova regra para estatísticas em dispositivos móveis */
@media only screen and (max-width: 768px) {
    .stats {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }

    .stat-card {
        width: 90%;
        text-align: center;
    }
}

/* Adicionar um contêiner para os cards de mídia */
.media-section {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
}

@media only screen and (max-width: 768px) {
    .media-section {
        flex-direction: column; /* Empilha os cards no modo mobile */
    }
}
