/* Archivo: public/css/style.css */
/* Descripción: Estilos CSS de la aplicación, con ajustes para los nuevos formularios y el dashboard */

body {
    background-color: #d1d5db;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    min-height: 100vh;
    margin: 0;
    font-family: sans-serif;
    padding: 20px;
    box-sizing: border-box;
}

/* Nuevos estilos para el encabezado con el nombre de usuario y botón de logout */
.header {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 10px 0;
    box-sizing: border-box;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    color: #4b5563;
    font-size: 16px;
    font-weight: bold;
}

/* Nuevo: Estilos para el user-info dentro de la barra lateral */
.dashboard-sidebar .user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
    background-color: #ffffff;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.dashboard-sidebar .user-info span {
    font-size: 18px;
    font-weight: bold;
    color: #374151;
}

.dashboard-sidebar .logout-button {
    text-decoration: none;
    color: #ef4444;
    font-size: 14px;
    font-weight: normal;
    transition: color 0.3s;
}

.dashboard-sidebar .logout-button:hover {
    color: #b91c1c;
    text-decoration: underline;
}

/* Estilos originales del encabezado */
.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
    background-color: #ffffff;
    padding: 10px 20px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.logout-button {
    text-decoration: none;
    color: #ef4444;
    font-size: 14px;
    font-weight: normal;
    transition: color 0.3s;
}

.logout-button:hover {
    color: #b91c1c;
    text-decoration: underline;
}

/* Nuevo contenedor principal para el login */
.main-container {
    background-color: #ffffff;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 450px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.logo-area {
    margin-bottom: 30px;
    text-align: center;
}

.logo {
    width: 150px;
    height: auto;
}

.login-box {
    padding: 20px;
    width: 100%;
    box-sizing: border-box;
}

.input-group {
    margin-bottom: 20px;
}

.input-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-sizing: border-box;
    font-size: 16px;
}

.input-group input:focus {
    outline: none;
    border-color: #3b82f6;
}

button {
    width: 100%;
    padding: 12px;
    border: none;
    background-color: #3b82f6;
    color: white;
    font-size: 16px;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s;
}

button:hover {
    background-color: #2563eb;
}

/* Oculta la etiqueta de usuario para accesibilidad */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

.error-message {
    color: #ef4444;
    background-color: #fee2e2;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #fca5a5;
    font-size: 14px;
}

.register-link-container {
    margin-top: 20px;
    font-size: 14px;
    color: #4b5563;
}

.register-link {
    color: #3b82f6;
    text-decoration: none;
    font-weight: bold;
}

.register-link:hover {
    text-decoration: underline;
}

/* Nuevos estilos para el dashboard y la bandeja de entrada */
.navbar {
    width: 100%;
    max-width: 900px;
    background-color: #3b82f6;
    border-radius: 15px;
    margin-bottom: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    display: flex;
    justify-content: center;
    overflow: hidden;
}

.navbar a {
    color: white;
    padding: 14px 20px;
    text-decoration: none;
    text-align: center;
    font-weight: bold;
    transition: background-color 0.3s;
}

.navbar a:hover {
    background-color: #2563eb;
}

.dashboard-container {
    display: flex;
    gap: 20px;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
}

@media (max-width: 768px) {
    .dashboard-container {
        flex-direction: column;
    }
}

.dashboard-sidebar {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 250px;
}

.dashboard-main-content {
    flex: 2;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.list-box,
.message-box {
    background-color: #ffffff;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.list-box h2,
.message-box h2 {
    margin-top: 0;
    color: #4b5563;
    font-size: 18px;
    font-weight: bold;
}

.custom-select {
    width: 100%;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 10px;
    box-sizing: border-box;
    font-size: 16px;
    min-height: 150px;
    /* Altura mínima para mostrar las opciones */
}

/* Evita la selección de texto en las opciones */
.custom-select option {
    user-select: none;
}

.message-input {
    width: 100%;
    padding: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-sizing: border-box;
    font-size: 16px;
    resize: none;
    /* Evita que el usuario cambie el tamaño del textarea */
}

/* Estilo para el botón de enviar en el dashboard */
.send-button {
    margin-top: 20px;
}

/* Estilo del botón cuando está en estado de carga */
.send-button.loading {
    background-color: #6b7280;
    cursor: not-allowed;
}

.send-button.loading:hover {
    background-color: #6b7280;
    /* Evita el cambio de color al pasar el mouse */
}

/* Estilos para el nuevo manejador de mensajes de estado */
.message-status {
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    font-weight: bold;
    transition: all 0.3s ease-in-out;
    margin-bottom: 20px;
    opacity: 0;
    height: 0;
    visibility: hidden;
}

.message-status.success {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #34d399;
    opacity: 1;
    height: auto;
    visibility: visible;
    padding: 15px;
}

.message-status.error {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #f87171;
    opacity: 1;
    height: auto;
    visibility: visible;
    padding: 15px;
}

/* Estilos para la bandeja de entrada */
.inbox-container {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    box-sizing: border-box;
    background-color: #ffffff;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.inbox-title {
    text-align: center;
    color: #4b5563;
    margin-top: 0;
    margin-bottom: 25px;
}

.messages-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.message-item {
    background-color: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 15px;
}

.message-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    border-bottom: 1px solid #d1d5db;
    padding-bottom: 8px;
    flex-wrap: wrap;
    /* Permite que los elementos se envuelvan en pantallas pequeñas */
}

.message-sender {
    font-weight: bold;
    color: #1f2937;
}

.message-date {
    font-size: 12px;
    color: #6b7280;
}

.message-content p {
    margin: 0;
    color: #374151;
    line-height: 1.5;
}

.message-recipients,
.message-groups {
    font-size: 14px;
    color: #4b5563;
    display: block;
    margin-top: 5px;
}

.no-messages {
    text-align: center;
    color: #6b7280;
    font-style: italic;
    padding: 20px;
}

.filter-box {
    background-color: #f9fafb;
    padding: 15px;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    margin-bottom: 20px;
}

.filter-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 15px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.filter-group label {
    font-weight: bold;
    font-size: 14px;
    color: #4b5563;
}

.filter-group select,
.filter-group input {
    padding: 8px;
    border: 1px solid #d1d5db;
    border-radius: 5px;
    font-size: 14px;
}

.filter-button {
    padding: 8px 15px;
    background-color: #3b82f6;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.filter-button:hover {
    background-color: #2563eb;
}

.clear-filters-link {
    color: #6b7280;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s;
}

.clear-filters-link:hover {
    color: #1f2937;
    text-decoration: underline;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
}

.pagination-link {
    display: block;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 5px;
    text-decoration: none;
    color: #3b82f6;
    transition: background-color 0.3s, color 0.3s;
}

.pagination-link:hover {
    background-color: #e5e7eb;
}

.pagination-link.active {
    background-color: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

/* Estilos de la página de perfil */
.profile-container {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    background-color: #ffffff;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.profile-title {
    text-align: center;
    color: #4b5563;
    margin-top: 0;
    margin-bottom: 25px;
}

.profile-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.form-group label {
    font-weight: bold;
    color: #4b5563;
}

.form-group input {
    padding: 10px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

.form-group input:focus {
    outline: none;
    border-color: #3b82f6;
}

.login-container {
    width: 100%;
    max-width: 800px;
    background: #2563eb;
    border-radius: 20px;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    padding: 30px;
    text-align: center;
}

#update-button.loading {
    background-color: #6b7280;
    cursor: not-allowed;
}

#update-button.loading:hover {
    background-color: #6b7280;
}