/* ============================================================================
   ESTILOS COMPLEMENTARIOS PARA LA CALCULADORA
   ============================================================================ */

/* Estilos para diseños guardados — dark theme */
.saved-designs-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
}

.saved-design-item {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.09);
    border-radius: 8px;
    padding: 15px;
    transition: all 0.3s ease;
}

.saved-design-item:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    transform: translateY(-2px);
}

.saved-design-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 16px;
}

.saved-design-date {
    font-size: 12px;
    color: #64748b;
}

.saved-design-info {
    color: #94a3b8;
    font-size: 14px;
    margin-bottom: 10px;
}

.btn-small {
    padding: 5px 10px;
    font-size: 12px;
}

/* Tabla de comparación — dark theme */
.comparison-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: rgba(255,255,255,0.03);
    border-radius: 8px;
    overflow: hidden;
}

.comparison-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

.comparison-table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
}

.comparison-table td {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    color: #cbd5e1;
}

.comparison-table tbody tr:hover {
    background-color: rgba(255,255,255,0.04);
}

.comparison-table tr.success td {
    color: #34d399;
}

.comparison-table tr.warning td {
    color: #fcd34d;
}

.comparison-table tr.error td {
    color: #f87171;
}

/* Botones de exportación */
.export-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.export-section,
.import-section {
    margin-top: 30px;
    padding: 20px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
}

.export-section h3,
.import-section h3 {
    margin-top: 0;
    color: #94a3b8;
}

/* Comparación de controles */
.comparison-controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

/* Info text */
.info-text {
    color: #64748b;
    font-size: 14px;
    margin-bottom: 20px;
}

/* Animaciones de carga */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.loading {
    animation: pulse 1.5s ease-in-out infinite;
}

/* Mensajes de validación inline — dark theme */
.validation-container {
    margin: 15px 0;
}

.validation-errors,
.validation-warnings,
.validation-suggestions {
    margin-bottom: 10px;
    padding: 10px 12px;
    border-radius: 8px;
}

.validation-errors {
    background: rgba(239,68,68,0.12);
    border-left: 3px solid rgba(239,68,68,0.6);
}

.validation-warnings {
    background: rgba(245,158,11,0.12);
    border-left: 3px solid rgba(245,158,11,0.6);
}

.validation-suggestions {
    background: rgba(59,130,246,0.1);
    border-left: 3px solid rgba(59,130,246,0.5);
}

.validation-success {
    background: rgba(16,185,129,0.12);
    border-left: 3px solid rgba(16,185,129,0.6);
    padding: 10px 12px;
    border-radius: 8px;
    margin: 15px 0;
}

.validation-title {
    font-weight: bold;
    margin-bottom: 5px;
}

.validation-title.error {
    color: #f87171;
}

.validation-title.warning {
    color: #fcd34d;
}

.validation-title.suggestion {
    color: #60a5fa;
}

.validation-message {
    font-size: 13px;
    margin: 4px 0;
    padding-left: 8px;
    color: #cbd5e1;
}

.validation-message.error {
    color: #fca5a5;
}

.validation-message.warning {
    color: #fde68a;
}

.validation-message.suggestion {
    color: #93c5fd;
}

/* Tooltips */
.tooltip {
    position: absolute;
    z-index: 1000;
    background: #333;
    color: white;
    padding: 8px 12px;
    border-radius: 5px;
    font-size: 12px;
    pointer-events: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .comparison-controls {
        grid-template-columns: 1fr;
    }
    
    .export-buttons {
        flex-direction: column;
    }
    
    .export-buttons button {
        width: 100%;
    }
    
    .saved-design-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .comparison-table {
        font-size: 12px;
    }
    
    .comparison-table th,
    .comparison-table td {
        padding: 8px 6px;
    }
}

/* Estados de botones */
.btn-primary:disabled,
.btn-secondary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary:active,
.btn-secondary:active {
    transform: scale(0.98);
}

/* Indicador de guardado */
.save-indicator {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #28a745;
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    z-index: 1000;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Botón de auto-selección AWG */
.btn-auto {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 5px 12px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    margin-left: 5px;
    transition: all 0.3s ease;
}

.btn-auto:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
}

.btn-auto:active {
    transform: scale(0.95);
}

/* Botón de corrección automática */
.btn-fix {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
}

.btn-fix:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.5);
}

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

/* Info del cable */
#wireGaugeInfo {
    display: block;
    margin-top: 5px;
    font-weight: 500;
}

/* Notificaciones */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    z-index: 10000;
    max-width: 300px;
    word-wrap: break-word;
}

.notification-success {
    background: #28a745;
}

.notification-error {
    background: #dc3545;
}

.notification-info {
    background: #17a2b8;
}

.notification-warning {
    background: #ffc107;
    color: #000;
}

/* Estilos para canvas containers — dark theme */
.canvas-container {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
}

.canvas-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 15px;
    color: #94a3b8;
}

canvas {
    max-width: 100%;
    height: auto;
}