/**
 * DQA Tasks Management
 * Sistema de gestión de tareas (School Tasks + Tutor Assignments)
 */

/* ========================================= */
/* Lista de Tareas */
/* ========================================= */
.dqa-task-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.dqa-task-item {
    background-color: #F7F7F7;
    border: none;
    border-radius: 1rem;
    padding: 2rem 4rem;
    margin-bottom: 1.7rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    transition: background-color 0.3s ease;
}

/* Contenedor Flex para división de columnas */
.dqa-main-content-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    width: 100%;
}

/* Contenido de la izquierda */
.dqa-task-info {
    flex-grow: 1;
    padding-right: 20px;
}

/* Contenedor de Acciones (Columna Derecha) */
.dqa-task-actions-wrapper {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-end;
    white-space: nowrap;
}

/* Agrupar botones y badge de estado */
.dqa-status-controls-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Botones de estado centrados */
.dqa-status-controls {
    display: flex;
    gap: 5px;
}

/* ========================================= */
/* Estilos de Color por Estado */
/* ========================================= */
.dqa-task-item.dqa-status-try_again {
    background-color: var(--colorRojoDash2);
}

.dqa-task-item.dqa-status-done {
    background-color: var(--colorVerde3);
}

/* ========================================= */
/* Contenido de la Tarea */
/* ========================================= */
.dqa-task-header {
    margin-bottom: 1rem;
}

.dqa-task-title {
    font-family: var(--fuentePrincipalDash);
    font-size: 2rem;
    font-weight: 600;
    color: #000;
}

.dqa-course-name {
    font-family: var(--fuentePrincipalDash);
    font-size: 1.6rem;
    font-weight: 500;
    color: #000;
}

.dqa-due-date {
    font-family: var(--fuentePrincipalDash);
    font-size: 1.6rem;
    font-weight: 500;
    color: #000;
}

.dqa-task-excerpt {
    font-family: var(--fuentePrincipalDash);
    font-size: 1.8rem;
    line-height: 1.2em;
    color: #000;
    margin-top: 1rem;
    margin-bottom: 0;
}

/* ========================================= */
/* Badges (DONE y TRY AGAIN) */
/* ========================================= */
.dqa-status-badge {
    font-family: var(--fuentePrincipalDash);
    padding: 0.5rem 1.6rem;
    border-radius: 10rem;
    font-size: 1.6rem;
    font-weight: 500;
    color: #000;
    display: inline-block;
}

.dqa-status-done .dqa-status-badge {
    background-color: var(--colorVerde);
}

.dqa-status-try_again .dqa-status-badge {
    background-color: var(--colorRojoDash);
}

.dqa-status-badge i {
    margin-right: 0.6rem;
}

/* ========================================= */
/* Botones de Estado (Check y X) */
/* ========================================= */
.dqa-status-btn {
    background: none;
    border: 1px solid #ccc;
    color: #000;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.dqa-btn-check {
    color: #0A0A0A !important;
    border-color: transparent !important;
    background-color: transparent !important;
}

.dqa-btn-check i {
    font-size: 2rem;
}

.dqa-btn-x {
    color: #0A0A0A !important;
    border-color: transparent !important;
    background-color: transparent !important;
}

.dqa-btn-x i {
    font-size: 2rem;
}

.dqa-status-btn:hover {
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
}

.dqa-status-btn.is-loading {
    opacity: 0.7;
    cursor: wait;
    box-shadow: none !important;
}

/* ========================================= */
/* Botones de Gestión (Editar y Eliminar) */
/* ========================================= */
.dqa-student-management-controls {
    display: flex;
    gap: 1rem;
}

.dqa-student-management-controls .dqa-admin-btn {
    background-color: transparent;
    border: none;
}

.dqa-student-management-controls .dqa-admin-btn i {
    font-size: 1.8rem;
    color: #000;
}

.dqa-student-management-controls .dqa-admin-btn:hover {
    background-color: transparent;
}


/*
    Agregar Tarea
*/
.dqa-add-assignment-btn-container { justify-content: flex-end; display: flex; margin-top:4rem; }
.dqa-add-assignment-btn-container .dqa-add-assignment-btn {  }
.dqa-add-assignment-btn-container .dqa-add-assignment-btn i { font-size:2.5rem; }


/* ========================================= */
/* Modal de Felicitaciones */
/* ========================================= */
.dqa-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.6);
    justify-content: center;
    align-items: center;
}

