/**
 * DQA Course Scores
 * Tabla de calificaciones de cursos del estudiante
 */

/* ========================================= */
/* Container Principal */
/* ========================================= */
.dqa-course-scores-component {
    width: 100%;
    font-family: var(--fuentePrincipalDash, -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif);
}

/* ========================================= */
/* Header */
/* ========================================= */
.dqa-course-scores-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.dqa-course-scores-title {
    font-size: 2rem !important;
    font-weight: 700;
    color: #000;
    margin: 0;
}

/* Botón de icono para agregar curso */
.dqa-course-scores-component .dqa-add-course-icon-btn,
.dqa-course-scores-component button.dqa-add-course-icon-btn {
    background: none !important;
    border: none !important;
    cursor: pointer;
    font-size: 2rem !important;
    padding: 0.4rem !important;
    color: var(--colorMoradoOscuro, rgba(168,162,208,1)) !important;
    transition: color 0.2s ease;
    border-radius: 0 !important;
    font-weight: 400 !important;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dqa-course-scores-component .dqa-add-course-icon-btn:hover,
.dqa-course-scores-component button.dqa-add-course-icon-btn:hover {
    color: var(--colorLavanda, rgba(198,193,223,1)) !important;
    background: none !important;
}

.dqa-add-course-icon-btn i {
    font-size: 2rem;
    color: #000;
    fill: #000;
}

/* ========================================= */
/* Tabla */
/* ========================================= */
.dqa-course-scores-table-container {
    width: 100%;
    overflow-x: auto;
}

.dqa-course-scores-table {
    width: 100%;
    border-collapse: collapse;
    background-color: #fff;
    border: none;
}

/* Filas de cursos */
.dqa-course-row {
    border-bottom: none;
    transition: background-color 0.15s ease;
}

.dqa-course-row:hover {
    background-color: var(--colorLavandaClaro2, rgba(198,193,223,0.1));
}

/* Celdas */
.dqa-course-cell {
    padding: 0.8rem 0.6rem;
    text-align: center;
    border: none;
    font-size: 1.4rem;
    color: #000;
    font-weight: 400;
}

/* Celda del nombre del curso (primera columna) */
.dqa-course-name-cell {
    text-align: left;
    font-weight: 600;
    padding-left: 1rem;
    min-width: 120px;
    max-width: 150px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Celdas de scores */
.dqa-score-cell {
    min-width: 40px;
    max-width: 45px;
    font-weight: 500;
    padding: 0.8rem 0.2rem;
}

/* Celda de acciones */
.dqa-actions-cell {
    min-width: 80px;
    max-width: 80px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 0.4rem;
}

/* Botones de acción */
.dqa-action-btn {
    background: none !important;
    border: none !important;
    cursor: pointer;
    font-size: 1.4rem;
    padding: 0.4rem !important;
    transition: color 0.2s ease;
    color: #6b7280 !important;
    border-radius: 0 !important;
    font-weight: 400 !important;
}

.dqa-action-btn:hover {
    color: var(--colorMoradoOscuro, rgba(168,162,208,1)) !important;
    background: none !important;
}

.dqa-delete-course-btn:hover {
    color: #dc2626 !important;
    background: none !important;
}

/* ========================================= */
/* Empty State */
/* ========================================= */
.dqa-course-scores-empty {
    text-align: center;
    padding: 2rem 1rem;
    color: #9ca3af;
}

.dqa-course-scores-empty i {
    font-size: 3rem;
    margin-bottom: 0.8rem;
    opacity: 0.5;
}

.dqa-course-scores-empty p {
    font-size: 1.4rem;
    margin: 0;
}

/* ========================================= */
/* Modal Overlay */
/* ========================================= */
.dqa-course-modal-overlay,
.dqa-delete-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    backdrop-filter: blur(2px);
}

.dqa-course-modal-overlay.show,
.dqa-delete-modal-overlay.show {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

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

/* ========================================= */
/* Modal */
/* ========================================= */
.dqa-course-modal,
.dqa-delete-modal {
    background-color: #fff;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    position: relative;
    animation: slideUp 0.3s ease;
}

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

/* Delete modal más pequeño */
.dqa-delete-modal {
    max-width: 400px;
}

/* ========================================= */
/* Scores Grid (6 inputs en el formulario) */
/* ========================================= */
.dqa-scores-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.dqa-score-input {
    text-align: center;
}

/* ========================================= */
/* Sobrescribir estilos de Elementor en botones del modal */
/* ========================================= */
.dqa-course-modal-overlay .dqa-modal-btn,
.dqa-delete-modal-overlay .dqa-modal-btn,
.dqa-course-modal button.dqa-modal-btn,
.dqa-delete-modal button.dqa-modal-btn {
    font-family: var(--fuentePrincipalDash) !important;
    padding: 1rem 3rem !important;
    font-size: 1.6rem !important;
    font-weight: 500 !important;
    border-radius: 10rem !important;
    cursor: pointer;
    transition: background-color 0.2s;
    border: none !important;
}

.dqa-modal-btn-primary {
    background-color: var(--colorMoradoOscuro, rgba(168,162,208,1)) !important;
    color: #fff !important;
}

.dqa-modal-btn-primary:hover {
    background-color: var(--colorMoradoOscuro, rgba(168,162,208,1)) !important;
    color: #fff !important;
}

.dqa-course-modal-overlay .dqa-modal-btn-secondary,
.dqa-delete-modal-overlay .dqa-modal-btn-secondary,
.dqa-course-modal .dqa-modal-btn-secondary,
.dqa-delete-modal .dqa-modal-btn-secondary {
    background-color: var(--btnSecondaryBg, #e5e7eb) !important;
    color: var(--btnSecondaryText, #374151) !important;
}

.dqa-course-modal-overlay .dqa-modal-btn-secondary:hover,
.dqa-delete-modal-overlay .dqa-modal-btn-secondary:hover,
.dqa-course-modal .dqa-modal-btn-secondary:hover,
.dqa-delete-modal .dqa-modal-btn-secondary:hover {
    background-color: var(--btnSecondaryBg, #e5e7eb) !important;
    color: var(--btnSecondaryText, #374151) !important;
}

.dqa-modal-btn-danger {
    background-color: #dc2626 !important;
    color: #fff !important;
}

.dqa-modal-btn-danger:hover {
    background-color: #b91c1c !important;
    color: #fff !important;
}

/* ========================================= */
/* Responsive */
/* ========================================= */
@media screen and (max-width: 768px) {
    .dqa-course-scores-header {
        gap: 1rem;
    }

    .dqa-course-scores-title {
        font-size: 1.6rem !important;
    }

    .dqa-add-course-icon-btn i {
        font-size: 1.8rem;
    }

    .dqa-course-name-cell {
        min-width: 100px;
        max-width: 120px;
        padding-left: 0.8rem;
    }

    .dqa-score-cell {
        min-width: 45px;
        max-width: 50px;
        font-size: 1.3rem;
        padding: 0.6rem 0.3rem;
    }

    .dqa-actions-cell {
        min-width: 70px;
        max-width: 70px;
        gap: 0.3rem;
    }

    .dqa-scores-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media screen and (max-width: 480px) {
    .dqa-course-scores-title {
        font-size: 1.4rem !important;
    }

    .dqa-add-course-icon-btn i {
        font-size: 1.6rem;
    }

    .dqa-course-cell {
        padding: 0.6rem 0.4rem;
        font-size: 1.3rem;
    }

    .dqa-scores-grid {
        grid-template-columns: 1fr;
    }
}
