/**
 * ════════════════════════════════════════════════════════════
 * ESTILOS PARA GRUPOS COLABORATIVOS
 * Version: 1.0
 * Fecha: 2026-01-19
 * ════════════════════════════════════════════════════════════
 */

/* ════════════════════════════════════════════════════════════
   CONTAINER PRINCIPAL
   ════════════════════════════════════════════════════════════ */

#gruposColaborativosContainer {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    min-height: 500px;
    padding: 20px;
    background: white;
}

.grupos-coordinador-view,
.grupo-estudiante-view {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

/* ════════════════════════════════════════════════════════════
   HEADER SECTION
   ════════════════════════════════════════════════════════════ */

.header-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    color: white;
}

.header-section h2 {
    margin: 0;
    color: white;
    font-size: 28px;
}

.header-section button {
    background: white;
    color: #667eea;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.header-section button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* ════════════════════════════════════════════════════════════
   TIMER DISPLAY
   ════════════════════════════════════════════════════════════ */

.timer-display {
    font-size: 32px;
    font-weight: bold;
    color: #28a745;
    padding: 15px 30px;
    background: #f8f9fa;
    border-radius: 8px;
    display: inline-block;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.timer-display i {
    margin-right: 10px;
}

/* ════════════════════════════════════════════════════════════
   HEADER DE GRUPO
   ════════════════════════════════════════════════════════════ */

.grupo-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 30px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.grupo-header h3 {
    margin: 0;
    font-size: 28px;
}

.grupo-header p {
    margin: 5px 0 0;
    opacity: 0.9;
}

/* ════════════════════════════════════════════════════════════
   MIEMBROS DEL GRUPO
   ════════════════════════════════════════════════════════════ */

.miembros-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
}

.miembro-item {
    padding: 10px 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #007bff;
    display: flex;
    align-items: center;
    gap: 10px;
}

.miembro-item i {
    color: #007bff;
}

.miembro-item .badge {
    margin-left: auto;
}

/* ════════════════════════════════════════════════════════════
   CHAT CONTAINER
   ════════════════════════════════════════════════════════════ */

#chatContainer {
    height: 400px;
    overflow-y: auto;
    border: 1px solid #ddd;
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 8px;
    background: #f8f9fa;
}

#chatContainer::-webkit-scrollbar {
    width: 8px;
}

#chatContainer::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

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

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

/* ════════════════════════════════════════════════════════════
   MENSAJES
   ════════════════════════════════════════════════════════════ */

.mensaje {
    animation: fadeIn 0.3s ease;
}

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

.mensaje-propio .mensaje-contenido {
    background: #007bff !important;
    color: white !important;
}

.mensaje-otro .mensaje-contenido {
    background: #e9ecef !important;
    color: #000 !important;
}

.mensaje-avatar {
    font-weight: bold;
    font-size: 14px;
}

/* ════════════════════════════════════════════════════════════
   CARDS Y CONTAINERS
   ════════════════════════════════════════════════════════════ */

.grupos-coordinador-view .card,
.grupo-estudiante-view .card {
    border: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.grupos-coordinador-view .card-header,
.grupo-estudiante-view .card-header {
    background: #f8f9fa;
    border-bottom: 2px solid #007bff;
    font-weight: 600;
}

/* ════════════════════════════════════════════════════════════
   FORMULARIO CREAR ACTIVIDAD
   ════════════════════════════════════════════════════════════ */

#formCrearActividad {
    animation: slideDown 0.3s ease;
}

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

#formCrearActividad .form-group {
    margin-bottom: 20px;
}

#formCrearActividad label {
    font-weight: 600;
    margin-bottom: 8px;
    display: block;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #dee2e6;
}

/* ════════════════════════════════════════════════════════════
   BOTONES DE GRUPOS
   ════════════════════════════════════════════════════════════ */

.btn-check:checked + .btn-outline-primary {
    background-color: #007bff;
    color: white;
}

/* ════════════════════════════════════════════════════════════
   ACTIVIDADES ACTIVAS
   ════════════════════════════════════════════════════════════ */

#actividadesActivas .card {
    transition: transform 0.2s, box-shadow 0.2s;
}

#actividadesActivas .card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

#actividadesActivas .card-header.bg-primary {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%) !important;
}

/* ════════════════════════════════════════════════════════════
   MODAL DE FINALIZACIÓN
   ════════════════════════════════════════════════════════════ */

#modalFinalizacion {
    animation: fadeInModal 0.3s ease;
}

@keyframes fadeInModal {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

#modalFinalizacion > div {
    animation: zoomIn 0.3s ease;
}

@keyframes zoomIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

#countdownDisplay {
    animation: pulse 1s ease infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* ════════════════════════════════════════════════════════════
   RESPONSIVE
   ════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    .timer-display {
        font-size: 24px;
        padding: 10px 20px;
    }
    
    .grupo-header {
        padding: 20px;
    }
    
    .grupo-header h3 {
        font-size: 22px;
    }
    
    #chatContainer {
        height: 300px;
    }
    
    .miembros-list {
        grid-template-columns: 1fr;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions button {
        width: 100%;
    }
}

/* ════════════════════════════════════════════════════════════
   UTILIDADES
   ════════════════════════════════════════════════════════════ */

.header-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #007bff;
}

.header-section h2 {
    margin: 0;
    color: #333;
}

/* Estados de alerta en chat */
.alert-warning {
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-5px);
    }
    75% {
        transform: translateX(5px);
    }
}