.dqa-modal.show {
    display: flex;
}

.dqa-modal-content {
    background-color: #fefefe;
    margin: auto;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    position: relative;
    text-align: center;
    width: 90%;
    max-width: 400px;
    animation: fadeIn 0.3s ease-out;
    overflow: hidden;
}

.dqa-modal-content h2 {
    font-size: 4.5rem !important;
    font-weight: 700;
    color: var(--colorMoradoOscuro2);
    margin-top: 2rem;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.dqa-modal-content p {
    display: none;
    font-size: 1.1em;
    color: #555;
    margin-bottom: 25px;
}

.dqa-close-button {
    color: #000;
    position: absolute;
    top: 1.5rem;
    right: 2.5rem;
    font-size: 2.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: color 0.2s;
}

.dqa-close-button:hover,
.dqa-close-button:focus {
    color: #333;
    text-decoration: none;
    cursor: pointer;
}

.dqa-modal-ok-button {
    background-color: var(--colorMoradoOscuro2);
    color: white;
    padding: 10px 25px;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1em;
    font-weight: bold;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.dqa-modal-ok-button:hover {
    background-color: var(--colorMoradoOscuro);
    transform: translateY(-2px);
}

/* Animación de entrada del modal */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================= */
/* Efecto Confeti */
/* ========================================= */
.dqa-confetti {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

.dqa-modal.show .dqa-confetti::before,
.dqa-modal.show .dqa-confetti::after {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    border-style: solid;
    opacity: 0;
    animation: confettiBurst 1s forwards ease-out;
}

.dqa-modal.show .dqa-confetti::before {
    border-width: 0 10px 10px 10px;
    border-color: transparent transparent #ffd700 transparent;
    left: 40%;
    top: 40%;
    animation-delay: 0.1s;
}

.dqa-modal.show .dqa-confetti::after {
    border-width: 10px 10px 0 10px;
    border-color: #ff69b4 transparent transparent transparent;
    left: 55%;
    top: 35%;
    animation-delay: 0.2s;
}

@keyframes confettiBurst {
    0% {
        transform: scale(0) translateY(0);
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        transform: scale(1) translateY(-50px);
        opacity: 0;
    }
}

/* ========================================= */
/* Campos de Solo Lectura (Readonly) */
/* ========================================= */
.dqa-readonly-input {
    background-color: #F7F7F7 !important;
    color: #666 !important;
    cursor: not-allowed !important;
    border: none !important;
}

.dqa-readonly-input:focus {
    box-shadow: none !important;
    border-color: transparent !important;
}

/* Lista de archivos adjuntos */
.dqa-current-attachments {
    margin-bottom: 2.5rem;
}

.dqa-attachments-list {
    list-style: none;
    padding: 0;
    margin: 0.5rem 0 0 0;
}

.dqa-attachments-list li {
    padding: 0.8rem 0;
    font-family: var(--fuentePrincipalDash);
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.dqa-attachments-list li i {
    margin-right: 0.8rem;
    color: var(--colorLavanda);
}

.dqa-attachments-list li a {
    color: #000;
    text-decoration: none;
    flex-grow: 1;
}

.dqa-attachments-list li a:hover {
    color: var(--colorLavanda);
    text-decoration: underline;
}

/* Botón de eliminar archivo */
.dqa-attachments-list .dqa-delete-attachment-btn {
    background-color: transparent !important;
    border: none !important;
    color: #c36 !important;
    padding: 0.4rem !important;
    border-radius: 0 !important;
    cursor: pointer;
    font-size: 1.4rem !important;
    font-weight: normal !important;
    width: auto !important;
    height: auto !important;
    min-width: auto !important;
    transition: color 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.dqa-attachments-list .dqa-delete-attachment-btn:hover {
    color: #a02 !important;
    background-color: transparent !important;
}

.dqa-attachments-list .dqa-delete-attachment-btn i {
    margin-right: 0 !important;
    font-size: 1.4rem;
}

.dqa-attachments-list .dqa-delete-attachment-btn:disabled {
    opacity: 0.6;
    cursor: wait;
}

/* Botón neutral (gris) para file upload */
.dqa-btn-neutral {
    background-color: #efeded !important;
    color: #000 !important;
    align-self: flex-start; /* Solo ocupa el ancho necesario en contenedores flex */
    width: auto !important; /* No ocupar todo el ancho */
}

.dqa-btn-neutral:hover {
    background-color: #efeded !important;
}

.dqa-btn-neutral i {
    margin-right: 0.5rem;
}

/* Hint text para campos */
.dqa-field-hint {
    display: block;
    margin-top: 0.5rem;
    font-family: var(--fuentePrincipalDash);
    font-size: 1.3rem;
    color: #666;
    font-style: italic;
}

/* Vista previa de archivos seleccionados */
.dqa-file-preview {
    margin-top: 1rem;
}

.dqa-selected-files {
    list-style: none;
    padding: 0;
    margin: 0;
}

.dqa-selected-files li {
    padding: 0.5rem 0;
    font-family: var(--fuentePrincipalDash);
    font-size: 1.4rem;
    color: #000;
}

.dqa-selected-files li i {
    margin-right: 0.8rem;
    color: var(--colorLavanda);
}

/* Mensaje del formulario */
.dqa-form-message {
    margin-top: 1.5rem;
    padding: 1.2rem 1.5rem;
    border-radius: 1rem;
    font-family: var(--fuentePrincipalDash);
    font-size: 1.4rem;
}

.dqa-form-message.success {
    background-color: var(--colorVerde3);
    color: #000;
}

.dqa-form-message.error {
    background-color: var(--colorRojoDash2);
    color: #000;
}

/* Botón loading state */
.btn-loading {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

/* ========================================= */
/* Teacher Feedback Section (Student View) */
/* ========================================= */
.dqa-teacher-feedback-section {
    margin-top: 30px;
    padding: 20px;
    background-color: var(--colorLavandaClaro2);
    border-left: 4px solid var(--colorLavanda);
    border-radius: 4px;
}

.dqa-teacher-feedback-section label {
    font-weight: 600;
    color: #0073aa;
    margin-bottom: 10px;
    display: block;
}

.dqa-teacher-feedback-section .dqa-feedback-content {
    background-color: white;
    padding: 15px;
    border-radius: 4px;
    line-height: 1.6;
}

.dqa-teacher-feedback-section small {
    display: block;
    margin-top: 10px;
    color: #666;
    font-style: italic;
}

/* ========================================= */
/* Student Response Section (Teacher View) */
/* ========================================= */
.dqa-student-response-section {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 2px solid #e5e5e5;
}

.dqa-student-response-section h3 {
    margin-bottom: 20px;
    color: #333;
    font-size: 1.2em;
}

.dqa-student-response-section textarea[readonly] {
    background-color: #f7f7f7;
    min-height: 120px;
    cursor: not-allowed;
}

.dqa-student-response-section textarea:not([readonly]) {
    min-height: 120px;
}

.dqa-student-response-section small {
    display: block;
    margin-top: 5px;
    color: #666;
}

/* ========================================= */
/* Slider de Exámenes Escolares */
/* ========================================= */
.dqa-exams-slider-component {
    position: relative;
    margin-bottom: 4rem;
}

/* Items del slider - Override de color de fondo */
.dqa-exam-slider-item {
    background-color: var(--colorLavandaClaro) !important;
}

/* Espaciado entre items del slider */
.dqa-exams-slider .slick-slide {
    margin: 0 1rem;
}

.dqa-exams-slider .slick-list {
    margin: 0 -1rem;
}

/* Mensaje cuando no hay exámenes */
.dqa-exams-slider-empty {
    text-align: center;
    padding: 4rem 2rem;
}

.dqa-exams-slider-empty p {
    font-family: var(--fuentePrincipalDash);
    font-size: 1.8rem;
    color: #666;
    margin: 0;
}

/* ========================================= */
/* Teacher View Student Tasks (Read-Only) */
/* ========================================= */

/* Ocultar los botones de editar/eliminar en la vista del profesor */
#dqa-teacher-view-student-tasks .dqa-teacher-view-task .dqa-student-management-controls {
    display: none !important;
}

/* Opcional: Agregar un indicador visual de que es vista de solo lectura */
#dqa-teacher-view-student-tasks .dqa-task-item {
    cursor: default;
}

/* Comentado: Si el cliente quiere activar edición/eliminación más adelante, solo hay que comentar esta regla */
/*
#dqa-teacher-view-student-tasks .dqa-teacher-view-task .dqa-student-management-controls {
    display: flex !important;
}
*/
