/* css/dashboard_user.css */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: #121212;
    color: #ffffff;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background-color: #2c2c2c;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.profile-pic {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px solid #fd7200;
    object-fit: cover;
}

#user-name {
    font-weight: 600;
    font-size: 1.2rem;
    white-space: nowrap;
}

.company-logo .logo {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 2px solid #fd7200;
    object-fit: cover;
}

main {
    flex: 1;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

h1 {
    color: #ffffff;
    margin-bottom: 1.5rem;
    font-size: 2rem;
}

h2 {
    color: #ffffff;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.stats-section {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    justify-content: center;
}

.card {
    background-color: #2c2c2c;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    width: 200px;
    text-align: center;
    flex: 1 1 200px;
    min-width: 150px;
}

.card h2 {
    font-size: 1.2rem;
    color: #fd7200;
}

.card p {
    font-size: 1.5rem;
    font-weight: 600;
    color: #fd7200;
    margin-top: 0.5rem;
}

.hours-section, .payments-section {
    background-color: #2c2c2c;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    max-width: 600px;
    width: 100%;
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #ffffff;
}

.form-group input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #555555;
    border-radius: 4px;
    font-size: 1rem;
    background-color: #333333;
    color: #ffffff;
}

button {
    padding: 0.7rem 1rem;
    background-color: #fd7200;
    color: #ffffff;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
}

button:hover {
    background-color: #e65c00;
}

table {
    width: 100%;
    border-collapse: collapse;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    background-color: #333333;
}

th, td {
    padding: 1rem;
    text-align: center;
}

th {
    background-color: #fd7200;
    color: #ffffff;
    font-weight: 600;
}

tr:nth-child(even) {
    background-color: #404040;
}

.error, .success {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px;
    border-radius: 6px;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    max-width: 600px;
    width: 100%;
}

.error {
    background-color: #fee2e2;
    color: #dc3545;
    border: 1px solid #dc3545;
}

.success {
    background-color: #d4edda;
    color: #28a745;
    border: 1px solid #28a745;
}

/* Novos estilos para a tabela de pagamentos */
#payments-table {
    table-layout: fixed;
}

#payments-table th:nth-child(1), #payments-table td:nth-child(1) { width: 25%; }
#payments-table th:nth-child(2), #payments-table td:nth-child(2) { width: 25%; }
#payments-table th:nth-child(3), #payments-table td:nth-child(3) { width: 25%; }
#payments-table th:nth-child(4), #payments-table td:nth-child(4) { width: 25%; }

/* Estilo para o botão "Mostrar Mais" */
.show-more-btn {
    padding: 0.7rem 1rem;
    background-color: #fd7200;
    color: #ffffff;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 1rem;
}

.show-more-btn:hover {
    background-color: #e65c00;
}

/* Estilo para o mini formulário de histórico completo */
#full-history {
    display: none;
    margin-top: 1rem;
    border: 1px solid #555555;
    padding: 1rem;
    background-color: #333333;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

#full-history table {
    width: 100%;
    border-collapse: collapse;
    overflow-x: auto; /* Adiciona rolagem horizontal em telas pequenas */
    display: block; /* Permite rolagem */
}

#full-history th, #full-history td {
    padding: 0.75rem; /* Reduz padding */
    text-align: center;
    border-bottom: 1px solid #555555;
    min-width: 80px; /* Mínimo para evitar colapso */
    white-space: nowrap; /* Impede quebra de linha */
}

#full-history th {
    background-color: #fd7200;
    color: #ffffff;
    font-weight: 600;
}

#full-history tr:nth-child(even) {
    background-color: #404040;
}

/* Estilo para o botão de logout */
.logout-btn {
    padding: 0;
    background-color: #ff4444;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.logout-btn:hover {
    background-color: #cc0000;
}

/* Media Queries para Responsividade */
@media (max-width: 768px) {
    header {
        flex-direction: row;
        padding: 1rem;
        justify-content: space-around;
    }

    .user-info, .company-logo {
        margin: 0 0.5rem;
    }

    .profile-pic, .company-logo .logo, .logout-btn {
        width: 40px;
        height: 40px;
    }

    #user-name {
        font-size: 1rem;
    }

    main {
        padding: 1rem;
    }

    .stats-section {
        gap: 1rem;
    }

    .card {
        width: 100%;
        max-width: 250px;
        min-width: 150px;
    }

    .hours-section, .payments-section {
        padding: 1rem;
    }

    .form-group input {
        font-size: 0.9rem;
    }

    table {
        font-size: 0.9rem;
    }

    th, td {
        padding: 0.75rem;
    }

    #full-history th, #full-history td {
        padding: 0.5rem;
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    header {
        flex-direction: row;
        padding: 0.5rem;
        gap: 0.3rem;
    }

    .profile-pic, .company-logo .logo, .logout-btn {
        width: 35px;
        height: 35px;
    }

    #user-name {
        font-size: 0.9rem;
        max-width: 100px;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    h1 {
        font-size: 1.5rem;
    }

    h2 {
        font-size: 1.2rem;
    }

    .card {
        max-width: 200px;
    }

    .form-group input {
        font-size: 0.8rem;
    }

    table {
        font-size: 0.8rem;
    }

    .show-more-btn {
        font-size: 0.9rem;
        padding: 0.5rem 0.8rem;
    }

    #full-history th, #full-history td {
        padding: 0.4rem;
        font-size: 0.7rem;
        min-width: 60px;
    }

    #full-history table {
        min-width: 300px; /* Garante largura mínima para rolagem */
    }
}