/* Estilos personalizados para la plataforma de Comisiones Marinas */

:root {
    --primary-color: #0056b3;
    --secondary-color: #17a2b8;
    --success-color: #28a745;
    --info-color: #17a2b8;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --card-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --hover-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
}

body {
    background-color: #f5f7fa;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Estilos para la cabecera */
.header-image {
    position: relative;
    max-height: 300px;
    overflow: hidden;
}

.header-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(0, 86, 179, 0.9), rgba(23, 162, 184, 0.9));
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-overlay h1 {
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    font-size: 2.5rem;
    text-align: center;
    padding: 0 20px;
    font-weight: 600;
}

/* Estilos para las tarjetas */
.card {
    transition: all 0.3s ease;
    border: none;
    box-shadow: var(--card-shadow);
    border-radius: 12px;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--hover-shadow);
}

/* Tarjetas de funciones en el panel admin */
.function-card {
    background: white;
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    box-shadow: var(--card-shadow);
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.function-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--hover-shadow);
}

.function-card .icon {
    font-size: 3rem;
    margin-bottom: 20px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.function-card h4 {
    color: var(--dark-color);
    font-weight: 600;
    margin-bottom: 15px;
}

.function-card .count {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.function-card .label {
    color: #6c757d;
    font-size: 0.9rem;
}

/* Estilos para patrocinadores */
.sponsor-card {
    background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 25px;
    text-align: center;
    box-shadow: var(--card-shadow);
    transition: all 0.3s ease;
}

.sponsor-card:hover {
    transform: scale(1.02);
    box-shadow: var(--hover-shadow);
    border-color: var(--primary-color);
}

.sponsor-card img {
    max-height: 80px;
    margin-bottom: 15px;
    filter: grayscale(0%);
    transition: filter 0.3s ease;
}

.sponsor-card:hover img {
    filter: grayscale(0%) brightness(1.1);
}

.sponsor-highlight {
    background: linear-gradient(135deg, #ffeaa7 0%, #fdcb6e 100%);
    color: #2d3436;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: var(--card-shadow);
}

/* Estilos para comentarios */
.comentario {
    padding: 20px;
    margin-bottom: 15px;
    border-radius: 12px;
    background-color: white;
    border-left: 4px solid #dee2e6;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}

.comentario:hover {
    box-shadow: var(--card-shadow);
    transform: translateX(5px);
}

.comentario-nuevo {
    border-left: 4px solid var(--primary-color);
    background-color: #f0f7ff;
}

.comentario-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.comentario-content {
    white-space: pre-line;
    color: #495057;
}

/* Estilos para documentos */
.documento-item {
    display: flex;
    align-items: center;
    padding: 20px;
    margin-bottom: 15px;
    border-radius: 12px;
    background-color: white;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.documento-item:hover {
    background-color: #f8f9fa;
    box-shadow: var(--card-shadow);
    transform: translateX(5px);
}

.documento-icon {
    font-size: 2.5rem;
    margin-right: 20px;
    color: #6c757d;
}

.documento-info {
    flex-grow: 1;
}

/* Estilos para reuniones */
.reunion-item {
    padding: 20px;
    margin-bottom: 15px;
    border-radius: 12px;
    background-color: white;
    border-left: 4px solid #6c757d;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}

.reunion-item:hover {
    box-shadow: var(--card-shadow);
    transform: translateX(5px);
}

.reunion-fecha {
    color: #6c757d;
    font-size: 0.9rem;
}

/* Estilos para el chat */
#chat-messages {
    min-height: 400px;
    max-height: 400px;
    overflow-y: auto;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
}

.chat-message {
    margin-bottom: 15px;
    padding: 12px 18px;
    border-radius: 18px;
    max-width: 70%;
    word-wrap: break-word;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.own-message {
    margin-left: auto;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.other-message {
    background-color: white;
    border: 1px solid #e9ecef;
}

.message-header {
    font-size: 0.85rem;
    margin-bottom: 5px;
    opacity: 0.8;
}

.message-content {
    word-wrap: break-word;
}

/* Estilos para badges personalizados */
.badge {
    padding: 0.5em 0.75em;
    font-weight: 500;
    border-radius: 6px;
}

.badge-leader {
    background: linear-gradient(135deg, #f39c12, #f1c40f);
    color: #fff;
}

/* Estilos para botones mejorados */
.btn {
    border-radius: 8px;
    padding: 0.5rem 1.5rem;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 86, 179, 0.3);
}

/* Lista de miembros mejorada */
.member-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}

.member-card:hover {
    box-shadow: var(--card-shadow);
    transform: translateY(-2px);
}

.member-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.2rem;
}

/* Navbar mejorado */
.navbar {
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.navbar-dark {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color)) !important;
}

/* Alertas mejoradas */
.alert {
    border-radius: 8px;
    border: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* Tablas mejoradas */
.table {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.table thead th {
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    color: #495057;
}

/* Modal mejorado */
.modal-content {
    border-radius: 12px;
    border: none;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.modal-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-radius: 12px 12px 0 0;
}

/* Breadcrumb mejorado */
.breadcrumb {
    background-color: white;
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* Animaciones */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

/* Responsive */
@media (max-width: 768px) {
    .header-overlay h1 {
        font-size: 1.8rem;
    }
    
    .function-card {
        padding: 20px;
    }
    
    .function-card .icon {
        font-size: 2.5rem;
    }
    
    .documento-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .documento-icon {
        margin-bottom: 10px;
    }
    
    .member-card {
        padding: 15px;
    }
}

/* Scrollbar personalizada */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}/* ====== MEJORAS PARA EL CHAT ====== */

/* Indicador de usuario en línea */
.online-indicator {
    width: 10px;
    height: 10px;
    background: #28a745;
    border-radius: 50%;
    display: inline-block;
    margin-left: 5px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { 
        opacity: 1;
        transform: scale(1);
    }
    50% { 
        opacity: 0.7;
        transform: scale(0.9);
    }
    100% { 
        opacity: 1;
        transform: scale(1);
    }
}

/* Contenedor de mensajes mejorado */
#chat-messages {
    min-height: 400px;
    max-height: 400px;
    overflow-y: auto;
    padding: 20px;
    background: linear-gradient(to bottom, #f0f2f5, #e9ecef);
    border-radius: 12px;
    scroll-behavior: smooth;
}

/* Animación de entrada para mensajes */
.chat-message {
    animation: slideIn 0.3s ease-out;
    margin-bottom: 20px;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mensajes propios mejorados */
.own-message {
    margin-left: auto;
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    box-shadow: 0 3px 10px rgba(0, 123, 255, 0.3);
}

.own-message .message-header {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.8rem;
}

/* Mensajes de otros mejorados */
.other-message {
    background-color: white;
    border: 1px solid #e0e0e0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.other-message .message-header strong {
    color: #007bff;
}

/* Hover en mensajes */
.chat-message:hover {
    transform: translateX(2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* Input de chat mejorado */
#chat-input {
    border-radius: 25px;
    padding: 12px 20px;
    border: 2px solid #e0e0e0;
    transition: all 0.3s ease;
}

#chat-input:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
    outline: none;
}

/* Botón de enviar mejorado */
#chat-form button[type="submit"] {
    border-radius: 50%;
    width: 45px;
    height: 45px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

#chat-form button[type="submit"]:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.4);
}

/* Indicador de escritura */
.typing-indicator {
    display: inline-block;
    padding: 10px 15px;
    background: #e0e0e0;
    border-radius: 18px;
    margin-bottom: 15px;
}

.typing-indicator span {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #888;
    margin: 0 2px;
    animation: typing 1.4s infinite;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.6;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

/* Mejoras para móviles */
@media (max-width: 768px) {
    #chat-messages {
        max-height: 300px;
    }
    
    .chat-message {
        max-width: 85%;
        font-size: 0.9rem;
    }
    
    #chat-form {
        position: sticky;
        bottom: 0;
        background: white;
        padding: 10px;
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    }
}

/* Scrollbar personalizada para el chat */
#chat-messages::-webkit-scrollbar {
    width: 6px;
}

#chat-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

#chat-messages::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

#chat-messages::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Efecto de nueva conexión */
.connection-status {
    position: fixed;
    top: 70px;
    right: 20px;
    padding: 10px 20px;
    background: #28a745;
    color: white;
    border-radius: 25px;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
    display: none;
    animation: slideInRight 0.5s ease;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Mejoras para el área de documentos */
.documento-item:hover {
    background-color: #f8f9fa;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transform: translateX(5px);
    border-left: 4px solid var(--primary-color);
}

/* Badge del líder mejorado */
.badge-leader {
    background: linear-gradient(135deg, #f39c12, #f1c40f);
    color: #fff;
    padding: 0.5em 1em;
    font-weight: 600;
    box-shadow: 0 2px 5px rgba(243, 156, 18, 0.3);
}

/* Animación para elementos nuevos */
.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
/* ====== ESTILOS ADICIONALES PARA EL CHAT MEJORADO ====== */

/* Contenedor del mensaje */
.message-container {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    width: 100%;
}

.own-message .message-container {
    flex-direction: row-reverse;
}

/* Avatar del mensaje */
.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    flex-shrink: 0;
    margin-top: 2px;
}

/* Contenedor del contenido del mensaje */
.message-content-wrapper {
    flex: 1;
    min-width: 0; /* Para permitir que el texto se ajuste */
}

/* Header del mensaje mejorado */
.message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.25rem;
}

.own-message .message-header {
    flex-direction: row-reverse;
}

.message-time {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.75rem;
    margin-left: 0.5rem;
}

.other-message .message-time {
    color: #6c757d;
    margin-left: 0;
    margin-right: 0.5rem;
}

.own-message .message-time {
    margin-left: 0;
    margin-right: 0.5rem;
}

/* Contenido del mensaje mejorado */
.message-content {
    word-wrap: break-word;
    line-height: 1.4;
    font-size: 0.9rem;
}

/* Estados especiales del chat */
.empty-chat, .error-state {
    background: rgba(248, 249, 250, 0.8);
    border-radius: 12px;
    margin: 2rem;
}

.empty-chat i, .error-state i {
    opacity: 0.6;
}

/* Animaciones mejoradas */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-message {
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

/* Indicadores de conexión mejorados */
#connection-status {
    font-size: 0.85rem;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    transition: all 0.3s ease;
}

#connection-status.text-success {
    background: rgba(40, 167, 69, 0.1);
    color: #28a745 !important;
}

#connection-status.text-danger {
    background: rgba(220, 53, 69, 0.1);
    color: #dc3545 !important;
}

#connection-status.text-warning {
    background: rgba(255, 193, 7, 0.1);
    color: #ffc107 !important;
}

/* Formulario de chat mejorado */
#chat-form .input-group {
    border-radius: 25px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

#chat-input {
    border: none;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
}

