/**
 * Estilos para Liberación de Servicios Escolares
 * CBTa 256 - Sistema Escolar
 */

/* ===================================
   Container Principal
   =================================== */
#cbta256-liberacion-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* ===================================
   Header
   =================================== */
.cbta256-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #0073aa;
}

.cbta256-header h2 {
    margin: 0 0 10px 0;
    color: #0073aa;
    font-size: 28px;
    font-weight: 600;
}

.cbta256-subtitle {
    margin: 0;
    color: #666;
    font-size: 14px;
}

/* ===================================
   Filtros y Selector de Grupo
   =================================== */
.cbta256-filters {
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 4px solid #0073aa;
}

.filter-group {
    margin-bottom: 0;
}

.filter-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.filter-group label i {
    margin-right: 5px;
    color: #0073aa;
}

.cbta256-select {
    width: 100%;
    max-width: 400px;
    padding: 10px 15px;
    font-size: 15px;
    border: 2px solid #ddd;
    border-radius: 4px;
    background: #ffffff;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cbta256-select:hover {
    border-color: #0073aa;
}

.cbta256-select:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

/* Loading Indicator */
.loading-indicator {
    display: inline-flex;
    align-items: center;
    margin-top: 15px;
    padding: 10px 15px;
    background: #fff;
    border-radius: 4px;
    color: #666;
    font-size: 14px;
}

.loading-indicator .spinner {
    float: none;
    margin: 0 10px 0 0;
}

.loading-text {
    font-weight: 500;
}

/* ===================================
   Info Bar
   =================================== */
