/**
 * Estilos para Calculadora de Bajas Temerarias
 * Version: 1.0.0
 */

/* Contenedor Principal */
.cbt-container {
    max-width: 1200px;
    margin: 20px auto;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
}

/* Header */
.cbt-header {
    background-color: #00427b;
    color: white;
    padding: 30px;
    text-align: center;
}

.cbt-header h2 {
    margin: 0 0 10px 0;
    font-size: 28px;
    font-weight: 600;
}

.cbt-descripcion {
    margin: 0;
    opacity: 0.95;
    font-size: 16px;
}

/* Formulario */
.cbt-form {
    padding: 30px;
}

.cbt-seccion {
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 4px solid #00427b;
}

.cbt-seccion h3 {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 20px;
    font-weight: 500;
}

/* Campos del formulario */
.cbt-campo {
    margin-bottom: 20px;
}

.cbt-campo label {
    display: block;
    margin-bottom: 8px;
    color: #495057;
    font-weight: 500;
    font-size: 14px;
}

.cbt-campo input[type="number"],
.cbt-campo input[type="text"],
.cbt-campo select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 15px;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.cbt-campo input:focus,
.cbt-campo select:focus {
    outline: none;
    border-color: #00427b;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Ofertas de licitadores */
.cbt-oferta-item {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 15px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.cbt-oferta-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.cbt-oferta-numero {
    font-weight: 600;
    color: #00427b;
    margin-bottom: 10px;
    font-size: 16px;
}

.cbt-oferta-campos {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 15px;
    align-items: end;
}

.cbt-campo-inline {
    display: flex;
    flex-direction: column;
}

.cbt-campo-inline label {
    margin-bottom: 5px;
    font-size: 13px;
    color: #6c757d;
}

.cbt-campo-inline input {
    padding: 8px 10px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
}

/* Porcentajes de baja */
.porcentaje-baja {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 4px;
    font-weight: 600;
    text-align: center;
    background: #e9ecef;
    color: #495057;
    font-size: 14px;
}

.porcentaje-baja.baja-baja {
    background: #d4edda;
    color: #155724;
}

.porcentaje-baja.baja-media {
    background: #fff3cd;
    color: #856404;
}

.porcentaje-baja.baja-alta {
    background: #f8d7da;
    color: #721c24;
}

/* Botones */
.cbt-botones {
    display: flex;
    gap: 15px;
    justify-content: center;
    padding: 20px;
}

.cbt-btn {
    padding: 12px 30px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.cbt-btn-primary {
    background-color: #00427b;
    color: white;
}

.cbt-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.cbt-btn-secondary {
    background: #6c757d;
    color: white;
}

.cbt-btn-secondary:hover {
    background: #5a6268;
}

.cbt-btn-export {
    background: #28a745;
    color: white;
}

.cbt-btn-print {
    background: #17a2b8;
    color: white;
}

/* Resultados */
.cbt-resultados {
    background: #f8f9fa;
    padding: 30px;
    border-top: 1px solid #dee2e6;
}

.cbt-resultados h3 {
    color: #333;
    margin-bottom: 20px;
    font-size: 24px;
    text-align: center;
}

.cbt-resultado-contenedor {
    background: white;
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

/* Método de cálculo */
.cbt-metodo-calculo {
    background: #e7f3ff;
    border-left: 4px solid #007bff;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
}

.cbt-metodo-calculo h4 {
    margin: 0 0 10px 0;
    color: #004085;
    font-size: 16px;
}

.cbt-metodo-calculo p {
    margin: 0;
    color: #004085;
}

/* Estadísticas */
.cbt-estadisticas {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.cbt-stat-item {
    background: linear-gradient(135deg, #00427b 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
}

.cbt-stat-label {
    display: block;
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 8px;
}

.cbt-stat-valor {
    display: block;
    font-size: 24px;
    font-weight: 600;
}

/* Detalles del cálculo */
.cbt-detalles-calculo {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.cbt-detalles-calculo h5 {
    margin: 0 0 10px 0;
    color: #495057;
    font-size: 16px;
}

.cbt-detalles-calculo ul {
    margin: 0;
    padding-left: 20px;
}

.cbt-detalles-calculo li {
    margin-bottom: 8px;
    color: #6c757d;
}

.cbt-detalles-calculo strong {
    color: #495057;
}

/* Tabla de ofertas */
.cbt-tabla-ofertas {
    margin-bottom: 25px;
}

.cbt-tabla-ofertas h4 {
    margin-bottom: 15px;
    color: #333;
    font-size: 18px;
}

.cbt-tabla-ofertas table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.cbt-tabla-ofertas th {
    background: #f8f9fa;
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: #495057;
    border-bottom: 2px solid #dee2e6;
}

.cbt-tabla-ofertas td {
    padding: 12px;
    border-bottom: 1px solid #dee2e6;
}

.cbt-tabla-ofertas tr:hover {
    background: #f8f9fa;
}

.cbt-tabla-ofertas tr.estado-temeraria {
    background: #fff5f5;
}

.cbt-tabla-ofertas tr.estado-temeraria:hover {
    background: #ffe0e0;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.badge.estado-normal {
    background: #28a745;
    color: white;
}

.badge.estado-temeraria {
    background: #dc3545;
    color: white;
}

/* Alertas */
.cbt-alerta {
    padding: 20px;
    border-radius: 6px;
    margin-top: 20px;
}

.cbt-alerta h4 {
    margin: 0 0 10px 0;
    font-size: 18px;
}

.cbt-alerta p {
    margin: 0 0 10px 0;
}

.cbt-alerta p:last-child {
    margin-bottom: 0;
}

.cbt-alerta-success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.cbt-alerta-warning {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
}

.cbt-nota {
    font-size: 14px;
    font-style: italic;
    opacity: 0.9;
}

/* Acciones */
.cbt-acciones {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #dee2e6;
}

/* Regulación */
.cbt-regulacion {
    background: #f8f9fa;
    padding: 20px 30px;
    border-top: 1px solid #dee2e6;
}

.cbt-regulacion h4 {
    color: #495057;
    margin-bottom: 10px;
    font-size: 16px;
}

.cbt-regulacion p {
    color: #6c757d;
    margin-bottom: 15px;
    font-size: 14px;
}

.cbt-regulacion details {
    background: white;
    padding: 15px;
    border-radius: 6px;
    border: 1px solid #dee2e6;
}

.cbt-regulacion summary {
    cursor: pointer;
    font-weight: 500;
    color: #495057;
    margin-bottom: 10px;
}

.cbt-regulacion ul {
    margin: 10px 0 0 0;
    padding-left: 20px;
}

.cbt-regulacion li {
    margin-bottom: 8px;
    color: #6c757d;
    font-size: 14px;
}

/* Loading */
.cbt-loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.cbt-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #00427b;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.cbt-loading p {
    color: #00427b;
    font-size: 18px;
    font-weight: 500;
}

/* Responsive */
@media (max-width: 768px) {
    .cbt-container {
        margin: 10px;
        border-radius: 0;
    }
    
    .cbt-header {
        padding: 20px;
    }
    
    .cbt-header h2 {
        font-size: 22px;
    }
    
    .cbt-form {
        padding: 20px;
    }
    
    .cbt-oferta-campos {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .cbt-estadisticas {
        grid-template-columns: 1fr;
    }
    
    .cbt-botones {
        flex-direction: column;
    }
    
    .cbt-btn {
        width: 100%;
        justify-content: center;
    }
    
    .cbt-acciones {
        flex-direction: column;
    }
    
    .cbt-tabla-ofertas {
        overflow-x: auto;
    }
    
    .cbt-tabla-ofertas table {
        min-width: 500px;
    }
}

/* Print Styles */
@media print {
    .cbt-header {
        background: none !important;
        color: black !important;
        border-bottom: 2px solid black;
    }
    
    .cbt-botones,
    .cbt-acciones,
    .cbt-regulacion {
        display: none !important;
    }
    
    .cbt-container {
        box-shadow: none !important;
    }
    
    .cbt-stat-item {
        background: none !important;
        color: black !important;
        border: 1px solid black;
    }
}