#chat-input:focus {
    box-shadow: none;
    border-color: transparent;
}

#chat-form button[type="submit"] {
    border: none;
    background: var(--primary-color);
    padding: 0.75rem 1.25rem;
    transition: all 0.3s ease;
}

#chat-form button[type="submit"]:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

/* Responsive para chat */
@media (max-width: 768px) {
    .message-avatar {
        width: 28px;
        height: 28px;
        font-size: 0.7rem;
    }
    
    .message-container {
        gap: 0.5rem;
    }
    
    .chat-message {
        max-width: 90%;
    }
    
    #chat-messages {
        min-height: 300px;
        max-height: 300px;
    }
}

/* Mejoras para el scrollbar del chat */
#chat-messages::-webkit-scrollbar {
    width: 4px;
}

#chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

#chat-messages::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 2px;
}

#chat-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.4);
}
/* ===== AVATARES Y PERFILES ===== */

/* Contenedores de avatar */
.profile-avatar-sm {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #6c757d;
    color: white;
    font-weight: 500;
}

.profile-avatar-md {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #6c757d;
    color: white;
    font-weight: 500;
}

.profile-avatar-large {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #6c757d;
    color: white;
    font-weight: 500;
    margin: 0 auto;
}

/* Imágenes de perfil */
.profile-image-sm {
    width: 32px;
    height: 32px;
    object-fit: cover;
    border-radius: 50%;
}

.profile-image-md {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 50%;
}

.profile-image-large {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 50%;
}

/* Iniciales por defecto */
.profile-initials-sm {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.profile-initials-md {
    font-size: 16px;
    font-weight: 600;
    text-transform: uppercase;
}

.profile-initials-large {
    font-size: 36px;
    font-weight: 600;
    text-transform: uppercase;
}

/* Contenedor de información de usuario */
.user-avatar-container {
    align-items: center;
}

.user-info .user-name {
    font-weight: 500;
    line-height: 1.2;
}

.user-info .user-empresa {
    font-size: 0.875rem;
    line-height: 1.2;
}

/* Estilos específicos para chat */
.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #007bff;
    color: white;
    font-weight: 500;
    font-size: 12px;
    text-transform: uppercase;
    flex-shrink: 0;
}

.message-user-info {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.message-user-info strong {
    font-size: 0.9rem;
}

.message-user-info small {
    font-size: 0.75rem;
    margin-top: -2px;
}

/* Responsive */
@media (max-width: 768px) {
    .profile-avatar-large {
        width: 80px;
        height: 80px;
    }
    
    .profile-image-large {
        width: 80px;
        height: 80px;
    }
    
    .profile-initials-large {
        font-size: 24px;
    }
}
