/* Estilos específicos para el panel de resultados */

.results-panel {
    background: white;
    padding: 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Contenedor de resultados estadísticos */
.results-container {
    margin-bottom: 1.5rem;
}

.results-summary {
    background-color: #dbeafe;
    padding: 1rem;
    border-radius: 0.5rem;
    border-left: 4px solid var(--primary-color);
}

.results-summary h3 {
    font-weight: 600;
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    padding: 0.25rem 0;
}

.stat-value {
    font-weight: 600;
    color: var(--primary-color);
}

/* Contenedor de placas visualizadas */
.sheets-container {
    max-height: 600px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

/* Estilos para la barra de desplazamiento */
.sheets-container::-webkit-scrollbar {
    width: 6px;
}

.sheets-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.sheets-container::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.sheets-container::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Tarjeta individual de placa */
.sheet-card {
    margin-bottom: 1.5rem;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    background-color: #fafafa;
}

.sheet-title {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-color);
    font-size: 1.1rem;
}

.sheet-visualization {
    margin: 0 auto;
    position: relative;
    background: linear-gradient(45deg, #f0f0f0 25%, transparent 25%), 
                linear-gradient(-45deg, #f0f0f0 25%, transparent 25%), 
                linear-gradient(45deg, transparent 75%, #f0f0f0 75%), 
                linear-gradient(-45deg, transparent 75%, #f0f0f0 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
}

/* Estado cuando no hay resultados */
.no-results {
    text-align: center;
    color: #6b7280;
    font-style: italic;
    padding: 2rem;
}

/* Indicadores de eficiencia */
.efficiency-high {
    color: var(--success-color);
}

.efficiency-medium {
    color: #f59e0b;
}

.efficiency-low {
    color: var(--danger-color);
}
/* MEJORAS RESPONSIVAS CRÍTICAS PARA FILAS DE PIEZAS */
@media (max-width: 1024px) {
    .piece-row {
        grid-template-columns: repeat(4, 1fr);
        gap: 0.25rem;
    }
    
    .piece-row .remove-piece {
        grid-column: span 1;
    }
}

@media (max-width: 768px) {
    .piece-row {
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
        padding: 0.5rem;
        border: 1px solid var(--border-color);
        border-radius: 0.375rem;
        margin-bottom: 0.75rem;
        background: #f9fafb;
    }
    
    .piece-row input {
        width: 100%;
    }
    
    /* Añadir labels para mejor usabilidad en móvil */
    .piece-row::before {
        content: "Pieza";
        grid-column: 1 / -1;
        font-weight: 600;
        color: var(--text-color);
        font-size: 0.875rem;
        margin-bottom: 0.25rem;
    }
    
    .piece-width::before {
        content: "Ancho";
        display: block;
        font-size: 0.75rem;
        color: #6b7280;
        margin-bottom: 0.125rem;
    }
    
    .piece-height::before {
        content: "Alto";
        display: block;
        font-size: 0.75rem;
        color: #6b7280;
        margin-bottom: 0.125rem;
    }
    
    .piece-quantity::before {
        content: "Cant.";
        display: block;
        font-size: 0.75rem;
        color: #6b7280;
        margin-bottom: 0.125rem;
    }
}

@media (max-width: 480px) {
    .piece-row {
        grid-template-columns: 1fr;
        gap: 0.25rem;
    }
    
    .input-panel {
        padding: 1rem;
    }
}

.piece-row input {
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 0.25rem;
    width: 100%;
    box-sizing: border-box;
    font-size: 1rem; /* Mejor legibilidad en móvil */
}

.piece-row input:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Botón de eliminar pieza */
.remove-piece {
    background-color: var(--danger-color);
    color: white;
    border: none;
    border-radius: 0.25rem;
    padding: 0.5rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
    font-size: 1rem;
    min-height: 44px; /* Tamaño mínimo touch */
}

.remove-piece:hover {
    background-color: var(--danger-hover);
}

/* Sección de optimización */
.optimize-section {
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
}

.optimize-btn {
    background-color: var(--success-color);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;
    font-weight: 600;
    width: 100%;
    transition: background-color 0.2s ease;
    font-size: 1.1rem;
    min-height: 50px; /* Tamaño touch adecuado */
}

.optimize-btn:hover {
    background-color: var(--success-hover);
}

.optimize-btn:disabled {
    background-color: #9ca3af;
    cursor: not-allowed;
}

/* Mejoras de touch para móviles */
@media (max-width: 768px) {
    .add-piece-btn,
    .optimize-btn,
    .remove-piece {
        min-height: 44px; /* Tamaño mínimo recomendado para touch */
    }
    
    .optimize-btn {
        font-size: 1.2rem; /* Más grande en móviles */
        padding: 1rem 1.5rem;
    }
}