.cbta256-info-bar {
    display: flex;
    gap: 30px;
    padding: 15px 20px;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 6px;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.info-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.info-item strong {
    font-weight: 600;
    opacity: 0.9;
}

.info-item span {
    font-weight: 700;
    font-size: 16px;
}

.liberados-count {
    margin-left: auto;
    padding: 5px 15px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 20px;
}

/* ===================================
   Tabla Principal
   =================================== */
.cbta256-table-responsive {
    overflow-x: auto;
    margin-bottom: 20px;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.liberacion-table {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
    font-size: 14px;
}

.liberacion-table thead {
    background: linear-gradient(135deg, #0073aa 0%, #005177 100%);
    color: #ffffff;
}

.liberacion-table thead th {
    padding: 15px 10px;
    text-align: center;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.liberacion-table thead th:last-child {
    border-right: none;
}

/* Columnas sticky */
.th-sticky {
    position: sticky;
    left: 0;
    z-index: 10;
    background: linear-gradient(135deg, #0073aa 0%, #005177 100%);
}

.th-sticky:nth-child(2) {
    left: 120px;
}

/* Headers de servicios con botón */
.th-servicio {
    min-width: 140px;
}

.th-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.btn-marcar-todas {
    padding: 4px 12px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    color: #ffffff;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.btn-marcar-todas:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-1px);
}

.btn-marcar-todas:active {
    transform: translateY(0);
}

.btn-marcar-todas i {
    font-size: 14px;
}

/* Header Liberado */
.th-liberado {
    min-width: 100px;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

/* Body de la tabla */
.liberacion-table tbody tr {
    border-bottom: 1px solid #e9ecef;
    transition: background-color 0.2s ease;
}

.liberacion-table tbody tr:hover {
    background-color: #f8f9fa;
}

.liberacion-table tbody tr:last-child {
    border-bottom: none;
}

.liberacion-table tbody td {
    padding: 12px 10px;
    text-align: center;
    vertical-align: middle;
}

/* Columna No. Control */
.td-control {
    font-weight: 600;
    color: #0073aa;
    font-family: 'Courier New', monospace;
    position: sticky;
    left: 0;
    background: #ffffff;
    z-index: 5;
    text-align: left;
    padding-left: 15px;
}

.liberacion-table tbody tr:hover .td-control {
    background-color: #f8f9fa;
}

/* Columna Nombre */
.td-nombre {
    text-align: left;
    font-weight: 500;
    color: #333;
    position: sticky;
    left: 120px;
    background: #ffffff;
    z-index: 5;
    min-width: 250px;
}

.liberacion-table tbody tr:hover .td-nombre {
    background-color: #f8f9fa;
}

/* Checkboxes personalizados */
.td-checkbox {
    padding: 12px;
}

.checkbox-container {
    display: inline-flex;
    position: relative;
    cursor: pointer;
    user-select: none;
    padding: 5px;
}

.checkbox-container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    height: 28px;
    width: 28px;
    background-color: #fff;
    border: 2px solid #ddd;
    border-radius: 4px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.checkbox-container:hover .checkmark {
    border-color: #0073aa;
    background-color: #f0f8ff;
}

.checkbox-container input:checked ~ .checkmark {
    background-color: #0073aa;
    border-color: #0073aa;
}

.checkbox-container input:checked ~ .checkmark:after {
    content: "";
    display: block;
    width: 6px;
    height: 12px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Columna Liberado */
.td-liberado {
    font-weight: 600;
}

.badge-liberado {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
}

.liberado-si {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(17, 153, 142, 0.3);
}

.liberado-no {
    background: linear-gradient(135deg, #ee0979 0%, #ff6a00 100%);
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(238, 9, 121, 0.3);
}

/* ===================================
   Botones de Acción
   =================================== */
.cbta256-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    padding: 20px 0;
}

.cbta256-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.cbta256-btn i {
    font-size: 18px;
}

.cbta256-btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
}

.cbta256-btn-primary:hover {
    background: linear-gradient(135deg, #5568d3 0%, #663a8b 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

.cbta256-btn-secondary {
    background: #6c757d;
    color: #ffffff;
}

.cbta256-btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(108, 117, 125, 0.3);
}

.cbta256-btn:active {
    transform: translateY(0);
}

/* ===================================
   Mensajes
   =================================== */
.cbta256-message {
    padding: 15px 20px;
    margin: 20px 0;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 500;
    animation: slideIn 0.3s ease;
}

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

.cbta256-message.success {
    background: #d4edda;
    color: #155724;
    border-left: 4px solid #28a745;
}

.cbta256-message.error {
    background: #f8d7da;
    color: #721c24;
    border-left: 4px solid #dc3545;
}

.cbta256-message.info {
    background: #d1ecf1;
    color: #0c5460;
    border-left: 4px solid #17a2b8;
}

.cbta256-message.warning {
    background: #fff3cd;
    color: #856404;
    border-left: 4px solid #ffc107;
}

/* ===================================
   Modal
   =================================== */
.cbta256-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: none;
}

.cbta256-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.cbta256-modal-content {
    position: relative;
    width: 90%;
    max-width: 500px;
    margin: 100px auto;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
    z-index: 10001;
}

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

.cbta256-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 2px solid #e9ecef;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px 12px 0 0;
}

.cbta256-modal-header h3 {
    margin: 0;
    color: #ffffff;
    font-size: 20px;
    font-weight: 600;
}

.cbta256-modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #ffffff;
    font-size: 28px;
    font-weight: 300;
    cursor: pointer;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    line-height: 1;
}

.cbta256-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.cbta256-modal-body {
    padding: 30px 25px;
    text-align: center;
}

.modal-icon {
    margin-bottom: 20px;
}

.modal-icon i {
    font-size: 60px;
    color: #667eea;
}

.cbta256-modal-body p {
    margin: 0 0 25px 0;
    font-size: 16px;
    color: #333;
    line-height: 1.6;
}

.modal-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    text-align: left;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #dee2e6;
}

.stat-item:last-child {
    border-bottom: none;
}

.stat-item strong {
    color: #666;
}

.stat-item span {
    font-weight: 600;
    color: #0073aa;
}

.cbta256-modal-footer {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding: 20px 25px;
    border-top: 1px solid #e9ecef;
    background: #f8f9fa;
    border-radius: 0 0 12px 12px;
}

body.modal-open {
    overflow: hidden;
}

/* ===================================
   Responsive
   =================================== */
@media (max-width: 768px) {
    #cbta256-liberacion-container {
        padding: 15px;
    }
    
    .cbta256-header h2 {
        font-size: 22px;
    }
    
    .cbta256-info-bar {
        flex-direction: column;
        gap: 10px;
    }
    
    .liberados-count {
        margin-left: 0;
    }
    
    .liberacion-table {
        font-size: 12px;
    }
    
    .liberacion-table thead th {
        padding: 10px 6px;
        font-size: 11px;
    }
    
    .liberacion-table tbody td {
        padding: 8px 6px;
    }
    
    .th-sticky:nth-child(2) {
        left: 100px;
    }
    
    .td-control {
        min-width: 100px;
    }
    
    .td-nombre {
        left: 100px;
        min-width: 180px;
    }
    
    .checkmark {
        height: 24px;
        width: 24px;
    }
    
    .cbta256-actions {
        flex-direction: column;
    }
    
    .cbta256-btn {
        width: 100%;
        justify-content: center;
    }
    
    .cbta256-modal-content {
        width: 95%;
        margin: 50px auto;
    }
}
